Thursday, April 9, 2020

8255-Programmable Peripheral Interface



Any application of Microprocessor Based system Requires the transfer of data between external circuitry to the Microprocessor and Microprocessor to the External circuitry.

8255 is a programmable I/O device that acts as interface between peripheral devices and the microprocessor for parallel data transfer. 8255 PPI (programmable peripheral interface) is programmed in a way so as to have transfer of data in different conditions according to the need of the system. It is used to interface to the keyboard and a parallel printer port in PCs (usually as part of an integrated chipset).

Here is the description of each block in this diagram:

Three 8-bit IO ports PA, PB, PC.
PC has two 4-bit parts: PC upper (PCU) and PC lower (PCL), each can be set independently for I or O.


 

Data bus buffer

It is used to connect the internal bus of 8255 with the system bus so as to establish proper interfacing between the two. The data bus buffer allows the read/write operation to be performed from/to the CPU.

The buffer allows the passing of data from CPU to ports or control register in case of write operation and from ports or status register to CPU in case of read operation.

Read/ Write control logic:

This unit manages the internal operations of the system. This unit holds the ability to control the transfer of data and control or status words both internally and externally.
Whenever there exists a need for data fetch then it accepts the address provided by the processor through the bus and immediately generates command to the 2 control groups for the particular operation.

Group A and Group B control

These two groups are handled by the CPU and functions according to the command generated by the CPU. The CPU sends control words to the
group A and group B control and they in turn sends the appropriate command to their respective port.

Group A has the access of the port A and higher order bits of port C (i.e port C upper). While group B controls port B with the lower order bits of port C (i.e port C lower).


Pin Diagram of 8255 PPI:



D0-D7(Data Bus) – These are bidirectional, tri-state data bus lines are connected to the system data bus. They are used to transfer data and control word from microprocessor (8085) to 8255 or receive data or status word from 8255 to the 8085.

PA0-PA7(Port A) – These are 8 Bit bidirectional I/O pins used to send data to output device and to receive data from input device. It functions as an 8 Bit data output latch/buffer when used in output mode and as an 8 Bit data input latch/buffer when used in input mode.

PB0-PB7(Port B) – These are 8 Bit bidirectional I/O pins used to send data to output device and to receive data from input device. It functions as an 8 Bit data output latch/buffer when used in output mode and as an 8 Bit data input latch/buffer when used in input mode.

PC0-PC7(Port C) – These are 8 bit bidirectional I/O pins divided into two groups PCL (PC3-PC) and PCU (PC7-PC4).these groups can individually transfer data in or out when programmed for simple I/O, and used as handshake signals when programmed for handshake or bidirectional modes.

CS – It stands for chip select. A low signal at this pin shows the enabling of communication between the 8255 and the processor. More specifically we can say that the data transfer operation gets enabled by an active low signal at this pin.

RD – It is the signal used for read operation. A low signal at this pin shows that CPU is performing read operation at the ports or status word. Or we can say that 8255 is providing data or information to the CPU through data buffer.

WR – It shows write operation. A low signal at this pin allows the CPU to perform write operation over the ports or control register of 8255 using the data bus buffer.

A0 and A These are basically used to select the desired port among all the ports of the 8255 and it do so by forming conjunction with RD and WR. It forms connection with the LSB of the address bus.


CS
A1
A0
Result
0
0
0
PORT A
0
0
1
PORT B
0
1
0
PORT C
0
1
1
Control Register
1
X
X
No Selection





The table below shows the operation of the control signals:
A1
A0
RD
WR
CS
Result
0
0
0
1
0
Input Operation
PORT A → Data Bus
0
1
0
1
0
PORT B → Data Bus
1
0
0
1
0
PORT C → Data Bus
0
0
1
0
0
Output Operation
Data Bus → PORT A
0
1
1
0
0
Data Bus → PORT A
1
0
1
0
0
Data Bus → PORT B
1
1
1
0
0
  Data Bus → Control Register






Reset – It is an active high signal that shows the resetting of the PPI. A high signal at this pin clears the control registers and the ports are set in the input mode. Initializing the ports to input mode is done to prevent circuit breakdown. As in case of reset condition, if the ports are initialized to output mode then there exist chances of destruction of 8255 along with the processor.

Operating Modes:



