Unit 5
Unit 5
Basic interfacing concept, interfacing I/O devices like keyboard, LED display; 8085
interrupt, D/A and A-D converters, 8255A programmable peripheral interface, 8253
programmable interval timer, basic concept of serial I/O, software-controlled
asynchronous serial I/O, SID, SOD, hardware -controlled serial I/O using
Programmable chips.
Interface is the path for communication between two components. Interfacing is of two
types, memory interfacing and I/O interfacing.
Memory Interfacing
When we are executing any instruction, we need the microprocessor to access the memory
for reading instruction codes and the data stored in the memory. For this, both the memory
and the microprocessor requires some signals to read from and write to registers.
The interfacing process includes some key factors to match with the memory requirements
and microprocessor signals. The interfacing circuit therefore should be designed in such a
way that it matches the memory signal requirements with the signals of the microprocessor.
IO Interfacing
There are various communication devices like the keyboard, mouse, printer, etc. So, we
need to interface the keyboard and other devices with the microprocessor by using latches
and buffers. This type of interfacing is known as I/O interfacing.
Vector interrupt − In this type of interrupt, the interrupt address is known to the
processor. For example: RST7.5, RST6.5, RST5.5, TRAP.
Non-Vector interrupt − In this type of interrupt, the interrupt address is not known
to the processor so, the interrupt address needs to be sent externally by the device
to perform interrupts. For example: INTR.
Maskable interrupt − In this type of interrupt, we can disable the interrupt by
writing some instructions into the program. For example: RST7.5, RST6.5, RST5.5.
Non-Maskable interrupt − In this type of interrupt, we cannot disable the interrupt
by writing some instructions into the program. For example: TRAP.
Software interrupt − In this type of interrupt, the programmer has to add the
instructions into the program to execute the interrupt. There are 8 software
interrupts in 8085, i.e. RST0, RST1, RST2, RST3, RST4, RST5, RST6, and RST7.
Hardware interrupt − There are 5 interrupt pins in 8085 used as hardware
interrupts, i.e. TRAP, RST7.5, RST6.5, RST5.5, INTA.
Ports of 8255A
8255A has three ports, i.e., PORT A, PORT B, and PORT C.
Port A contains one 8-bit output latch/buffer and one 8-bit input buffer.
Port B is similar to PORT A.
Port C can be split into two parts, i.e. PORT C lower (PC0-PC3) and PORT C upper
(PC7-PC4) by the control word.
These three ports are further divided into two groups, i.e. Group A includes PORT A and
upper PORT C. Group B includes PORT B and lower PORT C. These two groups can be
programmed in three different modes, i.e. the first mode is named as mode 0, the second
mode is named as Mode 1 and the third mode is named as Mode 2.
Operating Modes
8255A has three different operating modes −
Mode 0 − In this mode, Port A and B is used as two 8-bit ports and Port C as two 4-
bit ports. Each port can be programmed in either input mode or output mode where
outputs are latched and inputs are not latched. Ports do not have interrupt
capability.
Mode 1 − In this mode, Port A and B is used as 8-bit I/O ports. They can be
configured as either input or output ports. Each port uses three lines from port C as
handshake signals. Inputs and outputs are latched.
Mode 2 − 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.
Features of 8255A
The prominent features of 8255A are as follows −
8253 8254
Reads and writes of the same counter Reads and writes of the same
cannot be interleaved. counter can be interleaved.
Features of 8253 / 54
8255 Architecture
The following figure shows the architecture of 8255A −
Basic concept of serial I/O
Serial I/O (Input/Output) refers to the process of sending and receiving data one bit at a
time over a single wire or communication channel. There are two main types of serial
communication: asynchronous and synchronous. Additionally, there are software-controlled
and hardware-controlled approaches. Let's explore these concepts in the context of
microprocessor or microcontroller systems.
Asynchronous Serial I/O:
1. Overview:
Asynchronous serial communication does not rely on a shared clock signal
between the sender and receiver. Instead, it uses start and stop bits to frame
each data byte.
2. Components:
Transmitter:
The transmitter sends a start bit, followed by the data bits (usually 8
bits), an optional parity bit for error checking, and stop bit(s).
Receiver:
The receiver looks for the start bit, samples the data bits, checks for
parity (if used), and waits for the stop bit(s).
Software-Controlled Asynchronous Serial I/O:
1. Software Handling:
In software-controlled serial I/O, the microprocessor's software manages the
timing and control of data transmission and reception without relying on
specialized hardware.
2. Start and Stop Bit Timing:
The software must carefully time the transmission and reception of each bit,
including the start and stop bits.
3. Serial Input Data (SID) and Serial Output Data (SOD):
SID: Serial Input Data is the data line where the microprocessor receives serial
data.
SOD: Serial Output Data is the data line where the microprocessor sends
serial data.
Hardware-Controlled Serial I/O Using Programmable Chips:
1. Overview:
Hardware-controlled serial I/O involves the use of specialized chips or
modules to handle the timing and control aspects of serial communication.
2. 8251 USART (Universal Synchronous/Asynchronous Receiver Transmitter):
The 8251 is a programmable chip commonly used for serial communication in
microprocessor systems.
It can operate in both synchronous and asynchronous modes.
The 8251 handles the generation of start and stop bits, allowing the
microprocessor to focus on other tasks.
3. Control Registers:
The microprocessor communicates with the 8251 through control registers to
set parameters such as data format, baud rate, and enable/disable
transmission or reception.
4. Serial Input Data (SID) and Serial Output Data (SOD):
SID: Serial Input Data is the data line where the microprocessor receives serial
data.
SOD: Serial Output Data is the data line where the microprocessor sends
serial data.
Advantages of Hardware-Controlled Serial I/O:
1. Offloading Processor Burden:
Hardware-controlled serial I/O offloads the microprocessor by handling the
timing and control aspects of communication, allowing the processor to focus
on other tasks.
2. Increased Reliability:
Hardware-controlled communication is often more reliable and less prone to
timing errors compared to software-controlled methods.
3. Higher Speeds:
Dedicated hardware can often achieve higher communication speeds
compared to software-controlled methods.