0
\$\begingroup\$


I am working on a project where I have 4 MAX3485 (for 4 different RS-485 channels) chips talking on the same UART bus with an ESP-WROOM32 module.
This is the schematic:

schematic

simulate this circuit – Schematic created using CircuitLab


My code sets all DE_X lines to low and all RE_X lines to high before any communication on any of the RS-485 channels. This, according to the datasheet, should set all the MAX3485 chips into low power mode and all RO pins in High-Z. When talking on a RS-485 channel, the code sets DE_X high, sends the message then sets DE_X low and RE_X low, waits for the reply, then sets RE_X high. The code never talks on more than one channel at a time.

I checked all that behavior with an oscilloscope and all the DE_X/RE_X signals toggle as expected.


The problems:

  • RX line is idling low instead of high.
  • When any one of the MAX3485 chips talks on RS-485, the device on the other line gets the message and responds, I can see the response on the RX line but because it is idling low the ESP32 won't pick it up (I do see high toggles when a message is received, like RX is inverted)
  • If i populate only one MAX3485 on the board, it works, RX line is idling high and the ESP32 is picking up what is coming on RX
  • When testing I only have one other device to connect to the RS-485 bus, so all the tests are performed with 3 channels unconnected (but with termination resistor).

    What am I doing wrong?

    Thanks very much for your help!

    Edit: The device I'm working on connects to 4 different RS-485 buses and terminates each one. This is needed because the total number of devices that must be reached is 124 and not all of them play nice, so we don't want to take any chances and chose to link 32 devices / RS-485 channel => 4 channels / device.

    \$\endgroup\$
    1
    \$\begingroup\$

    You must enable only one receiver or their outputs will fight, as only one is receiving the response and others are not. It might be possible to combine the ouputs with AND gates but you have to make sure all the RS485 channels are biased to stay idle at logic high.

    \$\endgroup\$
    -2
    \$\begingroup\$

    OK. First thing is to remove the 120 ohm resistors. These are so called terminating resistors and you need only two of them. They terminate the bus. The bus shall be chained from first device to the last one. You terminate the bus on the first and the last one.

    \$\endgroup\$
    • 1
      \$\begingroup\$ The way I read it is that the OP has 4 separate RS485 busses, and these MAX3485 devices are each on the end of one bus - so the termination resistors seem appropriate to me. \$\endgroup\$ – brhans Feb 12 at 0:01
    • \$\begingroup\$ Hi, @brhans is right, I have 4 separate RS-485 busses. I edited the question with more information on how the device is used. Thanks! \$\endgroup\$ – Flavius Stoichescu Feb 12 at 0:20
    • \$\begingroup\$ @FlaviusStoichescu My bad. I didn't notice. Could be that your pull-ups are weak and they don't bring devices in HiZ mode, or the ROs leaks some current even being in HIZ (RX pull-up) \$\endgroup\$ – Marko Buršič Feb 12 at 13:44

    Your Answer

    By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

    Not the answer you're looking for? Browse other questions tagged or ask your own question.