RS485 board/The board/04. RE and DE are joined
The board · 04 of 11

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

One pin: talk or listen
listening
The 0 Ω link
Direction pin
Driver
off
Receiver
on: A, B → RO
Your RX sees
the bus
LOW: listening. DE is low, so the driver lets go of the bus, and RE is low, so the receiver passes whatever is on A and B to your RX. This is where the pin should sit whenever you are not sending.

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:

PinDriverReceiverThe board is
LOWoffonlistening
HIGHonofftalking

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

The board sends garbage while my microcontroller is starting up.

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().

My sketch reads back every message it sends.

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.

Nothing arrives, and the direction pin is wired.

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.

Can I control RE and DE separately?

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.

Where this goes next

What the resistor fitted on every board is for.

The 120 Ω resistor

Edit this page — content/books/rs485/re-and-de-are-joined.mdx

Community

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.

Browse Modules and blocks on the forum