Search code examples
linuxlinux-device-driveruartrs485

RS422 control signals without hardware support


I want to connect a RS422 bus (via a driver IC) to all UART ports of my i.MX8+ processor running Linux. However, some of the UARTs don't support the control signals (RE/DE) in hardware.

I was thinking about driving the control signals from software e.g. with a custom driver but couldn't find nothing similar to this online making me doubt whether this is possible.

  1. Does somebody know whether it is generally possible to use a hardware UART peripheral with software control signals?
  2. Do you know of similar drivers I could use to get started and get an idea how to implement something like that?

Solution

  • You may not have to do anything with these signals in software, depending on your application. If you're link is point to point - rather than a bus - you could simply connect the DE to the +ve power rail probably through a pull up resistor is a good idea (tying it to logic high) and /RE to 0v (tying it to logic low). DE enables the transmitter, and /RE enables the receiver. If all you want is a point-to-point connection, there's no harm these being permanently active.

    I think they're more important in RS485 applictions, where it's used more like a multi-drop bus whereupon it becomes important to be able to put line drivers into a tristate mode (so that someone else can drive the line).

    Your question is a touch confusing because you say RS422 bus. RS422 to many means something akin to differential RS232 serial point to point connections, whereas RS485 implies some sort of electrical bus (for which the enables / disables are needed) running a protocol like ModBus or Profinet on top. If I have been confused, and you are intending something like ModBus or Profinet, then you will need a software connection to DE and /RE.