130 likes | 350 Views
Multiplexed Display. 7 segment display Two ports required Data segment drive Digit drive. Control word is for initializing the PPI to our required mode Mode 1, port A and port C output port Control word address the chip select address 80H here. g f e d c b a. 0 1 1 1 0 1 1 1. 77H = A.
E N D
Multiplexed Display • 7 segment display • Two ports required • Data segment drive • Digit drive
Control word is for initializing the PPI to our required mode • Mode 1, port A and port C output port • Control word address the chip select address 80H here. g f e d c b a 0 1 1 1 0 1 1 1 77H = A 79H = E 73H = P
PORTA EQU 80H ; port A address, segment drive PORTC EQU 82H ;port C address, digit drive CNTRL EQU 83 ;address of control register MVI A, 10000000B ; loading Acc with control word; ; mode 0, A and C as o/p OUT CNTRL ; Initializes 8255A as require READY: MVI B, 00000001B ; Initializes digit code MVI C, 04H ; Initializes counter for 4 LEDs LXI H, SYSRDY ; Uses HL as memory pointer for message NEXT: MOV A, M ; Get segment code OUT PORTA ; Output segment code MOV A, B ;Get digit code OUT PORTC ; Turn on the digit LEDs CALL DELAY1 ; wait 1 millisecond XRA A ; clear Accumulator OUT PORTA ;turn off LEDs of the digit MOV A,B ; RLC ;shift digit code to turn on next digit MOV B,A ;save the digit code INX HL ;point to next code DCR C ; JNZ NEXT ; RET SYSRDY: DB 79H,79H,73H,77H ;message code – APEE, right E sent first