Modbus RTU With ESP32-P4 : 4 Steps (with Pictures)

The RS485 HAT can be jumpered to various UARTs on the Raspberry Pi. The ESP32-P4 also has 5 UARTS that can be routed to various GPIOs as desired.

On the ESP32-P4 board from Waveshare, the UART0 of the ESP32-P4 is connected to pins 8 and 10 of the expansion header (on the Raspberry Pi GPIO14 and 15 – UART0). At the same time, however, these pins are also connected to the UART-USB bridge for programming and debugging on the board, so that these pins cannot be used. Instead, we can use the alternative pins for the other UARTs of the Raspberry Pi.

We can now set two jumpers at U3, U4, or U5 (the corresponding line for pin routing must then be enabled in the software—see below).

We do not need the additional jumpers for the automatic transmit/receive switch RE0/3.

Read more here: Source link