|
|
Errors During RS-232 Data ExchangeIf an error occurs in RS-232 signaling it will manifest itself as one of three probable conditions: Framing Errors, Overrun Errors, and Parity Errors. A Framing Error occurs when the receiver expects a stop bit but doesn't get one. Perhaps the stop bits were corrupted in some manner. Alternatively, the receiver may be configured to expect two stop bits, but the transmitter is only sending one. If a framing error is suspected or reported then the first thing to check is the configuration between the transmitter and receiver. An Overrun Error occurs as a result of a handshaking or baud rate misconfiguration when the receiver gets a character from the transmitter while the previous character is still buffered. A character is transmitted in a bit-serial format. The transmitter converts the byte from its eight bit format to the bit-by-bit structure that will be transmitted over the cable. This is performed by a circuit called a parallel-to-serial converter. A chip, called a Universal Asynchronous Receiver and Transmitter, or UART (pronounced "You-Art"), is available to perform the function of converting from serial to parallel and vice-versa. When the UART on the receiver side collects one byte (or, in the case of 7-bit words, when it collects the seven bits) it signals the CPU with the interrupt indicating that its time to get the character out of the UART register. The CPU reads the character out of the UART buffer and the UART is now ready for the next character. If there is a character in the UART buffer on the receiver station and the transmitter doesn't know that it must wait for the receivers UART to be clear, the transmitter may begin sending the next character. This is the Overrun Error. The receiver has gotten the start of a character from the transmitter while the previous character is waiting in the UART buffer to be read by the CPU. By the way, when the CPU reads the contents of the UART register it sends a control signal to the UART which, essentially, marks the contents of the register as "already read," effectively clearing the register. A Parity Error occurs when the configuration for parity that is expected by the receiver is not received. If the receiver is configure to expect Even Parity, then the receiver must get Even Parity or a Parity Error will occur. As you might imagine, a misconfiguration between transmitter and receiver is the most common cause for parity errors. |
|