1

I am using the ESP8266 NODEMCU. I am aware that the CH341 on the NodeMCU is bridged to the serial pins GPIO3(Rx) and GPIO1(Tx). Hence, any data send on Rx and Tx is also visible on the serial monitor.

I need to interface MAX485 TTL-to-RS485 to the ESP8266 on different serial pins (other than GPIO3 and GPIO1).

Is there a way to configure other pins as Rx and Tx?

Please suggest any other ways to achieve this.

EDIT-1: I need to use two serial ports at the same time (one with the CH341 and another with TTL-to-RS485). Please help with this.

1
  • 2
    You need to use the MAX3485 on 3.3V devices.
    – Majenko
    Commented Apr 30, 2021 at 13:00

2 Answers 2

3

You can't redefine pins on the ESP8266. You can, though, use SoftwareSerial to emulate a serial port. There's plenty of examples.

Also you need to use the MAX3485 on 3.3V devices. The MAX485 is for 5V devices.

1
  • I get the MAX3485 part. However, my main problem is to use two serial ports at the same time (one with the CH341 and another with MAX3485). Need help with this problem. Commented Apr 30, 2021 at 13:18
2

Regarding this:

Please suggest any other ways to achieve this.

The SoftwareSerial mention in Majenko's answer is one of those other ways.

There's also a .swap() function on the Serial interface that will remap the UART from its normal position talking to the host to GPIO15 and GPIO13. If you only need to talk to one device at a time, that may also be an option.

There's also a second transmit-only UART (also mentioned in previous link), so if you only need to transmit on one of the interfaces, that is an option. And there's the possibility of using the transmit-only UART together with using SoftwareSerial (or something like it) to complete the receive half.

Another option might be interpose a SPI-interfaced UART chip, between the ESP8266 and the RS485 transceiver, so that it's just SPI from the ESP8266 side. It is also possible to find chips that are combined SPI-UART/RS485-transceiver, although the only one I've noticed thus far is a 5V part.

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.