Upon plugging in a USB CDC ACM virtual COM port device into a Mac OS X based machine, the OS should automatically enumerate the USB device successfully, and a new object should show up as:
/dev/tty.usbmodemXXXX
(where XXXX is some value, such as “3d11”)
To run the example demo project: “USB\Device - CDC - Basic Demo” on a Mac OS X based machine, a procedure like follows can be used:
Open TERMINAL. This can be done by clicking SPOTLIGHT and searching for TERMINAL. Spotlight is the little magnifying glass in the upper right of the screen.
In Terminal, with the USB CDC ACM device NOT plugged in (yet), type:
ls /dev/tty.*
This will show all serial devices currently connected to the Mac. In the author’s case, the following list appears:
/dev/tty.Bluetooth-Modem
/dev/tty.Bluetooth-PDA-Sync
/dev/tty.Rob-1
Now, plug the USB CDC device into a USB port of the Mac. Hit the UP cursor, which will bring the search command back ( ls /dev/tty.* ) and hit return. You should get the exact same list as before, but this time, with a new serial device. In the author’s case, it was:
/dev/tty.usbmodem3d11
Once the complete name is know, the received serial port data can be displayed by typing:
screen /dev/tty.usbmodem3d11
(replace “3d11” in the above line with the value for your machine). If the microcontroller was programmed with the “USB\Device - CDC - Basic Demo”, you can then press the user pushbutton, and the standard demo text should be printed to the screen (ex: “BUTTON PRESSED ---”).
If the USB device is being operated as a USB to UART translator device (ex: using “USB\Device - CDC - Serial Emulator” firmware, the baud rate can be set by using syntax like follows:
screen -U /dev/tty.usbmodem3d11 38400
Where “usbmodem3d11” should be replaced with the actual value of the device, and “38400” should be replaced with actual desired baud rate (ex: 9600, 19200, 38400, 57600, 115200, etc.). More details and usage information for screen can be found in the man page.
Note: Composite CDC + (any other interface) USB devices (such as the MCP2200, which is a composite CDC+HID device) will only work on Mac OS X 10.7 (or later). Mac OS X 10.7 is the first OS X version that supports USB Interface Association Descriptors (IADs), which are needed when implementing composite USB devices with multiple interfaces, with at least one CDC-ACM function. Prior versions of Mac OS X did not support IADs, and therefore can only support non-composite, single function CDC-ACM devices.
MLA - USB Library Help Version : 2.16
![]() |