RE and DE are joined
RS485 on two wires is half duplex: one board talks at a time. DE switches the chip's driver onto the bus and RE switches its receiver on, and a 0 Ω link on this board joins them. So one GPIO decides everything: HIGH to talk, LOW to listen, never both.
One pair, one talker
Two wires carry one difference, so only one board can drive them at a time. If two drivers push A and B opposite ways at once, neither message survives. So every board spends almost all its time listening, and switches to talking only for as long as it takes to send.
The chip has a switch for each half:
- DE, driver enable. HIGH connects the driver to A and B.
- RE, receiver enable, active low. LOW connects the receiver to the TX pin.
Why they are joined
On this board a 0 Ω resistor, in the box printed RE-DE, joins the two. One pin now drives both, and because one is active high and the other active low, the pin always does exactly one thing:
| Pin | Driver | Receiver | The board is |
|---|---|---|---|
| LOW | off | on | listening |
| HIGH | on | off | talking |
That is what nearly every RS485 example sketch and library expects: one "direction" pin, called DE, DE/RE or TX_EN. Wire it to either hole; they are the same net.
While the board talks, its receiver is off, so its TX line would float. The board's 10 kΩ pull-up holds it high, which a UART reads as nothing arriving. So your sketch does not hear its own messages.
Set it first
Nothing on the board pulls the pin one way or the other. Between reset and the
line in your sketch that sets it, the pin floats and the chip may switch its
driver on. Set it LOW as the first thing setup() does:
const int DIR = 4;
void setup() {
pinMode(DIR, OUTPUT);
digitalWrite(DIR, LOW); // listen until there is something to say
// ...then start the UART
}Taking the link off
Desolder the 0 Ω link and RE and DE become two separate holes. That is worth doing for one job: a self-test. Wire RE to GND and the receiver stays on while you send, so every byte comes straight back, which proves the chip's driver works with nothing else on the bus. For ordinary use, leave it fitted.
When it does not work
Nothing on the board pulls DE either way, so until your sketch sets the pin, it floats, and the driver may switch on and put noise on the bus. Make pinMode(DE, OUTPUT) and digitalWrite(DE, LOW) the first lines of setup(), before Serial.begin().
The receiver is on while you talk. On this board that only happens if the 0 Ω link has been removed and RE wired to GND, or RE wired to a pin that stays LOW. Refit the link, or give RE the same pin as DE.
Check the talking side sets it HIGH before writing and holds it until flush() returns. A pin left LOW means the driver never switches on; a pin dropped straight after write() cuts the byte off.
Yes. Desolder the 0 Ω link in the box printed RE-DE, then wire RE and DE to two pins. It is useful for a self-test that hears its own bytes, or for putting the MAX3485 into its low-power shutdown (DE LOW, RE HIGH). Most sketches never need it.
Edit this page — content/books/rs485/re-and-de-are-joined.mdx
Questions about this product
See what other owners have asked, and read their solutions.
This page covers several products. Choose yours to see the right discussions.
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.