Haven’t been writing anything lately but now I have come to cross this and wish to share on purpose ( Yes I write things just to note down for myself to reference later ). Connecting to serial ports on some boards using USB to ttl converters in MacOS is really painful and haven’t found any good resources to refernce the process ( Ei Captain especially ). So decided to made this post.
There are several USB to ttl chipsets on the market but I only got my hands on two types of them – SylabsCP2102 && Ch340G. In case you are wondering what they look like, the following are the pictures of front and back of devices.
Drivers && Minicom
Luckily both devices have their own drivers for MacOS and it is perfectly working with Ei Captain too.
You need to restart your computer after each driver installed for kload to prepare things for you.
Mac doesn’t have come with built-in serial port console so we are going to use minicom. Installation is pretty much simple if you have brew install on your computer.
1 2 3
Then you should be able to run the command
minicom from your local console. We will talk about its configuration later.
There are several pin types starting from VCC to TXD, RXD and 5V if your device need a power feed. But in my case I am using on a self-powered device and used the following PINs as RS232 specification.
- GND ( Ground Cable )
- TxD ( Data to be transmitted )
- RxD ( Data to be received )
[ Following is the PIN assignment example ]
Both of the converters come with labels under each PINs but you still have to look out for correct assignments on your device.If there is no label attached, check your vendor’s reference documentation or manual for more informations.
Assignemtns are to be made in the following patterns which is a little bit strange if you don’t have prior experience.
The color of cables could be different based on your choice.
With CH340G, everything is pretty much simple.
Example Types of Cables.
If your driver is installed properly, after loading up the device and plug the converter into your USB port you will see the connected device under /dev/ in the pattern tty.vendorspecifiedname.
In my case,
- CP2012 (tty.SLAB_USBtoUART)
- CH340G (tty.wchusbserial1410)
Open you console and call minicom setup.
Go through Serial port setup by entering it and change the value of Serial Device (Key -A) && with your respective tty device name from /dev/. I was using CH340G and the following is how it is filled up in my setup.
Note remember to change Hardware Flow Control (F) && Software Flow Control (G) to no.
And save that config as dfl (default) and do an Exit ( not Exit Minicom ).
Connect your device, type the command
minicom and all the feedbacks would be screening if you have done the steps correctly.
Have Fun Hacking