DFRobot I/O Expansion Shield - RS485 Details Here

There's not much info in the DFRobot Shield Manual about the RS485 terminals, so I've traced the PCB etc.

It uses an SP485CN chip to handle comms.

The screw terminals (assuming that the three jumpers are set to '485') marked 'A' and 'B' go directly to the IC 'A' and 'B' pins (6 & 7 respectively).

The screw terminal marked VCC goes to the IC VCC pin (8), and also to the board's +5V line (i.e. the Arduino's +5V rail).

The screw terminal marked GND goes to the IC GND pin (5), and also to the board's GND line (i.e. the Arduino's 0V rail).

The chip's DI (Data Input?) pin (4) is connected to the Arduino's Digital Pin 1 (TX).

The chip's RO (Data Output?) pin (1) is connected to the Arduino's Digital Pin 0 (RX), with a resistor pull-up to the +5V rail.

The chip's DE (output enable) pin (3) is connected (via a resistor) to the Arduino's Digital Pin 3 - this is active high.

This DE pin is also connected to the chip's RE bar (receiver enable) pin (2) and therefore controlled by the Arduino's Digital pin 3 too - this is active low.

So, to transmit data from Arduino Digital Pin 1 you need to take Digital pin 3 high, and to receive data to Arduino Digital Pin 0 you need to take Arduino Digital pin 3 low.

I hope this helps someone - please let me know if I've made a mistake.

I'm really sorry; I got confused and forgot the first pin is '0' not '1'.

Correct pin-out is:

Arduino Digital Pin 0 = RS485 Chip Data Output (Rx) with pull-up to 5V
Arduino Digital Pin 1 = RS485 Chip Data Input (Tx)
Arduino Digital Pin 2 = Rx/Tx 'Enable'; High to Transmit, Low to Receive

Please ignore the 'Pin 3' references in my first post. :-[

Thanks!

No worries :slight_smile:

For those who are interested, there's a link to the SP485CN datasheet here:

The pull-up resistor from the 5V rail to the Arduino's Digital Pin 0 (Rx) is 4k7.

The resistor between the Arduino's Digital Pin 2 (O/P Enable and I/P Disable) is 1k.

Here is the sample code:

If someone's going to rip my post word for word you'd think they'd get it right and include the correction ffs... >:(