3
\$\begingroup\$

I'm trying to make a bridge from Modbus til Home Assistant using an ESP8266 (as outlined here), which uses an UART-to-RS485 module.

I have this MAX485 TTL to RS-485 Interface Module.

I'm not competent enough to figure out if it is possible to use the one I have instead of the other one? And if possible, how connections should be.

\$\endgroup\$
3
  • 2
    \$\begingroup\$ I don't understand the wording in the question. In other words, you say you have a TTL UART and you ask if you can use a TTL to RS485 chip with it to build a RS485 UART? \$\endgroup\$
    – Justme
    Commented Nov 4, 2021 at 14:52
  • \$\begingroup\$ UART and RS485 are really not related at all. One is a protocol (for lack of a better word), and the other is an electrical definition. \$\endgroup\$
    – SteveSh
    Commented Nov 4, 2021 at 22:22
  • \$\begingroup\$ I bought the wrong one... Wasn't aware that there were different "RS-485"-modules. (Yes, amateur I am) \$\endgroup\$
    – cbh
    Commented Nov 6, 2021 at 7:50

1 Answer 1

2
\$\begingroup\$

Yes, you should be fine with the MAX485 TTL to RS-485 Interface Module you sited. Notice this module does require some extra handshake signals, namely DE and RE. These are the driver enable (DE) and receiver enable (RE) control signals that your ESP8266 module will need to control. Notice in the datasheet for that module, it says RE is active low, and DE is active high, so just tie them together and control with just one signal from the ESP8266 module.

Some semantics. Saying TTL-to-RS485 makes sense, because you are changing the electrical interface standard, from TTL to RS485. Saying UART-to-RS485 not so much because UART is a protocol and can be implemented with any electrical interface standard (our your custom interface), not just the RS485 standard.

Here is some helpful information. Some RS485 modules, such as this one does not have the DE and RE control signals, rather it auto-generates them using activity from the TX input. This is important because RS485 is differential signal for both TX and RX, so it must share the two wires. Unlike RS232 that uses single-ended wires for each TX and RX.

Your software should emulate the auto-generated DE/RE control signal. Easiest method is to monitor the UART transmit buffer, and if not empty then it outputs an active high signal to your RS485 module (assuming you tied the DE and RE together).

\$\endgroup\$
1
  • \$\begingroup\$ Thank you for the explanation! Guess this is somewhat over my level - and will propably end up buying the right module... \$\endgroup\$
    – cbh
    Commented Nov 6, 2021 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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