25
Programmable Peripheral Interface Devices Support chips: 8155, 8255, 8279,8254,8257, 8259,8251

1204 Ppi 8255

  • Upload
    techbed

  • View
    6.460

  • Download
    8

Embed Size (px)

DESCRIPTION

1204 Ppi 8255visit: www.techbed.blogspot.com

Citation preview

Page 1: 1204 Ppi 8255

Programmable Peripheral Interface Devices

Support chips: 8155, 8255, 8279,8254,8257, 8259,8251

Page 2: 1204 Ppi 8255

Programmable Interface Devices

used to interface a I/O device to the microprocessor

8085Programmable

I/O Interface

I/O Devices

System Bus

Can be programmed/configured to perform various I/O functions by writing software instructions

Page 3: 1204 Ppi 8255

8255 – A programmable parallel I/O device

Designed to be compatible with 8085 It consists of

Three I/O ports Port A Port B Port C

Port C can be used as two 4-bit ports PCu (Port C upper 4 bits)

PCl (Port C lower 4 bits)

Page 4: 1204 Ppi 8255

I/O Interfacing using 8255

8085 8255

8-bit ADC

System Bus

LED DISPLAY

Temperature Sensor

Port A

Port Cu

Port B

Port Cl

Page 5: 1204 Ppi 8255

Interfacing with Analog-to-Digital Converter

8085 82558-bit ADC

System Bus

Temperature Sensor

Port A

Port C lines

SOC

EOC

OE

Page 6: 1204 Ppi 8255

Application Programming Logic

1. Configure 8255 I/O ports2. 8085 sends SOC command to ADC3. 8085 waits for EOC signal from ADC4. 8085 sends OE command to ADC5. 8085 reads 8-bit temperature value

from port A6. 8085 displays temperature value on

LED display connected to port B

Page 7: 1204 Ppi 8255

Writing the program

At this point, it will help us to understand, what we need to know more about 8255

Page 8: 1204 Ppi 8255

1. Configure 8255 I/O Ports

8085 8255

8-bit ADC

System Bus

LED DISPLAY

Temperature Sensor

Port A

Port Cu

Port B

Port Cl

Page 9: 1204 Ppi 8255

Port A as INPUT port Port B as OUTPUT port Port C (PCu – O/P , PCl – I/P )

SOC (PC4) is a OUTUT line EOC (PC0) is a INPUT line OE (PC7) is a OUTPUT line

Know more about Modes of operation of 8255 Control word format of 8255

Page 10: 1204 Ppi 8255

Modes of Operation of 8255

Two primary modes of operation1. Parallel I/O mode

Mode 0 (Simple Input/Output) Mode 1 (Input/Output with Handshake) Mode 2 (Bidirectional data transfer)

2. Bit Set/Reset Mode This application uses

Parallel I/O mode - Mode 0 Bit Set/Reset mode

Page 11: 1204 Ppi 8255

Control Word for 8255

8255 has a 8-bit Control word register 8255 ports can be configured for

operation by writing a appropriate control word in it

Page 12: 1204 Ppi 8255

for Parallel I/O

1

0

0

0

1001

91H

Page 13: 1204 Ppi 8255

for Bit Set/Reset Mode

Page 14: 1204 Ppi 8255

Application Programming

1. Configure 8255 I/O portsMVI A, 91HOUT CWR

Writing value 91H in Control Word Register of 8255

CWR represents the 8-bit port address of Control Word Register

Page 15: 1204 Ppi 8255

Application Programming

2. 8085 sends SOC (PC4=1)command to ADC

MVI A, 00001001BOUT CWR

Uses Bit Set/Reset mode of 8255

Page 16: 1204 Ppi 8255

Application Programming

3. 8085 waits for EOC signal from ADCWAIT: IN PORTC

RARJC WAIT

EOC is taken to be active low

Page 17: 1204 Ppi 8255

Application Programming

4. 8085 sends OE command to ADCMVI A, 00001111HOUT PORTC

5. 8085 reads 8-bit temperature value from port A

IN PORTAMOV B, A

Page 18: 1204 Ppi 8255

Application Programming

6. 8085 displays temperature value on LED display connected to port B

OUT PORTB

Page 19: 1204 Ppi 8255

Pin diagram of 8255

D7 – D0 Data Bus

PA7 – PA0 Port A

PB7 – PB0 Port B

PC7 – PC0 Port C

CS Chip Select

A0, A1 Address bits

RD Read Input

WR Write Input

RESET Reset Input

Vcc +5V

GND 0 Volts

Page 20: 1204 Ppi 8255

Interfacing 8255 with 8085

8255 can be interfaced to 8085 using Memory-mapped I/O Peripheral-mapped I/O

As application program uses IN/OUT instructions Peripheral-mapping is used 8-bit addresses are used for ports

and control register of 8255

Page 21: 1204 Ppi 8255

For e.g. OUT CWR IN PORTA OUT PORTB

In actual program, label CWR will be substituted by 8-bit address of Control Word Register of 8255

Page 22: 1204 Ppi 8255

8255 Chip selection & Port Addresses

8255A2

A3

A4

A5

A6

A7

CS

A1

A0

A1

A0

A = 80H

B = 81H

C = 82HA1 A0 Port

0 0 A

0 1 B

1 0 C

1 1 CWR

Page 23: 1204 Ppi 8255

Programming with port addresses

OUT 83H IN 80H OUT 81H

OUT CWR IN PORTA OUT PORTB

Page 24: 1204 Ppi 8255

Block diagram of 8255

Page 25: 1204 Ppi 8255