Unit II Special Purpose Programmable Peripherals and Their Interfacing
Unit II Special Purpose Programmable Peripherals and Their Interfacing
Programmable peripheral interface (8255) - 8251A USART - 8279 keyboard and display controller 8259
programmable Interrupt controller - 8257 DMA controller - 8254 programmable interval timer
Interfacing A/D Converter - D/A Converters.
Port A
Port B
Port C
Port C is further subdivided into two, 4-bit ports.
Port C upper
Port C lower
Each port can be programmed either as an input port or as an output port,by setting proper bits in
the control word.
This control word is written into a control word register (CWR).
CONTROL GROUPS OF 8255:
The 24 lines of I/O port is divided into 2 groups.
Group A
Group B
Each group contains one 8-bit port & a 4-bit port.
Group A Group B
Port A Port B
Port C upper Port C lower
The control word initialises the ports.
Mode 1 :
This mode is also called strobed I/O mode.
Features of Mode 1:
Two groups i.e. group A and group B are avaliable for strobe data transfer. Each groups
contains one 8-bit data I/O port, one 4-bit control port.
The 8-bit data port can be either used as input or output port.
Both the inputs and outputs are latched. Out of 8-bit port C i.e. PC0 to PC2 are used to
generate control signals for port B and PC3 to PC5 are used to generate control signals
for port A. The line PC6 and PC7 may be used as independent data lines.
Mode 2:
It is known as strobe bidirectional I/O mode.
Here only port A is available. In this mode 8255 acts as a bidirectional 8-bit port with
handshakes signal.
Features of mode 2:
Here only port A is available.
The 8-bit port A is bidirectional and additionally a 5-bit control port C is available.
Input and outputs are both latched.
8251A USART
The 8251 is a programmable chip designed for synchronous and asynchronous serial data
communication
The 8251 is used as a peripheral device and is programmed by the CPU to operate using virtually any
serial data transmission technique
The USART accepts data characters from the CPU in parallel format and then converts them into a
continuous serial data stream for transmission
Simultaneously, it can receive serial data streams and convert them into parallel data character for
the CPU
The USART will signal the CPU whenever it can accept a new character for transmission or whenever it
has received a character for the CPU Description
The block diagram includes five section
Transmitter
Receiver
Modem Control
The control logic interfaces the chip with the processor, determines the functions of the chip according
to the control word in its register, and monitors the data flow
Transmitter
The transmitter section converts a parallel word received from the processor into serial bits and
transmits them over the TxD line to a peripheral
Receiver
receives serial bits from a peripheral, converts them into a parallel word, and transfers the word to the
P
Modem Control The modem control is used to establish data communication through modems over
telephone lines
Data Buffer
Control Register
Status Register
The INTEL 8279 is specially developed for interfacing keyboard and display devices to 8085/8086/8088
microprocessor based system.
Keyboard section:
The keyboard section consists of eight return lines RL0 RL7 that can be used to form the columns of a
keyboard matrix.
It has two additional input : shift and control/strobe. The keys are automatically debounced.
The two operating modes of keyboard section are 2-key lockout and N-key rollover.
In the 2-key lockout mode, if two keys are pressed simultaneously, only the first key is recognized.
In the N-key rollover mode simultaneous keys are recognized and their codes are stored in FIFO.
The keyboard section also have an 8 x 8 FIFO (First In First Out) RAM.
The FIFO can store eight key codes in the scan keyboard mode. The status of the shift key and control
key are also stored along with key code. The 8279 generate an interrupt signal when there is an entry in
FIFO. The format of key code entry in FIFO for scan keyboard mode is,
In sensor matrix mode the condition (i.e., open/close status) of 64 switches is stored in FIFO RAM. If the
condition of any of the switches changes then the 8279 asserts IRQ as high to interrupt the processor.
Display section:
The display section has eight output lines divided into two groups A0-A3 and B0-B3.
The output lines can be used either as a single group of eight lines or as two groups of four lines, in
conjunction with the scan lines for a multiplexed display.
The output lines are connected to the anodes through driver transistor in case of common cathode 7-
segment LEDs. The cathodes are connected to scan lines through driver transistors.
Scan section:
The scan section has a scan counter and four scan lines, SL0 to SL3.
In decoded scan mode, the output of scan lines will be similar to a 2-to-4 decoder.
In encoded scan mode, the output of scan lines will be binary count, and so an external decoder
should be used to convert the binary count to decoded output.
The scan lines are used to form the rows of a matrix keyboard and also connected to digit drivers of a
multiplexed display, to turn ON/OFF.
The CPU interface section takes care of data transfer between 8279 and the processor.
This section has eight bidirectional data lines DB0 to DB7 for data transfer between 8279 and CPU.
It requires two internal address A =0 for selecting data buffer and A = 1 for selecting control register
of8279.
The control signals WR (low), RD (low), CS (low) and A0 are used for read/write to 8279.
It has an interrupt request line IRQ, for interrupt driven data transfer with processor.
The 8279 require an internal clock frequency of 100 kHz. This can be obtained by dividing the input
clock by an internal prescaler.
The RESET signal sets the 8279 in 16-character display with two -key lockout keyboard modes.
8259 programmable Interrupt controller