C: https://github.com/Redisage/PAC-ESP32/tree/master/C_examples/RS485

MicroPython: https://github.com/Redisage/PAC-ESP32/tree/master/uPython_examples/RS485

In this example:

  • transceiver 1 (A1 and B1 pins) is configured as a receiver

  • transceiver 2 (A2 and B2 pins) is configured as a transmitter

It is necessary to connect ports as in the picture.

In this way there is a possibility to do a test and adapt to working with external devices. On the developer side there is an option to configure serial port parameters.

Default settings:

  • Baudrate: 115200

  • Data bits: 8

  • Parity bits: 0

  • Stop bits: 1

  • Receiver timeout: 3s

Voltage levels in RS485 standard are equal to MCU logic levels 0 - 3,3V

After flashing, open serial port monitor and find out if the demo works properly.