You are on page 1of 6

SEVEN SEGMENT LED DISPLAY INTERFACE

AIM: To write an assembly language program to display the given message using seven segment LED display interface and 8085 microprocessor kit . ALGORITHM:
1. Start. 2. Configure 8255 PPI in mode 0(simple output port) 3. Load HL register pair with starting address of the data. 4. Load D- register with number of groups. 5. Load B-register with number of characters per group (04H). 6. Load C- register with number of segments (08H). 7. Move the content of memory to accumulator and increment the pointer address. 8. Rotate Accumulator content left with carry and move it to E- register and output it to port B in order to get one data bit from 8- bit and output it to activate one segment. 9. Clock pluses are given to activate the shift register. 10. Move the E- register content to accumulator and decrement C- register content (no of segments). 11. Check for zero flag If zero flag is set go to step 12 Else go to step 8. 12.Decrement B-register content (no of characters). 13. Check for zero flag If zero flag is set go to step 14 Else go to step 6. 14. Call delay subroutine for flashing a group. 15.When all the groups are activated the process is repeated continuously until the reset button is pressed.

DELAY:

1. Load E- register with count. 2. Initialize BC- register pair with delay count. 3. Decrement BC- register pair content (delay count). 4. Check for zero flag If zero flag is set go to step 5 Else go to step 3. 5. Decrement E- register content (count). 6. Check for zero flag If zero flag is set go to step 7 Else go to step 2. 7. Return. FLOW CHART: START
Configure 8255 in mode 0 (simple output mode) Set memory pointer Load D- register with no of groups: (A) (M); (D) (A);

Load B- register with no of characters per group: (B) 04H; Load C- register with no of segments: (C) 08H; Get display code & increment the address: (A)(M) ; (H)(L)(H)(L) +1; RLC and give clock to shift register

Decrement segments (C) (C) -1 ; NO If (C)= YES 0

Decrement characters (B) (B) -1 ; If (B)= If 0 (D)= Decrement groups (D) (D) -1

NO YES

NO YES

DELAY SUBROUTINE:
DELAY Initialize E register (E) 02H; Initialize BC register pair (BC) FFFF Decrement BC- register pair content (B)(C)(B)(C)-1; If (BC)=0 0 YES

NO

Decrement E - register content (E) (E) - 1; NO If (E)=0 YES RETURN

PROGRAM:
ADDRESS 8000 8002 8004 8007 800A 800B 800D 800F 8010 8011 8012 8013 8015 8017 8019 801A 801C 801D 801E 8021 8022 8025 8028 8029 OPCODE 3E 80 D3 43 21 01 90 3A 00 90 57 06 04 0E 08 7E 23 07 5F D3 41 3E 01 D3 42 3D D3 42 7B 0D C2 11 80 05 C2 0D 80 CD 2F 80 15 C2 0B 80 LABEL MNEMONICS MVI A, 80 OUT 43 LXI H, 9001 LDA 9000 MOV D,A MVI B,04 MVI C,O8 MOV A,M INX H RLC MOV E,A OUT 41 MVI A,01 OUT 42 DCR A OUT 42 MOV A,E DCR C JNZ L1 DCR B JNZ L2 CALL DELAY DCR D JNZ L3 COMMENTS Send control word to control register to configure 8255 with 8085 in mode0. Initialize memory pointer. Load D- register with number of groups . Load B- register with no of character/ group. Load C- register with no of segments. Move memory content to accumulator and increment the memory pointer. Rotate left with carry to get one data bit and output it to port B. Clock pluses to activate the shift registers.

L4

L3 L2

L1

Move E- register content to accumulator. Decrement C- register content ( segments). Jump on non zero to L1. Decrement B- register content ( characters). Jump on non zero to L2. Call delay subroutine. Decrement D- register content ( groups). Jump on non zero to L3.

802C 802F 8031 8034 8035 8036 8037 803A 803B 803E

C3 04 80 1E 02 01 FF FF 0B 78 B1 C2 34 80 1D C2 31 80 C9

DELAY L5 L6

JMP L4 MVI E , 02 LXI B, FFFF DCX B MOV A,B ORA C JNZ L6 DCR E JNZ L5 RET

Jump to L4. Initialize E- register count. Initialize BC- reg pair with delay count. Decrement the BC register pair content and check whether its value is reached zero. Jump on non zero to L6. Decrement D- register content ( count) and Jump on non zero to L5. Return

SAMPLE INPUT AND OUTPUT:


Number of groups (9000) = 3

a f g e d c dp b

Address 9004 9003 9002 9001 9008 9007 9006 9005 900C 900B 900A 9009

Alphabet d 1 C 0 E 0 P 1 1 E 0 E 0 E 0 1 B 0 A 1 L 0

c 1 1 1 1 1 1 1 1 1 0 0 1

b 1 1 1 0 1 1 1 1 1 0 0 1

a 1 0 0 0 1 0 0 0 1 0 0 1

dp 1 1 1 1 1 1 1 1 1 1 1 1

g 1 1 0 0 1 0 0 0 1 0 0 1

f 1 0 0 0 1 0 0 0 1 0 0 0

e 1 0 0 0 1 0 0 0 1 0 0 0

Code FF 6C 68 C8 FF 68 68 68 FF 08 88 7C

RESULT: The assembly language program to display the given message using 7segment LED display interface and 8085 microprocessor was written and the result was verified.

You might also like