When the receiver line “R” is pulled high on a RS-485 transceiver, a transition from transmitting to receiving can initiate a start condition in UART. When a half-duplex transceiver is switched from transmitting to receiving, the R line can experience a temporary voltage drop. The voltage drop on the R line can cause an unexpected start bit, generating a communication error. This application note explores the cause behind this false start condition and how to remove the false start.
All trademarks are the property of their respective owners.
RS-485 is a long-distance differential interface that can communicate at relatively high speeds with enhanced signal integrity. When designing for a RS-485 transceiver in a system, it can be efficient to minimize the amount of logic lines that connect to each transceiver where possible. A microcontroller can have limited GPIOs to control the RS-485 transceiver. One method to reduce the logic lines is to combine the driver and receiver enable pin as shown in Figure 1-1.
When the driver and receiver enable pins are shorted together, there are particular setups that can cause glitches. If the RC time constant on the bus is long enough, a low voltage can be read on the receiver pin right after the device is switched from transmitting to receiving. This voltage low can be read as a 0 bit. Because the R line is held high, this 0 bit can be interpreted as a start condition by the UART protocol.
This document includes the theoretical analysis behind these undesired behaviors. A half-duplex RS-485 transceiver is tested to demonstrate the majority of RS-485 transceivers. A timer-based fail-safe transceiver is also tested as the glitch can trigger this feature. Specifically, THVD1400 is representative of all general half-duplex devices in testing, and THVD2410 is tested to demonstrate the timer-based fail-safe scenario. Finally, a combination of workarounds are provided, followed with test data showcasing this.
RS-485 is a standardized, physical layer communication method. Standardized by the Telecommunications Industry Association (TIA) and Electronic Industries Alliance (EIA), RS-485 defines the electrical characteristics of a multi-point differential system. This provides designers with improved noise immunity, data rates up to 50Mbps, and the capability to transmit over 1.2 km at 100kbps or less with multiple transceivers on the bus. Figure 2-1 demonstrates a typical setup with a half-duplex RS-485 transceiver.
A microcontroller can send and receive data using a variety of protocols since RS-485 only defines the physical layer. In the transmit mode, the transceiver receives data through the D pin from the MCU. The transceiver can then output dominant and recessive values to the bus via the differential outputs: A and B. A is typically the non-inverting bus line, while B is the inverting bus line. In receiving mode, the transceiver can output a digital signal to the R pin by reading the difference of the A and B bus lines.