Escolar Documentos
Profissional Documentos
Cultura Documentos
A15 1
4
1
3
1
2
1
1
1
0
9 8 7 6 5 4 3 2 1 0 ADD
0 0 0 0 0 0 0 0 0 0 8000H
1 1 1 1 1 1 1 1 1 1 87FF
H
PA0-PA7
Port A Pins
CS
Chip select
PB0-PB7
Port B Pins
Vcc , Gnd
+5volt supply
PC0-PC7
Port C Pins
WR
Write input
D0-D7
Data Pins
A0-A1
Address pins
RESET
Reset pin
RD
Read input
8255
DIAGRAM
BLOCK
A0
0
1
0
1
Selected port
Port A
Port B
Port C
Control Register
G
roup A and Group B
Control:
Group A control consists of Port A
and
Port C upper.
Group B control consists of Port A and Port C lower.
Each group is controlled through software.
They receive commands from the RD, WR pins to allow
access to bit pattern of 8085.
The bit pattern consists of :
1. Information about which group is operated.
2. Information about mode of Operation.
PORT A,B:These are bi-directional 8 bit ports each and are
used to interface 8255 with CPU or peripherals.
PC
Stepper
8255Lines
Motor(5V)
STEPPER
MOTOR
COIL-A
PA.0
COIL-B
PA.1
COIL-C
PA.2
COIL-D
PA.3
Program
MVI A,80
OUT 23
START: LXI H,Look Up
MVI B,04
REPET : MOV A,M
OUT 20
LXI H,0202
DELAY: NOP
DCX D
MOV A,E
ORA D
JNZ DELAY
INX H
DCR B
JNZ REPET
JNZ START
LOOK UP TABLE
DATA
9200
DB 03H,06H,0CH,09H (CLOCK WISE)
9204
END
The electric bulbs are controlled by relays. The 8255 pins are
used to control relay on-off action with the help of relay
driver circuits. The driver circuit includes 12 transistors to
drive 12 relays. Fig. also shows the interfacing of 8255 to the
system.
Program
MVI A, 80H : Initialize 8255, port A and port B
OUT 83H (CR) : in output mode
START: MVI A, 09H
OUT 80H (PA) : Send data on PA to glow R1 and R2
MVI A, 24H
OUT 81H (PB) : Send data on PB to glow G3 and G4
MVI C, 28H : Load multiplier count (40) for delay
CALL DELAY : Call delay subroutine
MVI A, 12H
OUT (81H) PA : Send data on Port A to glow Y1 and Y2
OUT (81H) PB : Send data on port B to glow Y3 and Y4
MVI C, 0AH : Load multiplier count (10) for delay
CALL: DELAY : Call delay subroutine
MVI A, 24H
OUT (80H) PA : Send data on port A to glow G1 and G2
MVI A, 09H
Temperature Control
PROGRAM:
MVIA,91H
OUT CR
BEGIN:
CALL CONVERSATION
CPI 41H
JC NEXT
MVI A,0EH
OUT PC
JMP BEGIN
NEXT: MVIA,0FH
OUT PC
JMP BEGIN
CONVERSIONSUBROUTINE:
CONVERSION:
MVI A,00H
OUT PB;Send address to select IN0
MVI A,08H;Latch address by giving ALE High
OUT PB
BACK:
MVI A,18H
OUT PB; Make SOC High
MVIA,08H
OUT PB; Make SOC Low
MVI A,00H
OUT PB;Make ALE Low
LOOP:
IN PC
ANI 01H
JZ LOOP; Wait for EOC
IN PA
RET;Return value and store Accumulator