Search code examples
ftdi

FTDI Get modem status values (DSR, DCD, CTS)


I'm working on a project where I'd like to be able to send a simple on/off signal back to the PC via one of the modem pins (DSR, DCD, CTS), separate from the standard serial communications.

I'm having trouble accessing these when connecting to the device with the standard VPC serial driver.

Sample Python using pySerial:

import serial

def main(argv):
  watchPort(sys.argv[1])

def watchPort(portName):
    ser = serial.Serial(portName)

    while True:
        print("DCD {0}, DSR {1}, CTS {2}".format(ser.cd, ser.dsr, ser.cts))
        time.sleep(0.5)

if __name__ == "__main__":
     main()

These values are always the same, no matter if the pins are connected HIGH or LOW. I've also tested with a couple terminal programs to verify (CoolTerm, SerialTerm).

I am, however, able to get these values via the D2XX drivers and related APIs, but I'd rather use the simpler serial device method, if possible. Is this not possible?

Why?

I'm setting up a multi-drop RS485 network and planning to use one of these lines as a common signal line that can be used to signal "ready", "error" and to prevent communication collisions.


Solution

  • It turns out that the problem was with the stock FTDI driver that comes with OS X. (see post) Updating to the latest VPC driver fixed it.