I investigated this further with different line driver circuits.
Circuit A)
Code: Select all
+---------------+
RX <-------| R |
| B|----
TX ------->| D MAX485 |
ESP32 | | RS-485 side
RTS ------>| DE |
| A|----
+----| /RE |
| +---------------+
GND
- rs485_conf.en = 1
- rs485_conf.tx_rx_en must be set to 0 to remove echo. (This makes sense and would be expected.)
- If rs485_conf.rx_busy_tx_en is set to 1 then we receive a single null character per packet sent
- If rs485_conf.rx_busy_tx_en is set to 0 then we receive a null character for every character sent
Very strange behavior. I did not manage to get rid of the 00 characters. I also confirmed that the 00 characters are not generated by wrong timing of the DE signal. They are always generated when sending with above flags set, regardless of the state of driver enable.
Circuit B)
Code: Select all
+---------------+
RX <-------| R |
| B|----
TX ------->| D MAX485 |
ESP32 | | RS-485 side
RTS --+--->| DE |
| | A|----
+----| /RE |
+---------------+
- rs485_conf.en = 1
- rs485_conf.tx_rx_en must be set to 1 to not receive any echo (if 0 we would receive a single null char per packet sent otherwise)
- rs485_conf.rx_busy_tx_en can be either value. (Makes sense and is to be expected)
I have no idea how to configure this RS-485 mode of the ESP32 to not generate these phantom 00 characters.
Clearing the FIFO as suggested by aaquilina is a workaround, but does not seem right and should not be necessary.