Professional Documents
Culture Documents
Unit - 6
Unit - 6
Unit - 6
0 0 0 PORT A 80 H
0 0 1 PORT B 81 H
0 1 0 PORT C 82 H
0 1 1 Control 83 H
Register
1 X X No Seletion X
Operating Modes of 8255A
• Bit Set Reset (BSR) mode:
• If MSB of control word (D7) is 0, PPI works in BSR mode. In this mode only
port C bits are used for set or reset.
• The contents of the control register are called the control word that specifies
the input/ output functions of each port.
Operating Modes of 8255A
• Input / Output Mode
• These are divided into three modes.
• Mode 0
• Mode 1
• Mode 2
Operating
Modes of 8255A
Operating Modes of 8255A
• Mode 0
• In this mode all the three ports (port A, B, C) can work as simple input
function or simple output function. In this mode there is no interrupt
handling capacity.
Operating Modes of 8255A
• Mode 1
• In this mode either port A or port B can work as simple input port or simple
output port, and port C bits are used for handshake signals before actual data
transmission. It has interrupt handling capacity.
• Example: A CPU wants to transfer data to a printer. In this case since speed of
processor is very fast as compared to relatively slow printer, so before actual
data transfer it will send handshake signals to the printer for synchronization
of the speed of the CPU and the peripherals.
Operating Modes of 8255A
• Mode 2
• Bi-directional data bus mode. In this mode only port A works, and port B can
work either in mode 0 or mode 1.
• 6 bits port C are used as handshake signals. It also has interrupt handling
capacity.
Serial Communication
• Serial communication is the process of sending data one bit at a time,
sequentially, over a communication channel or computer bus.
• In Serial Transmission, data-bit flows from one computer to another
computer in bidirectional. In this transmission one bit flows at one
clock pulse.
• In Serial Transmission, 8 bits are transferred at a time having a start
and stop bit.
Serial Communication
Difference Between Serial and Parallel
8251 Programmable Communication Interface
• 8251 is a USART (Universal Synchronous Asynchronous Receiver
Transmitter) for serial data communication.
• It acts as a mediator between microprocessor and peripheral to
transmit serial data into parallel form and vice versa.
• It takes data serially from peripheral (outside devices) and converts
into parallel data. After converting the data into parallel form, it
transmits it to the CPU.
• Similarly, it receives parallel data from microprocessor and converts it
into serial form. After converting data into serial form, it transmits it
to outside device (peripheral).
8251 Programmable Communication Interface
• Blocks of 8251 PCI
• Read / Write Control Logic
• Transmitter
• Receiver
• Data Bus Buffer
• Modem control
Block Diagram of 8251 PCI
Read Write Control Logic – 8251 PCI
• The Read/Write Control logic interfaces the 8251A with CPU,
determines the functions of the 8251A according to the control word
written into its control register.
• It monitors the data flow.
• This section has three registers and they are control register, status
register and data buffer.
• The eight parallel lines, D7-D0, connect to the system data bus so that
data words and control/status words can be transferred to and from
the device.
Read Write Control Logic – 8251 PCI
• The chip select (CS) input is connected to an address decoder so the device
is enabled when addressed.
• The signals RD, WR, CS and C/D are used for read/write operations with
these three registers.
• It has two internal addresses, a control address which is selected when C/D
is high (1), and a data address which is selected when C/D input is low (0).
• When the RESET is high, it forces 8251A into the idle mode.
• The CLK (clock input) is necessary for 8251A for communication with CPU
and this clock does not control either the serial transmission or the
reception rate.
Transmitter – 8251 PCI
• The transmitter section accepts parallel data from CPU and converts them into serial
data.
• The transmitter section is double buffered, i.e., it has a buffer register to hold an 8-bit
parallel data and another register called output register to convert the parallel data
into serial bits.
• When output register is empty, the data is transferred from buffer to output register.
Now the processor can again load another data in buffer register.
• If buffer register is empty, then TxRDY goes high.
• If output register is empty then TxEMPTY goes high.
• The clock signal, TxC controls the rate at which the bits are transmitted by the USART.
• The clock frequency can be 1, 16 or 64 times the baud rate.
Receiver – 8251 PCI
• The receiver section accepts serial data and convert them into parallel
data
• The receiver section is double buffered, i.e., it has an input register to
receive serial data and convert to parallel, and a buffer register to
hold the parallel data.
• When the RxD line goes low, the control logic assumes it as a START
bit, waits for half a bit time and samples the line again.
• If the line is still low, then the input register accepts the following bits,
forms a character and loads it into the buffer register.
Receiver – 8251 PCI
• The CPU reads the parallel data from the buffer register.
• When the input register loads a parallel data to buffer register, the
RxRDY line goes high.
• The clock signal RxC controls the rate at which bits are received by the
USART.
• During asynchronous mode, the signal SYNDET/BRKDET will indicate
the break in the data transmission.
• During synchronous mode, the signal SYNDET/BRKDET will indicate
the reception of synchronous character.
Data Bus Buffer – 8251 PCI
• This block acts as a buffer for the received data. – RXD: An input signal
which receives the data.
Modem Control – 8251 PCI
• The MODEM control unit allows to interface a MODEM to 8251A and
to establish data communication through MODEM over telephone
lines.
• This unit takes care of handshake signals for MODEM interface.
• The following are active-low pins of Modem.
• DSR: Data Set Ready signal is an input signal.
• DTR: Data terminal Ready is an output signal.
• CTS: It is an input signal which controls the data transmit circuit.
• RTS: It is an output signal which is used to set the status RTS.
Modes of Serial Communication
• As we know in Serial Transmission data is sent bit by bit, in such a way that
each bit follows another. It is of two types namely, Synchronous and
Asynchronous Transmission.
• One of the major differences is that in Synchronous Transmission, the sender
and receiver should have synchronized clocks before data transmission.
• Whereas Asynchronous Transmission does not require a clock, but it adds a
parity bit to the data before transmission.
• Asynchronous is simple, economical and used for transmitting a small
amount of data.
• Conversely, Synchronous Transmission is used for transferring the bulk of
data as it is efficient and has less overhead.
Synchronous vs Asynchronous Mode
• In Synchronous Transmission, data is transferred in the form of
frames. On the other hand, in Asynchronous Transmission data is
transmitted 1 byte at a time.
• Synchronous Transmission requires a clock signal between the sender
and receiver so as to inform the receiver about the new byte. In
contrast, in Asynchronous Transmission sender and receiver does not
require a clock signal as the data sent here has a parity bit attached to
it which indicates the start of the new byte.
• Data transfer rate of Asynchronous Transmission is slower than that of
Synchronous Transmission.
Synchronous vs Asynchronous Mode
• Asynchronous Transmission is simple and economical, whereas
Synchronous Transmission is complicated and expensive.
• Synchronous Transmission is efficient and has lower overhead as
compared to the Asynchronous Transmission.
RS - 232
• RS232 is a standard protocol used for serial communication, it is used
for connecting computer and its peripheral devices to allow serial
data exchange between them.
• In simple terms RS232 defines the voltage for the path used for data
exchange between the devices. It specifies common voltage and
signal level, common pin wire configuration and minimum, amount of
control signals.
RS - 232
RS - 232
• DTE :
• A DTE stands for data terminal equipment is an end instrument that convert
user information into signals or reconverts the receive signal. A male
connector is used in DTE and has pin out configuration.
• DCE :
• A DCE stands for data communication equipment's. It sits between the DTE
and data transmission circuit for example modem. A DCE device uses a female
connector which has holes on the surface to hold male connector.
RS – 232 Pinouts
RS – 232 Pinouts
RS – 232 Pinouts
RS – 232 Pinouts
DTE – DCE Working
DTE – DCE Working
DTE – DCE Working
• RS232 works on the two-way communication that exchanges data to one
another. There are two devices connected to each other, (DTE) Data
Transmission Equipment and (DCE) Data Communication Equipment which
has the pins like TXD, RXD, and RTS & CTS.
• Now, from DTE source, the RTS generates the request to send the data. Then
from the other side DCE, the CTS, clears the path for receiving the data.
• After clearing a path, it will give a signal to RTS of the DTE source to send the
signal. Then the bits are transmitted from DTE to DCE.
• Now again from DCE source, the request can be generated by RTS and CTS
of DTE sources clears the path for receiving the data and gives a signal to
send the data.
DTE – DTE Working
• For DTE to DTE a null modem configuration
is used.
• The Rx of one DTE is connected to the TX of
another DTE and vice versa.
• A common ground is connected as a
reference.
• Both the DTE can now work in asynchronous
mode for communication setting the
baudrate, parity and start, stop bit.
Application of RS-232
• RS232 serial communication is used in old generation PCs for
connecting the peripheral devices like mouse, printers, modem etc.
• Nowadays, RS232 is replaced by advanced USB.
• It is also used in PLC machines, CNC machines, and servo controllers
because it is far cheaper.
• It is still used by some microcontroller boards, receipt printers, point
of sale system (PoS), etc.
End of Unit.
• Thank You !!!