RS422 on Mac/Raspberry pi with Xojo

I’m building a controller for an audio router that has a serial remote and published protocol.

I have my app basically complete at this point and need to get to the stage where I’m communicating with the router, to send it the configurations my app generates. This unit is about 20 years old, and was originally controlled by a Mac OS 9 app or an external hardware remote. I have one of the hardware remotes. The company that made it is no longer around it seems (web site is still up but hasn’t been updated since 2004, nobody responds to queries though).

So the issue I’m having right now is that I can’t seem to connect to the device (I know the device works, as the hardware remote control I have works with it). Here’s my setup:

Mac Studio M2 Max
USB-C->USB A hub
Dtech KJ5119 FTDI-based USB to Serial adapter connected to that hub

The Mac System Information window, my Xojo app, and an app I downloaded called “SerialTools” all see this adapter with no drivers installed. The printed instructions that came with it only reference Windows installation, and it came with a mini CD containing drivers. I haven’t had a machine with a DVD/CD reader in years so no way to load that. Their web site does have a driver download, but the Mac folder only contains drivers for old Macs, and only for PowerPC or Intel, not Silicon. But the fact that the system sees it suggests it may not need drivers?

In SerialTools’ terminal, I send it the command ‘80h’ which is used to see if the router is alive. It should respond with ‘FFh’ but I get nothing back. When I send the command, the “Tx” light on the adapter flashes. The Rx light does not. The manual says there should be a reply within 1ms from the router to this command.

My questions:

  1. Do I need drivers for this USB adapter, or should I expect that it’ll “just work” on my mac if the OS is recognizing it?
  2. If I can’t get drivers for my mac, can someone recommend a USB to Serial adapter that is known to work for RS422 communication, on a mac, with Xojo? (I may also move this over raspberry Pi once it’s finished, so I can rackmount it with a touch screen so compatibility there would be good as well)

The Pinout on the USB adapter is printed on the back and is different from the pinout outlined in the Router’s manual. I have built a cable that matches the pinouts on both ends

From their serial protocol document:

The only pins used are RXD+, RXD-, TXD+, TXD-, and GND; no ACK signals are used.

It’s only two pages, very straightforward.

At this stage, I need to eliminate some variables from this equation and start with an adapter that is known to work properly, because right now I can’t seem to connect to the device even via a simple terminal. Any suggestions?

you may try the drivers corresponding to your ftdi chip model from their web downloads

Thanks. nothing on the box or in the docs specifies the exact chipset though, just “FTDI Chipset”.

That said, digging around it seems that Apple has built in FTDI drivers, available since Mavericks. It seems (at least from what I can see) that the adapter is working, at least for transmitting. I can also get the Tx light to show when I send a 40h or 80h command to the router, when using the terminal ‘screen’ command.

using a tool like usb prober you can check the vendor/product id of the chip
to detect which chip it is about.
then with recent security enforcements on macos, I would still install a driver for that
as it seems you have a rs422 chip, it is not the simple rs232 to usb standard chip you may be using.

Hmm. I think it’s possible I miswired this. Looking at the instructions, it has the adapter’s transmit pin going to the Receive pins on the other end. I wired transmit to transmit and receive to receive. So that may be my issue.

Sony’s RS422, which I work with a lot for tape deck control (at least in terms of making cables) is straight pass-through from one end to the other, which is why we’re able to make cables using basic DB-9 to RJ45 adapters, and ethernet cabling.

I’ll rewire this and report back.

I wired it according to the diagram in the manual, using example 1 (Full Duplex RS422):

I also installed the VCP drivers from FTDI’s site, even though they only list Mac OS 12 as the latest one they support, and as a beta only, and I’m on 14 (Sonoma). The drivers installed, and I now see the adapter under a different addressusbserial-2, where before it had the S/N of the unit in the name). I can connect to that, but I’m getting the same result: Tx light indicates it’s sending the signal, Rx light never lights.

I’m sending the following series of commands:

A5h  //About to send commands
00h  //I want to address Router #1 (The only one connected at the moment)
40h  //Asking if it's alive
(no response)
5Ah  //Done sending commands

I’ve done this with both Screen and SerialTools, but I get no response

At this point I’m hoping there might be a known good adapter that I can trust will work. I can putter around with this a bit more, but I feel like I’ve covered all the obvious things at this point.

I had once a problem figuring the communication protocol with a bl0942 power meter chip.
the solution was to hook up an oscilloscope (with uart decoding capabilities) on the wires
once you see what’s going in the wires it’s always easier.

I don’t have a scope with those capabilities (At least I don’t think mine does), nor would I really know what to look for if I did.

ChatGPT (I know, I know) after quite a bit of back and forth troubleshooting, seems thoroughly convinced the adapters I have aren’t really RS422 compliant. It suggests I try a “FTDI-based USB-RS422-WE-1800-BT” adapter (looks like a USB cable with bare wires at one end and the chip integrated into the USB plug, or an older Keyspan RS422 adapter. I will look to see if I have any of the latter but I don’t think I do.

In the mean time I’ll probably order one of the USB-RS422-WE-1800-BT models on amazon for Monday delivery just in case.

Current macOS version usually come with some support for FTDI adapters, but you can always install the latest VCP driver from this website: VCP Drivers - FTDI

An easy way to test the adapter and driver is to wire up a loop back on the serial port end.

  • For RS232, connect RX and TX together.
  • For RS232, connect RX+ to TX+, and RX- to TX-

This way, everything that is sent is immediately received.

Yeah except I’m using RS422, not 232.

The driver built into the mac, and the VCP driver from FTDI ended up with the same result - nothing received.

Make sure the following:

  • baud rade is correct
  • Bits
  • Parity
  • Stop bits

CTS and/or DTR may need to be set.

wiring:

TX to RX

RX to TX

GND must be common to both ends.