1

I need to communicate with some custom hardware that will use either a FTDI or Silicon Labs usb to serial driver.

I found a couple examples but they are older and was hoping for a more up to date example. Plus, I have been confused by the new AppleUSBFTDI kernel driver in how that works with the IOKit and other chips like the Silicon Labs part. It would be nice to have one program that doesn’t care which driver is used.

I have already looked at this example:

FTDI Communication with USB device - Objective C

Community
  • 1
  • 1
Zathras
  • 13
  • 4

1 Answers1

2

The nature of these drivers and devices is that they are supposed to function as a standard serial port virtually over USB. So in terms of access it should be no different than accessing a standard RS232 COM port.

I would suggest reading the Serial Programming Guide for POSIX Operating Systems. I'm not sure what older examples you're seeing but serial access itself is many years old, but the idea behind communicating to the serial device is the same in the case of these USB to serial bridge devices.

For information on some Objective-C frameworks, take a look at this Stack Overflow post.

Finally, here is an article directly from the Apple documentation, Working With a Serial Device, and you'll see it also references the POSIX style API.

You should simply need to install the driver associated with your device and plug it in for this to work. In terms of the Silicon Labs CP210x device just download and install the OSX driver. Then plug in your device. This is where the one difference may show up, the name of the tty device on the system (it will show up in the /dev directory). In the case of the CP210x it will show up and be accessible as tty.SLAB_USBtoUART or cu.SLAB_USBtoUART. This will be the name of the device you should open, then use and API from above to start your communication.

Community
  • 1
  • 1
Preston
  • 2,543
  • 1
  • 17
  • 26
  • 1
    Thanks very much for the reply. The ORSSerialPort link is just the sort of example I’ve been looking for! – Zathras May 26 '14 at 22:56