8155 Programmable Interface
8155 Programmable Interface
Support chips: 8155, 8255, 8279, 8254, DMA Controller, Interrupt Controller, USART
microprocessor
System Bus
8085
I/O Devices
It includes
A 14-bit timer
Port A
8 Port B
PA0-7
I/O Devices
8085
RD
WR ALE CE Timer CLK TIMER OUT
8 Port C
PB0-7
Timer
PC0-5
8 Port B
Timer
8155
8085
Programming 8155
8155 is a Programmable Peripheral Interface
For I/O devices connected to 8155 Timer registers of 8155 Instruction/Command word for 8155
control word This control word is written to control register of 8155 Control word of 8155 is of 8-bits
1, Output
0
0 1 1
0
1 0 1
ALT1
ALT2 ALT3 ALT4
0, Disable 1, Enable
I O O
BFB
I O O
I O
I O
I O
INTRA INTRA
STBA BFA
Design an interfacing circuit to read data from an A/D converter using the 8155A in the peripheral mapped I/O.
AD0-AD7
8085 IO/M ALE RD WR RESET CE A15 A14 A13 A12 A11 8155 P
o r t A P o r t B P o r t C
Digital Input
A/D Converter
PC5
BFA STBA
SOC OE EOC
O2 O 0 E2 O7 E1 A2 A1 A0 3-to-8 Decoder
LED Display
Analog Input
A7 A6 A5 A4 A3
0 0 0 1 0
1
1
0
0
0
1
LSB Timer
MSB Timer
PortC in handshake mode 4. 8085 reads 8-bit temperature value from port A 5. 8085 displays the temperature value on the LED display
Port B as OUTPUT
ALT D3 D2 ALT3 1 0
PC5 O
PC4 PC3 O O
SOC
EOC
OE
D3 D2 PORT C
0 0 1 1 0 1 0 1 ALT1 ALT2 ALT3 ALT4
1, Output
IE Port A IE Port B
0, Disable 1, Enable
D7 D6 Timer
0 0 0 1 1 0 NOP Stop Stop after TC Start
Port Address
Instructions
will start conversion process SOC input of ADC is connected to port pin PC5 of Port C (Port address 13H) Data
ALT
D3 D2 0
PC4 PC3 O 0 O 0
ALT3 1
Instructions
Start: MVI A, 20H OUT 13H MVI A, 00H OUT 13H
EOC
OE
conversion 8155 sets BF to 1 to enable ADC output latch 8085 is waiting for BF to be SET to 1 and
At the end of read cycle RD goes HIGH (1) This resets BF signal to 0.
control register
Program Instructions
Address of status register : 10H Reads port A if BFA = 1 Output temperature on port B
Status: IN 10H ANI 02H JZ Status IN 11H ;Step -4 Reads temperature value OUT 12H ; Step 5 display on LEDs
Complete Program
MVI A, 0AH OUT 10H Start: MVI A, 20H
OUT 13H MVI A, 00H OUT 13H
Configure 8155 Start Conversion
Status: IN 10H ANI 02H JZ Status IN 11H OUT 12H Again: IN 10H ANI 02H JNZ Again JMP Start
Read Status register Wait till BFA = 1 Read temperature value Display on LED Read status register
Wait till BFA = 0