MAX485 reference design

I've been reading up on RS485 and MAX485. I have bought a few USB/RS485 and UART/RS485 modules based on MAX485. I want to use MAX485 in my design. From what I can find online, most designs have one pullup resistor on A (seen 1K, 4.7K, 10K, 20K, etc.) and an identical pulldown resistor on B. There is also a load resistor of 120 ohm between A and B. So I took my multimeter and tested one module I have. That module has 4.7K resistors but both A and B are pulled down not one up and one down.

So I wonder why these pullup/down resistors. Is it to set the lines to a valid data at start-up and when no transceivers are asserting the lines so both lines are at the same voltage level? Maybe my transceiver module is designed wrong. Also how do you determine the resistor value? Higher speed with less resistance? Any typical recommendation for say 9600 baud?

Thanks.

The usual reason is to limit the echo from the pulses on the data line.

Thanks Paul. I did some reading on a reference doc. The two resistors were said to ensure the voltage on the lines are well defined in case of half-duplex and no driver is controlling the bus. Probably also helps with signal reflection at the same time. So 120 ohm on both ends of the cable and only one end needs pullup and pulldown.

Through some reading and probing, I realized how crappy MODBUS protocol is. For instance, int16_t and float32_t are sent with big-endian while CRC16_MODBUS seems to be sent with little-endian. Is that right?

Nick Gamonm appears to have researched this topic in depth: https://www.gammon.com.au/forum/?id=11428

If both lines are pulled low, that board has a design or assembly error. It should be set up so the normal state of a receiver will be to deliver a high level on its output when no unit is driving the line.

Generally there's no need to put these resistors on every board, assuming you have more than two boards. 4.7K is a larger resistor than I use; mine are 2.2K, just to be sure that A is higher than B. Maybe put them on the first and last boards on the network, along with the 120 ohm terminators.

Modbus is the most often mentioned protocol for RS485, but I don't think it offers much. I made up my own standard, but I won't go into the details.

As for baud rate, you can use anything the Arduino is capable of, and still not get into transmission-line difficulties unless you've got hundreds of meters of cable.

One thing to note is that you can't fully use the USB port unless your RS485 link is wired from a software serial port. That's because when the MAX485 is receiving from the external bus, it takes priority over the USB port. If you want to receive anything from the computer, you have to be able to control the RE line on the MAX485, and if you do that, you might miss something coming in over RS485. So that could be a problem.

Thanks. I thought so too, design error. It's one of those no-brand amazon toss-in-the-trash-if-you-don't-like-it modules. I'll have to fix it if I want to use it for some RS485 sensors I have. So basically when nobody is talking, the A line should be higher than the B line enough to be recognized as a logical 0, correct?

What I will do with RS485 is to wire it to 328's RX and TX directly on my own board design in case a high baud rate such as 115200 is needed for RS485. I won't use a USB chip on this board. Programming is done via the ICSP header.

Thanks. I just read through Nick Gammon's posts. Must of that was dedicated to a specific protocol he wrote with some introduction.

These items may be familiar to you, but maybe not.
AN1057Ten Ways to Bulletproof
RS-485 Interfaces

Design guide
Topology
AN960 - Circuit Implementation Guide
Another one!
See page 17 of the last one for biasing.
C

Thanks. I'll go through them.

FYI, here is one reference I read, slla272d.pdf from TI. Screenshot:

So according to this document the pullup and pulldown are there to ensure the logic state when no driver is driving the lines. Somehow the ohm symbol was rendered into a W in the doc. Anyway, if you use larger resistors than 523 ohms, then the V_A-V_B will be less than 200mV, which is what receivers consider enough differential voltage for a zero (?). So why using higher resistance like 2.2K?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.