Lecture 14 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU
7-segment LED Display 00H – 03H are the I/O ports Port A Port B Port C Command Register MEM 1.For 8 (eight) times 1.Send data through port A 2.Select a segment through port B OUT PORT, DATA OUT DX, AL
7-segment LED Display 00H – 03H are the I/O ports Port A Port B Port C Command Register MEM MOV BX, 8 ; count MOV AH, 7FH ; selection MOV SI, OFFSET MEM-1 MOV DX, 01H ; port B DISP1: MOV AL, AH OUT DX, AL DEC DX MOV AL, [BX+SI] OUT DX, AL CALL DELAY ROR AH, 1 INC DX DEC BX JNZ DISP SI 1.For 8 (eight) times 1.Send data through port A 2.Select a segment through port B
7-segment LED Display MOV BX, 8 ; count MOV AH, 7FH ; selection MOV SI, OFFSET MEM-1 MOV DX, 01H ; port B ROR AH, 1 INC DX DEC BX JNZ DISP1 DISP1: MOV AL, AH OUT DX, AL DEC DX MOV AL, [BX+SI] OUT DX, AL CALL DELAY DISP PROC NEAR PUSHF PUSH AX PUSH BX PUSH DX PUSH SI POP SI POP DX POP BX POP AX POPF RET DISP ENDP
Stepper Motor Interfaced to the 82C = 3H 0110 = 6H 1100 = CH 1001 = 9H
Stepper Motor Interfaced to the 82C55 If CX > 8000H then spin right hand direction else spin left hand direction Steeper Motor
If CX > 8000H then spin right hand direction else spin left hand direction 33H / 66H / CCH / 99H = 33H = 66H = CCH = 99H
References Chapter 10.3 The Intel Microprocessors – by Barry B. Brey