About Me

Labels

2014年9月14日 星期日

Sending Data through UART USB dongle on Mac OS X

The Universal Asynchronous Receiver/Transmitter (UART) is a hardware that enables data transmission between parallel and serial form. Common UART communication protocols include RS-232, RS-422 or RS-485. I believe engineers who have lived in PC-era have used this cable before:

Today's computer no longer has RS-232 port. Fortunately, UART still exist in our life, just in different form:

This is USB-UART dongle made by FTDI chip. The chip on the board emulates a UART port so we can still use old technology to communicate with new chip, such as TI's Bluetooth Low Energy (BLE) chip CC2540.

So how can we connect to USB-UART? Actually Mac OS X has a command "Screen". Just open an terminal and follow the steps below:

1. list the USB-UART device:

$ ls /dev/cu.*
/dev/cu.Bluetooth-Modem /dev/cu.usbserial

This command will list the connected devices on your Mac. Our target is usbserial

2. Connect to the device, simple type the "screen" and baud rate:

$ screen /dev/cu.usbserial 115200

The number 115200 is the baud rate used to communicate between two devices