Modbus RTU Framing Error: RS485 Troubleshooting & How to Fix

A Modbus RTU framing error is one of the most common serial communication faults encountered by controls engineers, PLC programmers, and SCADA integrators. Your serial port or USB-to-RS485 converter lights blink, but your master software logs Framing Error (UART FE), packets are dropped, and communication times out. Here is the technical breakdown of what causes framing errors on RS-485 networks and the exact steps to eliminate them.

What is an Asynchronous UART Framing Error?

In asynchronous serial communication like Modbus RTU, devices do not share a common clock line. Instead, the transmitter and receiver synchronize on a per-character basis using framing bits:

  1. Idle State: The serial bus sits in a continuous logical HIGH state (Marking).
  2. Start Bit: The transmitter pulls the line to logical LOW (Spacing) for exactly one bit period to signal the start of a byte.
  3. Data Bits: 8 data bits are transmitted sequentially, least-significant bit (LSB) first.
  4. Optional Parity Bit: Even, Odd, or None to detect single-bit corruption.
  5. Stop Bit(s): The transmitter returns the line to logical HIGH (Marking) for 1 or 2 bit periods to allow the receiver to settle before the next character.

A framing error occurs when the receiver's UART samples the line at the exact time where the Stop Bit is supposed to be HIGH, but detects a logical LOW (0V differential or negative voltage). Because the receiver expects a valid HIGH delimiter, it flags the character as misframed, sets the FE (Framing Error) interrupt, and discards or corrupts the payload byte.

The Top 5 Causes of Modbus RTU Framing Errors

1. Baud Rate Mismatch or Clock Frequency Drift

If the Master transmits at 19,200 bps and the Slave listens at 9,600 bps (or vice-versa), the bit timings will be completely mismatched, resulting in immediate framing errors on byte 1.

However, a subtler issue is UART clock frequency drift. Internal RC oscillators in inexpensive microcontrollers or USB-serial dongles can drift by 3% to 5% across industrial temperature extremes (-20°C to +70°C). By the time the 10th or 11th bit of a character arrives, the receiver's sampling point has drifted past the stop bit into the subsequent start bit or idle gap, triggering intermittent framing errors that only occur at high temperatures or high baud rates (38,400 to 115,200 bps).

2. The Modbus Parity and Stop Bit Dilemma (8-N-1 vs 8-N-2 vs 8-E-1)

The official Modbus over Serial Line Specification (Modbus-IDA v1.02) explicitly mandates:

In practice, many modern sensor manufacturers and software tools ignore the specification and configure devices as 8-N-1 (10 bits total). If your master transmits with 1 stop bit while the slave expects 2 stop bits, the slave will sample the second stop bit during the start bit of the next byte, creating a framing error on every consecutive byte!

3. Reversed RS-485 Signal Polarity (Data+ / Data- Inversion)

RS-485 is a differential signaling standard:

Note: Terminal labeling is notoriously inconsistent across manufacturers. Some vendors label Non-Inverting (+) as 'A' and Inverting (-) as 'B', while the TIA/EIA-485 standard specifies 'B' as non-inverting and 'A' as inverting! If cables are accidentally reversed, the receiver sees continuous Spacing (0) instead of Marking (1), causing immediate, constant framing errors and bus timeouts.

4. Signal Reflections from Missing 120-Ohm Termination Resistors

At baud rates of 19,200 bps and higher, or on RS-485 cable runs longer than 50 meters, sharp square-wave pulse edges reflect back from unterminated cable ends. These electrical reflections collide with incoming data bits, distorting the voltage slope. If a reflected transient dips the voltage below the receiver's threshold during a stop bit, the UART registers a framing error.

Fix: Install a $120\,\Omega$, 1/4-watt termination resistor across the $(+)$ and $(-)$ lines at the two physical ends of the daisy chain only. Never place termination resistors on intermediate slave taps.

5. Floating Ground and Common-Mode Voltage Excursions

Although RS-485 uses differential voltage, standard transceivers can only tolerate common-mode voltage differences between -7V and +12V relative to local earth ground. In industrial facilities with heavy machinery, motor drives, or variable earth potentials, ungrounded 2-wire cables can drift tens of volts above ground. This saturates the receiver's input stage, destroying character framing. Always use 3-wire shielded twisted pair cable (Data+, Data-, and Signal Reference/Ground).

Comparison: Framing Error vs CRC Error

Parameter Framing Error (UART FE) CRC Checksum Error
Detection Layer Hardware UART Physical/Data Link Software Modbus Protocol Application
Trigger Mechanism Stop bit read as 0 instead of 1 Calculated 16-bit CRC does not match packet tail
Primary Cause Baud rate mismatch, parity/stop bit config, wiring noise Flipped data bit from EMI, byte order endianness bug
Visibility in Logs Serial driver interrupt error; packet often discarded before app Full packet received, rejected by Modbus stack

Step-by-Step Diagnostic Troubleshooting Workflow

  1. Audit Communication Settings: Verify that Baud Rate, Data Bits (8), Parity (None/Even/Odd), and Stop Bits (1 or 2) match 100% across both Master and Slave devices.
  2. Check Idle Voltage with a Multimeter: Measure DC voltage across Data+ and Data- while the bus is idle. You should see a steady differential voltage of +200mV to +300mV (Data+ higher than Data-). If the voltage is negative, your wiring polarity is inverted. If it is 0V, you lack fail-safe pull-up/pull-down biasing resistors.
  3. Lower Baud Rate to 9600 bps: If framing errors vanish at 9600 bps but appear at 38400 or 115200 bps, your problem is cable capacitance, lack of 120-ohm termination, or clock oscillator drift.
  4. Verify Daisy-Chain Bus Topology: Ensure your RS-485 bus is a straight daisy chain. Star topologies, long tee stubs (>1 meter), and loop configurations create severe reflections that break character framing.

Isolate Hardware vs Software with ModbusSimulator

When diagnosing elusive serial errors, the biggest challenge is separating hardware electrical faults (wiring, transceivers, ground loops) from software configuration mistakes (baud rate, parity, timing).

By downloading ModbusSimulator, you can create a virtual Modbus Slave or Master on your Windows PC and connect your PLC or SCADA system directly over a virtual null-modem serial port (such as com0com). In this virtual software environment:

Eliminate Modbus Serial Guesswork

Test Modbus RTU and Modbus TCP applications with high-resolution visual register grids, dynamic waveform generation, and zero hardware requirements.

Download ModbusSimulator Free →