Programmable Peripheral Interface Devices

Support chips: 8155, 8255, 8279, 8254, DMA Controller, Interrupt Controller, USART

Programmable Interface Devices
 used to interface a I/O device to the

microprocessor
System Bus

8085

Programmable I/O Interface

I/O Devices

8155 – A multipurpose programmable interface  Designed to be compatible with 8085  It includes 256 bytes of Read/Write memory  Three I/O ports     Port A Port B Port C  A 14-bit timer .

Block Diagram .8155 RESET AD0-7 IO/M RD WR ALE CE Timer CLK TIMER OUT Port C 8 Port A 256 X 8 Static RAM A B 8 Port B 8 PA0-7 I/O Devices 8085 PB0-7 Timer C 6 PC0-5 Vcc (+5 V) Vss (0 V) .

Application design with 8155  Objectives Interfacing 8155 with 8085  Programming 8155  .

Interfacing 8085 with 8155 RESET AD0-7 A15 IO/M RD WR ALE 8 CE Port A 256 X 8 Static RAM 8085 A B 8 Port B 8 Port C Timer 8155 C 6 8085 .

Programming 8155  8155 is a Programmable Peripheral Interface  8085 can send data to 8155 using data bus  This data can be For I/O devices connected to 8155  Timer registers of 8155  Instruction/Command word for 8155   Commands for 8155 are stored in a 8-bit Control Register inside 8155 .

 To use handshake mode or not .What type of Commands can be given to 8155?  To configure the I/O ports as Input or Output  To start/stop timer etc.

Control word for 8155  A command/instruction for 8155 is also called control word  This control word is written to control register of 8155  Control word of 8155 is of 8-bits .

Output D3 D2 PORT C 0 0 1 1 0 1 0 1 ALT1 ALT2 ALT3 ALT4 0. Input 1. Enable D7 D6 Timer 0 0 0 1 1 0 1 0 NOP Stop Stop after TC Start .Control Word Definition for 8155 D0 D1 D2 D3 D4 D5 D6 D7 Timer Port C Interrupt Enable Port A Interrupt Enable Port B Port A Port B 0. Disable 1.

I/O functions of Port C ALT D3 D2 PC5 PC4 PC3 PC2 PC1 PC0 0 I 1 O 0 O 1 STBB ALT1 0 ALT2 0 ALT3 1 ALT4 1 I O O BFB I O O I O I O I O INTRA INTRA STBA BFA INTRB STBA BFA I= Input STB = Strobe O = Output BF = Buffer Full INTR = Interrupt Request .

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 O2 O0 E2 O7 E1 A2 A1 A0 3-to-8 Decoder 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 LED Display Analog Input .

Port Addresses of 8155 Chip Selection A7 A6 A5 A4 A3 A2 A1 A0 Port 0 0 0 0 1 1 0 0 1 1 0 0 0 1 0 1 0 1 Control/Status Register Port A Port B Port C LSB Timer MSB Timer 0 0 0 1 0 = 10H = 11H = 12H = 13H = 14H = 15H .

Configure 8155 2. 8085 displays the temperature value on the LED display . 8085 communicates with ADC using PortC in handshake mode 4. 8085 sends SOC command to ADC 3.Application Programming Logic 1. 8085 reads 8-bit temperature value from port A 5.

1. Configure 8155 I/O Ports  Port A as INPUT port  Port B as OUTPUT port  Port C in ALT3 mode ALT D3 D2 0 PC5 O PC4 PC3 O O PC2 PC1 PC0 STBA BFA INTRA ALT3 1 SOC EOC OE .

Control Word for configuration D0 D1 D2 D3 D4 D5 D6 D7 0 1 0 1 0 0 0 0 Timer 1 0 Port C IE Port A IE Port B Port A Port B 0. Input 1. Enable 0 1 0 1 ALT1 ALT2 ALT3 ALT4 D7 D6 Timer 0 0 0 1 1 0 NOP Stop Stop after TC Start . Disable 1. Output D3 D2 PORT C 0 0 1 1 0.

Program Instructions for configuration  Data  Control word : 0AH Address of Control register : 10H  Port Address   Instructions MVI A. 0AH  OUT 10H  .

2. 8085 sends SOC command to ADC  A small duration pulse on SOC input of ADC will start conversion process  SOC input of ADC is connected to port pin PC5 of Port C (Port address 13H)  Data  Data value 20H followed by 00H PC5 O 1 SOC ALT D3 D2 0 PC4 PC3 O 0 O 0 PC2 PC1 PC0 STBA BFA INTRA ALT3 1 0 0 0 .

20H OUT 13H MVI A. 00H OUT 13H . Instructions Start: MVI A.

3. 8085 communicates with ADC using Port C in handshake mode  Port A used to input 8-bit data from ADC  Port C used for handshaking ALT D3 D2 0 PC5 O PC4 PC3 O O PC2 PC1 PC0 STBA BFA INTRA ALT3 1 EOC OE .

 8085 waits for BF signal to be RESET and  starts conversion process again . ADC resets EOC to LOW at end of conversion  8155 sets BF to 1 to enable ADC output latch  8085 is waiting for BF to be SET to 1 and  Reads port A by making RD signal active (0)  At the end of read cycle RD goes HIGH (1)  This resets BF signal to 0.

8085 is waiting for BF  To know the status of BF signal 8085 reads status register of 8155 D7 D6 D5 D4 D3 D2 D1 D0 X Timer INTEB BFB INTRB INTEA BFA INTRA Status Word Definition  Status register shares same address as control register .

Step -4 Reads temperature value OUT 12H .Program Instructions  8085 reads status register    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 –5 display on LED’s .

 8085 reads status register Address of status register : 10H  Starts conversion again if BFA = 0  Again: IN 10H ANI 02H JNZ Again JMP Start .

0AH OUT 10H Start: MVI A.Complete Program 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  Start Conversion again . 20H OUT 13H MVI A.

Sign up to vote on this title
UsefulNot useful