espressif / esp-modbus

ESP-Modbus - the officially suppported library for Modbus protocol (serial RS485 + TCP over WiFi or Ethernet).
Apache License 2.0
100 stars 48 forks source link

rede pin on external io expander (IDFGH-7545) #6

Closed Mr-Techtron closed 1 year ago

Mr-Techtron commented 2 years ago

I have a rede pin of rs485 pin connected to an external IO expander. Is there any way to control that rede pin through any callback function?

alisitsyn commented 2 years ago

Hi Mr-Techtron,

I am not sure that I understood your question correctly. Is the pin RE/DE of RS485 adapter connected to the external IO expender? If yes, The UART driver in RS485 mode can support only physical pins configured for UART. I do not recommend this approach of RS485 driver control due to possible delays.

Mr-Techtron commented 2 years ago

Thank you for your explanation.

alisitsyn commented 2 years ago

If you need to provide the RS485 but do not have the free pin for RS485 direction control, you can use auto direction ctrl option approach. This will work just fine for relatively short distances.

Mr-Techtron commented 2 years ago

pseudo pin connection

Our board pin connection for rs485 is something like above. For the time being, I have implemented a simple modbus slave.