0% found this document useful (0 votes)
47 views8 pages

8051 Interfacing

The document describes an experiment with a microprocessor to control 7-segment displays. It includes a flowchart and program to initialize registers and memory locations to display different patterns on the 7-segment display by changing the values stored in memory at specific addresses over time using delays. It initializes registers and pointers, writes values to memory locations, increments/decrements registers, and uses jumps and calls to repeat the process and delay between patterns.

Uploaded by

Dr.R.RAMAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views8 pages

8051 Interfacing

The document describes an experiment with a microprocessor to control 7-segment displays. It includes a flowchart and program to initialize registers and memory locations to display different patterns on the 7-segment display by changing the values stored in memory at specific addresses over time using delays. It initializes registers and pointers, writes values to memory locations, increments/decrements registers, and uses jumps and calls to repeat the process and delay between patterns.

Uploaded by

Dr.R.RAMAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

MICROPROCESSORS AND MICROCONTROLLERS LAB RECORD ECE Dept.

FLOW CHART:

START

DPTR FFC6H

A 90H
[DPTR] A

DPTR FFC0H

A [DPTR]

DPTR FFC2H

A [DPTR]

ADITYA COLLEGE OF ENGINEERING Page 58


MICROPROCESSORS AND MICROCONTROLLERS LAB RECORD ECE Dept.

Exp No:
Date:

13. SWITCHES AND LEDs


ABSTRACT:
REGISTERS USED:
PORTS USED:
ALGORITHM:
Step 1: Start.
Step 2: Initialize DPTR with FFC6H.
Step 3: Initialize Register A with 90H
Step 4: Move the value of Register A into memory location pointed by DPTR
Step 5: Initialize DPTR with FFC0H.
Step 6: Move the value of DPTR location to Register A
Step 7: Initialize DPTR with FFC2H.
Step 8: Move the value of Register A into memory location pointed by DPTR
Step 9: Stop

PROGRAM:

MOV DPTR,#FFC6H
MOV A,#90H
MOVX @DPTR,A
HLT: MOV DPTR,#FFC0H
MOVX A,@DPTR
MOV DPTR,#FFC2H
MOVX @DPTR,A
SJMP HLT

ADITYA COLLEGE OF ENGINEERING Page 59


MICROPROCESSORS AND MICROCONTROLLERS LAB RECORD ECE Dept.

CODE TABLE:
Physical Address
Label Hex Code Mnemonic Comments
Segment Offset
operand
Address Address

ADITYA COLLEGE OF ENGINEERING Page 60


MICROPROCESSORS AND MICROCONTROLLERS LAB RECORD ECE Dept.

MANUAL CALCLATIONS;

RESULT:

ADITYA COLLEGE OF ENGINEERING Page 61


MICROPROCESSORS AND MICROCONTROLLERS LAB RECORD ECE Dept.

FLOW CHART: START

A 10H
DPTR FFC2H

[DPTR] A
A CCH
[DPTR] A
A 90H
[DPTR] A
R2 10H

DPTR 5000H

R1 DPTR L.B
A [DPTR]
DPTR FFC0H
[DPTR] A
[DPL] R1
[DPH] 50H
R3 F0H

R4 FFH

R4=0 NO

YES

R3=0 NO

YES

R2=0
NO YES

ADITYA COLLEGE OF ENGINEERING Page 62


MICROPROCESSORS AND MICROCONTROLLERS LAB RECORD ECE Dept.

Exp No:
Date:

14. 7- SEGMENT DISPLAY


ABSTRACT:
REGISTERS USED:
PORTS USED:
ALGORITHM:
Step 1: Start.
Step 2: Initialize register A with 10H.
Step 3: Initialize DPTR with FFC2H.
Step 4: Move the Register A contents into DPTR memory location.
Step 5: Move CCH into Register A.
Step 6: Move the Register A contents into DPTR memory location.
Step 7: Move 90H into Register A.
Step 8: Move the Register A contents into DPTR memory location.
Step 9: Move 10H into R2 register.
Step 10: Initialize DPTR with 5000H.
Step 11: Move the DPTR lower byte into R1 register
Step 12: Move the contents of DPTR location into register A.
Step 13: Initialize DPTR with FFC0H.
Step 14: Move the Register A contents into DPTR memory location.
Step 15: Move the contents of Register R1 into DPTR lower byte location.
Step 16: Move 50H into DPTR Higher byte location.
Step 17: Increment DPTR by one.
Step 18:Call Delay
Step 19: Decrement R2 value and jump if R2 ≠ 0.
Step 20: Short jump
Step 21: Move F0H into R3 register.
Step 22: Call Delay
Step23: Decrement R3 value and jump if R2 ≠ 0.
Step 24: Return to call
Step 25: Move FFH into R4 register.
Step 26: Decrement R4 value and jump if R2 ≠ 0.
Step 27: Return to call
Step 28: Stop

PROGRAM:

AGAIN:MOV A,#10H
MOV DPTR,#FFC2
MOVX @DPTR,A
MOV A,#0CCH
MOVX @DPTR,A
MOV A,#90H
MOVX @DPTR,A
MOV R2,#10H
MOV DPTR,#5000H

ADITYA COLLEGE OF ENGINEERING Page 63


MICROPROCESSORS AND MICROCONTROLLERS LAB RECORD ECE Dept.

CODE TABLE:
Physical Address
Label Hex Code Mnemonic Comments
Segment Offset
operand
Address Address

ADITYA COLLEGE OF ENGINEERING Page 64


MICROPROCESSORS AND MICROCONTROLLERS LAB RECORD ECE Dept.

BACK: MOV R1,DPL


MOVX A,@DPTR
MOV DPTR,#FFC0
MOVX @DPTR,A
MOV DPL,R1
MOV DPH,#50H
INC DPTR
LCALL DELAY
DJNZ R2,BACK
SJMP AGAIN
DELAY:MOV R3,#0F0
L1: ACALL DELAY1
DJNZ R3,L1
RET
DELAY1:MOV R4,#0FF
L2 : DJNZ R4,L2
RET

MANUAL CALCLATIONS;

RESULT:

ADITYA COLLEGE OF ENGINEERING Page 65

You might also like