INTERFACING APPLICATIONS (EB 85 kit)
USING 8255 IC;
Intel 8255 is a programmable peripheral interface. Its main function is
to interface external devices to a micro computer. It has three 8 bit ports-
ports A, Port B and Port C. Port C has been divided further into two 4 bit
ports, port C upper and Port C lower. Each port can be programmed either as
an input port or as an out put port.
MODES OF OPERATIONS
In mode 0, a port can be operated as a simple out put or in put port.
Mode 1 is strobed in put, out put mode of operation. Port A and B are
designed to operate in this mode.
Mode 2 is strobed bi directional mode. Mode 2 operation is possible
only for port A.
CONTROL WORD
For programming the ports of 8255 a control word is formed.
IC Function Addres
No. s
U3 Control 0F
Register 0C
Port A 0D
Port B 0E
Port C
U19 Control 17
Register 14
Port A 15
Port B 16
Port C
Control word is written to the control word register which is within
8255. No read operation of the control register is allowed.
The control word bit corresponding to a particular bit is said either to 1
or 0 depending upon the definition of port, whether it is to be made input or
output port respectively.
EXAMPLE: For generating a square wave, 7th bit = 1, port A is in mode 0
operation. 6th and 5th bit are set 0. Port A is an output port. So 4th bit=0.
Port B and C are also output ports. So bits 0, 1, 3 are set 0. Port B is in
mode 0 operation. So bit 2=0.
1 0 0 0 0 0 0 0
8085 INTERFACING PROGRAMS
1.
1
SQUARE WAVE GENERATION ( USING 8255 )
13
MVI A,80
14
OUT 17
BACK MVI A,FF 26
OUT 14 1 to 8 Port A
CALL DELAY
MVI A,00
9 to 16
OUT 14 Port B
CALL DELAY
17 to
JMP BACK
DELAY LXI D,FFFF 24 Port C
25 Ground
26 Vcc
BEHIND DCX D
MOV A,D
ORA E
JNZ BEHIND
RET 26 PIN IDC
CONNECTOR
2. SEVEN SEGMENT DISPLAY ( USING 8255 )
MVI A,80
OUT 17
START LXI H,4500
MOV B,M
INX H
MOV A,M
OUT 14
CALL DELAY
DCR B
G F Cc A B
JNZ AGAIN
JMP START
DELAY MVI C,09
L3 MVI D,FF
L2 MVI E,FF
L1 DCR E
JNZ L1
DCR D
JNZ L2
DCR C
JNZ L3
RET E D Cc C Dp
PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0
DISPLAY CODE
dp g f e d c b a
0 1 0 1 1 1 1 1 1 BF
1 1 0 0 0 0 1 1 0 86
2 1 1 0 1 1 0 1 1 EB
3 1 1 0 0 1 1 1 1 CF
4 1 1 1 0 0 1 1 0 E6
5 1 1 1 0 1 1 0 1 ED
6 1 1 1 1 1 1 0 1 FD
7 1 0 0 0 0 1 1 1 87
8 1 1 1 1 1 1 1 1 FF
9 1 1 1 0 1 1 1 1 EF
4. STEPPER MOTOR INTERFACE
START LXI H,LOOKUP
MVI B,04
REPT MOV A,M
OUT C0
LXI D,O303
DELAY NOP
DCX D
MOV A,E
ORA D
JNZ DELAY
INX H
DCR B
JNZ REPT
JMP START
LOOK UP TABLE
09
05
06
0A
5. ADC INTERFACING
A. USING SOC SWITCH CONVRSION JUMPER
SETTINGS
B B B
MVI A,10
. .. . . .. . . ..
OUT C8
MVI A,18
OUT C8
A C A C A . C
HLT
J1 J2 J5
B. USING SOFTWARE
MVI A,10
OUT C8
MVI A,18
OUT C8
JUMPER SETTINGS
MVI A,01
OUT D0 B B B
. .. . . .. . . ..
XRA A
XRA A
A C A C A . C
J1 J2 J5
XRA A
MVI A,00
OUT D0
HLT
6. DAC INERFACING
TO CONVERT DIGITAL SIGNAL TO ANALOGUE SIGNAL
A. TRIANGULAR WAVE
START MVI B,FF
MVI A,OO
OUT C0
INR C0
INR A
DCR B
JNZ L1
MVI B,FF
L2 DCR A
OUT C0
DCR B
JNZ L2
JMP START
B. SQUARE WAVE
START MVI A,00
OUT C8
CALL DELAY
MVI A,0FF
OUT C8
CALL DELAY
JMP START
DELAY MVI B,05
L1 MVI C,FF
L2 DCR C
JNZ L2
DCR B
JNZ L1
RET
C. SAW-TOOTH
START MVI A,00
L1 OUT C0
INR A
JNZ L1
JMP START
3. TRAFFIC CONTROLSIGNAL ( USING 8255 )
MVI A,80
OUT 17
START MVI A,5A
OUT 14
CALL DELAY
MVI A,A5
OUT 14
CALL DELAY
JMP START
DELAY LXI D,FFFF
AGAIN DCX D
MOV A,D
ORA E
JNZ AGAIN
RET
R3 R2
G3 G2
R1 G1 R2 G2 R3 G3
R4 G4
0 1 0 1 1 0 1 0
R1 R4 5 A
G1 G4
R3 R2
G3 G2
R1 G1 R2 G2 R3 G3
R4 1G40 1 0 0 1 0 1
R1 R4 A 5
G1 G4