Basics of serial communication
PROCESSO R (PARALLEL )
PARALLEL TO SERIAL
SERIAL TO PARALLEL
DEVICE MODEM (SERIAL)
CLK
TRANSMIT TER
SYNC
SYNC
RECEIVER
DATA
ASYNCHRONOUS TRANSMISSION Start and stop bits
SYNCHRONOUS
• BLOCK OF DATA TRANSMITTED ALONG WITH SYNC INFORMATION • HIGH SPEED TRANSMISSION
ASYNCHRONOUS •CHARACTER CARRIES INFORMATION WITH START AND STOP BITS •WHEN NO DATA IS TRANSMITTED RECEIVER STAYS AT LOGIC 1 CALLED MARK ; LOGIC 0 CALLED SPACE •TRANSMISSION STARTS WITH ONE START BIT AND ONE OR MORE STOP BITS . THIS IS FRAMING
Serial Interfaces: RS-232 •DB25S is a 25 pin connector with full RS-232 functionality •The computer socket has a female outer casing with male connecting pins •The terminating cable connector has a male outer casing with female connecting pins
TTL to RS-232
Types of equipment DTE Data Terminal Equipment Originally applied to CRT terminals or other input devices Today, DTE mainly applies to a computer DCE Data Communication Equipment Originally applied to modems or similar communications equipment Still applies today A modem is a device that converts a digital signal (e.g. from an RS232 interface) to an analogue signal for transmission over a traditional telephone line (MODEM: MOdulator-
VOLTAGE LEVEL +3V TO +15 V LOGIC 0
BUT USUSALLY LOGIC 1 +12V LOGIC 012V ????!!!!!!
VOLTAGE LEVEL -3V TO -15 V LOGIC 1
YEP…. THATS RIGHT….. HERE WE USE NEGATIVE TRUE LOGIC
• TO MAKE RS 232 COMPATIBLE WITH TTL LOGIC , • VOLTAGE TRANSLATORS CALLED LINE DRIVERS & LINE RECEIVERS ARE USED
RS232 pins
SIGNA LS OF RS232
11 bits required to send a single character (10 if one stop bits are used) Bit rate (bits/sec): actual rate at which bits are transmitted Baud rate: rate at which the signalling elements, used to represent bits, are transmitted
DTE 2 MICRO COMPUT3 ER 7
TX
RX 2
RX
DCE
TX 3 GND
MODEM 7
2
DTE
3
7
TX
TX 2
RX
RX 3 GND
7
DTE
Typical System Connections
7
7
SERIAL INTERFACES : 8251A USART The functions and requirement for SERIAL I/O are, Input port & Output port for interfacing DATA TX MPU converts parallel to serial DATA RX MPU converts serial to parallel Synchronization between MPU and slow peripheral
USART – Universal Synchronous /Asynchronous Receiver/ Transmitter
It incorporates all the above features in a single chip and other sophisticated functions for serial communication. It is a programmable device i.e its functions and specifications for serial i/o can be determined by writing instructions to its internal registers
PIN
DESCRIPTION
PIN
DESCRIPTION
D7-D0
DATA BUS
C/D’
CONTROL/DATA
RD’
READ COMMAND
WR’
WRITE COMMAND
CS’
CHIP SELECT
CLK
CLOCK PULSE
RESET
RESET
TxC’
TRANSMITTER CLOCK
TxD
TRANSMITTER DATA
RxC’
RECEIVER CLOCK
RxD
RECEIVER DATA
RxRDY
RECEIVER READY
TxTDY
TRANSMITTER READY
DSR’
DATA SET READY
DTR’
DATA TERMINAL READY
SYNDET/ SYNC DETECT/ BD BREAK DETECT
RTS’
REQUEST TO SEND DATA CTS’
CLEAR TO SEND DATA
TxE
TRANSMITTER EMPTY
+5V SUPPLY
GND
GROUND
Vcc
SIX INPUT SIGNALS
THREE BUFFER REGISTERS • STATUS REG. •CONTROL REG •DATA REG.
RESET – Reset LOGIC 1 forces 8251 to RESET and enters into idle mode CLK - clock REFERS TO SYSTEM CLOCK Necessary for communication with the processor
8251 mode register- MODE WORD
PARITY CONTROL X0 – NO PARITY 01 – ODD PARITY 11 – EVEN PARITY
Command Register
Status Register
MPU INFORMS 8251 – MODE, BAUD, STOP BITS, PARITY CONTROL WORDS TO BE LOADED FROM MPU TO 8251
OPERATION FLOW