Serial Port Framing Errors
When I check the device port status on a Lantronix serial device server I see that I have Framing Errors. What might be causing this?
Framing errors normally occur:
- with baud rate mismatches
- when the serial line is very long or
- when there is a lot of electrical noise on the serial cable
Framing errors can also occur if there is no serial ground connection between the two connected serial devices, or if the connection is intermittent or has a high impedance, e.g. because one or both ends are not well connected. This can cause noise on the serial line, resulting in framing errors.
Background:
Asynchronous serial data received by a UART has an additional start bit and a stop bit. The start and stop bits are periods of silence between each character on an asynchronous serial connection, e.g. RS232, RS422 or RS485.
At a specific serial speed each bit of data takes a single "bit time" to be transmitted. E.g. at 9600 bits per second the bit time is 1/9600 = 0.000104 seconds, or 104 microseconds. This is the bit time.
For instance, if data bits is set to 8, parity is set to none and stop bits is set to 1 (8N1) each character of data is 10 bit times long. The stop and start bits "frame" the data. A framing error occurs when a character of data received by the serial port is too long or too short, i.e. has too many or too few bit times between start and stop bits.
For instance, at 9600, 8N1 each character should be 104 microseconds * 10 bit times = about 1.04 milliseconds in length. (1040 microseconds = 1.04 milliseconds).
[Originally Published On: 07/01/1999 11:35 AM]