Final 8255-8254
Final 8255-8254
Introduction
• MPU interface to external devices through both parallel and serial
interfaces.
• Parallel data occur in system that use:
– Displays
– Keyboard
– Printers (old printer)
– Etc.
• Serial data occurs in:
– Some printers
– Data communications
About
• 24 I/O pins
• 8 bit parallel ports: A, B
• C port: can be grouped as 4 bit CU(C upper) and
CL(C Lower)
• Two Modes: BSR(Bit Set/reset) and I/O mode
• BSR mode set/reset in port C
• I/O mode is further divided in 3 modes:
– Mode 0: simple
– Mode 1: Handshake
– Mode 2 : Bidirectional
Pin Diagram
Function of pins:
• Data bus(D0-D7):These are 8-bit bi-directional buses,
connected to 8085 data bus for transferring data.
A1 A0 Select
0 0 PA
0 1 PB
1 0 PC
Control
1 1
reg.
Function of pins:
• RESET: This is used to reset the device. That means clear
control registers.
• PB0-PB7:Similar to PA
Figure 9:
8255 PIA: Example
• Solutions:
– Port Address :
• It is actually an I/O memory map.
• When A15 is active high, Chip Select signal is activated.
• Assuming all don’t care signals are at logic 0, therefore ports’
address are as follows:
8255A Programmable Peripheral Interface
• Solution:
– Control Word:
8255 PIA
• Solution: ???
Mode 1: Input or Output with
Handshake
• In this mode, handshake signals are exchanged
between the MPU and peripherals prior to data
transfer. The features of the mode include the
following:
– Two ports (A and B) function as 8-bit I/O ports. They
can be configured as either as input or output ports.
– Each port uses three lines from Port C as handshake
signals. The remaining two lines of Port C can be used
for simple I/O operations.
– Input and Output data are latched.
– Interrupt logic is supported.
Mode 1 Input
Signal Description
• STB- Strobe input: (active low) : generated by
peripheral to indicate it has transmitted the data.
• IBF( Input buffer full) : Acknowledged by 8255 to
indicate the input buffer has received the data.
• INTR( Interrupt Request) : This is output signal
that is used to INTR the uP. This is high when STB ,
IBF and INTE(internal signal) is high. Means the
8255 is processing the data.
• INTE (Interrupt Enable): internal flip flop
Control Word and Status Word
82C55 : Mode 1 Output Exam.
Signal Discription
Control and Status Word
82C55: Mode 2 Bi-directional Operation
•Timing diagram is a combination of the Mode 1 Strobed Input and Mode 1 Strobed
Output Timing diagrams.
Mode 2 Timing Diagram
Mode 2: Bidirectional Data Transfer
• Solution:
– BSR Control Word:
• Port Address:
• As shown in previous example : 83H
8255A Programmable Peripheral Interface
• Solution:
– Subroutine: Assuming that the delay subroutine has been determined earlier.