3
\$\begingroup\$

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?

\$\endgroup\$
4
\$\begingroup\$

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.

|improve this answer|||||
\$\endgroup\$
3
\$\begingroup\$

I've actually used the below circuit and it worked at 9600 baud: -

enter image description here

There are two things to watch out for though: -

  • There is a tendency for the first transmit bit to be tad short
  • You can't expect it to revert back to RX until some time after the last TX bit is sent because of the natural discharging of the 1000 pF capacitor.
|improve this answer|||||
\$\endgroup\$
0
\$\begingroup\$

One could try to use a retriggerable monoflop for CTRL line, that triggers on a LOW TX line and keeps the DE high for about a single bit time. This will work if - and only if - the RS485 bus is pre-loaded for the "1" idle value.

But a microcontroller pin would probably be a lot cheaper, even when you need to use a bigger package for the µC that has more pins available.

|improve this answer|||||
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.