1.     BSR Mode:
This mode is used to set or reset the bits of port C only, and selected when the most significant bit (D7) in the control register is 0.
Control Register is as follows:


This mode affects only one bit of port C at a time because, as user set the bit, it remains set until and unless user changes it. User needs to load the bit pattern in control register to change the bit.

2.     I/O Mode:
The format of CWR in I/O mode is shown below-


The most significant bit (D7) is 1 for the I/O mode and 0 for the BSR mode.
D6 and D5 are used to select the mode as shown in diagram.

D4 is used to tell whether port A is taking input or displaying the result. If it is 1 then it is taking input otherwise displaying output.



D3 is used to tell whether port C higher bits is taking input or displaying the result. If it is 1 then it is taking input otherwise displaying output.



D2 tells the mode of port B. If it is 0 then port B is in m0 mode otherwise in m1 mode.



D1 is used to tell whether port B is taking input or displaying the result. If it is 1 then it is taking input otherwise displaying output.



D0 is used to tell whether port C lower bits is taking input or displaying the result. If it is 1 then it is taking input otherwise displaying output.

  • Mode 0 (Simple I/O Mode)− Port A, B and C can work either as input function or as output function. The outputs are latched but the inputs are not latched. It has interrupt handling capability.

  • Mode 1 (Handshake or strobed I/O Mode)− In this either port A or B can work and port C bits are used to provide handshaking.For port A in this mode PC3, PC4 and PC5 pins function as handshake lines in input mode and PC3, PC6 and PC7 pins works as handshake lines in output mode For port B in this mode (irrespective of whether is acting as an input port or output port), PC0, PC1 and PC2 pins function as handshake lines. Each port uses three lines of port c as handshake signal and remaining two signals can be function as i/o port. The outputs as well as inputs are latched. It has interrupt handling capability. Before actual data transfer there is transmission of signal to match speed of CPU and printer.   
       Example: When CPU wants to send data to slow peripheral device like               printer, it will send handshaking signal to printer to tell whether it is                   ready or not to transfer the data. When printer will be ready it will                     send   one acknowledgement to CPU then there will be transfer of data               through   data bus.

  • Mode 2(Strobed Bidirectional I/O Mode) − In this mode, Port A can be configured as the bidirectional port and Port B either in Mode 0 or Mode 1. Port A uses five signals from Port C as handshake signals for data transfer. The remaining three signals from Port C can be used either as simple I/O or as handshake for port B.  It has interrupt handling capability. 
        Port A can work in Mode 0, Mode 1, or Mode 2.
        Port B can work in Mode 0, or Mode 1.
        Port C can work in Mode 0 and BSR Mode.

   Features of 8255:

           1. It consists of three 8 bit IO port i.e PA,PB and PC.
           2. Address/data bus must be externally demux'd.
           3. It is TTL compatible.
           4. It has improved driving capability.





Authors:

Neha Sagar
Anamika Rathod 
        

39 comments:

  1. This blog increase my knowledge and also the interest about microprocessor,that how it is work
    Very much things I learn which I don't know before.

    ReplyDelete
  2. This blog really helped me a lot..

    ReplyDelete
  3. Very helpful...

    ReplyDelete
  4. It's very helpful and excellent

    ReplyDelete
  5. A very helpful and useful blog

    ReplyDelete
  6. Wish to see more blog from you

    ReplyDelete
  7. this theory is really nice. and it is easy to learn.. thanks

    ReplyDelete
  8. Interesting stuff to read. Keep it up.

    ReplyDelete
  9. Very helpful and excellent work

    ReplyDelete
  10. Wow! Awesome!This is the type of thing I would have never ever thought about! Great info about Microprocessor and interface I’m trying to take it all in. Keep it up. Thank you for sharing.

    ReplyDelete
  11. Great work.I feel proud that you have written such a beautiful blog. Keep writing such blogs again.

    ReplyDelete
  12. I appreciate your work...really impressive stuff...thanks for this amazing blog.

    ReplyDelete
    Replies
    1. This comment has been removed by a blog administrator.

      Delete
  13. Thanks for increasing my knowledge

    ReplyDelete
  14. Quite informative.Well written..!!

    ReplyDelete
  15. Very informative and nicely written

    ReplyDelete

8255-Programmable Peripheral Interface

Any application of Microprocessor Based system Requires the transfer of data between external circuitry to the Microprocessor and Microp...