Electronic – ny way to use Half Duplex RS485 without using a dedicated controller pin for RE – DE

communicationmicrocontrollerrs485serial

I have attached the reference circuit I am using for a simple MODBUS (Read Coil) communication application. I am short of Pins on my controller and I do not want to use a dedicated controller pin for RE and DE.

RS485 Reference Circuit

In the above circuit,
is there any way MAX-485-CTRL always remains LOW and is pulled HIGH automatically when there is a signal on DI by using some capacitor combination?

Best Answer

I've looked into this before and after a quick search through Google this is what I found the last time I looked:

schematic

simulate this circuit – Schematic created using CircuitLab

Basically when the TX pin is high (idle), the capacitor will slowly charge up until the Schmitt trigger inverter threshold is reached at which point it will switch the MAX485 into receive mode.

When you want to transmit, the start bit (and any subsequent 0 bits) will rapidly discharge the capacitor through the diode switching over the Schmitt trigger inverter causing the MAX485 to go into transmit mode. The during any 1 bits the capacitor will start to charge again, though slowly because of the resistor until it will eventually switch back into receive mode.

You need to select the R-C values such that the capacitor doesn't reach the positive going threshold of the inverter until sufficient time has passed for one byte of data. Each UART byte will always start with a start bit (0) which will keep the MAX485 in transmit mode while you are sending.

To save space you can get Schmitt trigger inverters in single gate packages which are no bigger than a surface mount transistor - the 74LVC1G14 would suffice for the job.