3
\$\begingroup\$

Could someone help me understand this circuit? Like what is the purpose of the logic inverter, is it for switching direction automatically? And if so, how is it working? For example on the TX1 line - it goes into IC7A as HIGH, comes out LOW to IC7E where is goes out HIGH again - same on the RX1 line just other direction. Or am I completly misunderstanding this?

enter image description here

\$\endgroup\$
3
  • 7
    \$\begingroup\$ There's 6 logic inverters in that schematic. Which one do you mean? \$\endgroup\$ Commented Apr 30 at 14:44
  • 1
    \$\begingroup\$ electronics.stackexchange.com/questions/244425/… \$\endgroup\$
    – Andy aka
    Commented Apr 30 at 14:48
  • 1
    \$\begingroup\$ @MarcusMüller well all of them basically. But as I wrote in the example, on the TX1 line there is 3 - HIGH to LOW, LOW to HIGH and again HIGH to LOW. Why is that? Why there isn't only one HIGH to LOW? \$\endgroup\$
    – k0cka
    Commented Apr 30 at 15:16

2 Answers 2

5
\$\begingroup\$

The inverters are all just used as buffers/drivers so the function of the circuit does not depend on how weak or strong your MCU or the random RS-485 transceiver happens to be. It really does not matter that it inverts, you simply have to invert twice for non-inverting buffer, but you can also use the intermediate inverted signal for some purpose when useful.

For example, if a buffer drives a LED, you can with certain logic families expect that the LED can be driven as active high or active low, as these ICs can both sink and source enough current for driving loads.

TX idles high so TX LED is off and transmit/receive control is in receive mode.

As soon as something is being trasmitted, TX goes low for start bit and this turns on TX LED and goes into trasmitter enable mode and immediately discharges the capacitor that keeps transmitter on until nothing is transmitted as TX hs been idle long enough and capacitor has charged back to logic high level.

The receiver output is just buffered and made to turn on a LED when RX is low.

The point of the circuit is that you can put almost any 3.3V MCU board with only TX output and RX input pins with no other support for RS-485 specific features such as transmit enable control.

The inverting buffers make sure that the MCU does not need to drive any load like a LED but this module just has one logic level input.

The buffers also make sure the MCU gets a defined logic level out from RS-485 module, as the buffer is always a push-pull output to MCU, but the RS-485 chip output pin is only an output when the chip is in receive mode. Otherwise the output pin floats and level is defined by the pull-up resistor, so it is isolated from the MCU board, which might even have a pull-down resistor and it would not work.

The R-C-D circuit used to detect MCU transmission and extend the pulse to keep RS-485 chip in trasmit mode is also buffered, because logic chips require sharp fast edges to work properly, slowly rising or falling edges are bad for many reasons. It seems that whoever designed the board decided that it is best to use at least the known properties of the buffer that it will work, causing a well-defined sharp signals out to drive the RS-485 chip transmit/receive controls.

The fact that six inverting buffers are used is simply because the most basic and cheapest and most widely available chip that can be used as a buffer in this case is some variant of 7404 which happens to have six inverters.

Sometimes, you simply have to work with whatever logic gates you happen to have left from performing some other function. The same functionality could have been implemented with other logic gates or logic ICs, or a couple of different logic ICs. Also, the six gates of the inverter is a lot and can allow driving LEDs or squaring up the slow RC signal with separate gates even if all you really might have needed are two non-inverting buffers.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you for the reply! I understand it better now :) \$\endgroup\$
    – k0cka
    Commented Apr 30 at 18:07
2
\$\begingroup\$

IC7 B and D cancel each other. They are used only as buffers to boost a signal. You can replace them with a wire.

UART signals are active low and idle high, so IC7 C inverts RX signal for green LED and buffers it as well. Since R39 limits LED current to 1.3mA, it should be possible to connect LED to VCC for the same effect and get rid of IC7 C.

You can do this with orange LED as well, just place it before IC7 A inverter and connect to VCC.

enter image description here

At this point IC7 A and E also cancel each other. You can replace them with wire.

enter image description here

As indicator LEDs are irrelevant for the functioning of the circuit you can now get rid of them and have a simple and easy to understand schematic.

enter image description here

\$\endgroup\$
3
  • \$\begingroup\$ Thank you for your reply, I really appreciate it! And so if I would remove the inverters, wouldn't I have problem with the signal strength on longer distances? I can keep them, I just needed some clarification on how it's all working. \$\endgroup\$
    – k0cka
    Commented Apr 30 at 18:06
  • \$\begingroup\$ The transceivers are usually located right next to MCU on the PCB or in case of standalone UART-to-RS485 adapters they are connected with short wires. The "longer distances" are on the RS485 side of the transceivers, so the inverters have nothing to do with them. If you know electrical specifications of the device on UART side and use fully specified transceiver with good datasheet you can easily check if any buffers are necessary between the two. Usually they are not. \$\endgroup\$
    – Maple
    Commented Apr 30 at 18:34
  • \$\begingroup\$ The only part of schematic that somewhat depends on a buffer is R12-C15. The slew rate of the input to IC7F depends on these, but also on the impedance of the signal source. IOC7 A and E make sure that this impedance is constant regardless of TX1 input. However as I said above, if you know the UART device specs and if they are close to buffer IC specs then you don't need a buffer \$\endgroup\$
    – Maple
    Commented Apr 30 at 18:41

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