How to Work With USB to TTL Converters Using Minicom on Mac

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.

Front Back
Front Back

Drivers && Minicom

Luckily both devices have their own drivers for MacOS and it is perfectly working with Ei Captain too.

Drivers

  1. CP2012
  2. CH340G

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
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew update 
$ brew install minicom 

Then you should be able to run the command minicom from your local console. We will talk about its configuration later.

Pin Assignments

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.

PINs

  1. GND ( Ground Cable )
  2. TxD ( Data to be transmitted )
  3. RxD ( Data to be received )

[ Following is the PIN assignment example ]

pin

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.

Cable Converter Device
Red GND GND
Blue TxD RxD
Black Rxd TxD

The color of cables could be different based on your choice.

With CH340G, everything is pretty much simple.

Cable Converter Device
Red GND GND
Blue TxD TxD
Black Rxd RxD

Example Types of Cables.

Cables

Minicom SETUP

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,

  1. CP2012 (tty.SLAB_USBtoUART)
  2. CH340G (tty.wchusbserial1410)

Open you console and call minicom setup.

1
$ minicom -s

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.

minicom

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

Copyright © 2016 - Tin Aung Linn. Powered by Octopress