Serial Communication basics
In case of serial communication the bits travel one after the other in serial pattern. The advantage of this technique is that in this case the cost is reduced as only 1 or 2 lines maybe required to transfer data. The major disadvantage of Serial communication is that the speed of data transfer maybe reduced as data is transferred in serial pattern.There are two kinds of serial communications i.e. synchronous communication and asynchronous.
Serial Communication using UART
The UART is a device used for asynchronous communications. UART is capable o encapsulating a byte that might be 5,6,7 or 8 bits wide in start and stop bits. Moreover itcan attach an extra parity bit with the data for error detection. The width of stop bits may also vary.
RS-232C is a standard for physical dimension of the connector interconnecting a DTE(Data terminal equipment) and DCE (Data communication equipment).
RS-232C Connectors and Signals
DB25 Pin Connector
DB9 Pin Connector
Flow Control Using RS-232C
Data is received through the RxD line. Data is send through the TxD line. DTR (data terminal ready) indicates that the data terminal is live and kicking. DSR(data set ready) indicates that the data set is live. Whenever the sender can send data it sends the signal RTS( Request to send) if as a result the receiver is free and can receive data it send the sender an acknowledge through CTS( clear to send) indicating that its clear to send now.
Line Control Register
The line control register contains important information about the behaviour of the line through which the data will be transferred. In it various bits signify the word size, length of stop bits, parity check, parity type and also control bit to load the divisor value.
Line Status Register
Line status register illustrates the status of the line. It indicates if the data can be sent or received. If bit 5 and 6 both are set then 2 consecutive bytes can be sent for output. Also this register indicates any error that might occur during communication.
Interrupt enable Register.
If interrupt driven output is to be performed then this register is used to enable interrupt for the UART
Interrupt ID register
Once an interrupt occurs it may be required to identify the case of the interrupt. This register is used to identify the cause of the interrupt.
Modem Control Register
In case software oriented flow control technique is used the bits 0 and 1 need to be set in that case. Bit #3 need to be set to enable interrupts. Moreover if a single computer is available to a developer the UART contains a self test mode which can be used by the programmer to self test the software. In self test mode the output of the UART is routed to its input. So you receive what you send.
Modem Status Register
This register indicates the status of the modem status line or any change in the status of these lines.
This feature is available in the newer version of the UART numbered 16500. A queue or a buffer of the input or output bytes is maintained within the UART in order to facilitate more efficient I/O.