I/O : 8255 Mode 0 experiment, Simple I/O operations

Introduction:

External devices (like switches, LEDs , sensors etc.) can't be connected directly to the processor. The Ports (these are the buffers to hold the data temporarily)  are required for this purpose. The data exchange between the external devices and the processor (accumulator) takes place through the Ports.

8255 is a programmable peripheral interface IC. It has three 8 bit ports called Port A, Port B and Port C. These can be configured in various modes using the Control Register. The addresses to access the ports and control register are as follows.

Port A :  Base address

Port B :  Base address + 1

Port C : Base address + 2

Control Register : Base address + 3

For the control word required to configure the ports in various modes refer to the text book.

For our experiment, the I/O module is connected to uP kit using 26 pin FRC cable.

There are two 8255 ICs on the kit. The base address for upper 8255 is 00 and for lower 8255 is 08.

Problems:

a) Configure Port A in output mode and Port B in input mode. Read Port B and output its data on Port A  continuously.

b) If Port B = FE flash all LEDs on Port A, 5 times.

 If Port B < FE move one LED from LSB to MSB.

If Port B > FE move one LED from MSB to LSB.

Use enough delay to make the movement visible. After each operation read Port B to repeat the whole process.

Pictures:

1.Setup

2.The I/O module