Sunday, January 20, 2008

Build the USB-TTL Adapter

Build the USB-TTL adapter:

We need to connect our microprocessor to our computer for programming and any other computer—processor communication. The processor is designed for serial communication through its Tx and Rx pins (#14 and #15 in the diagram), and the USB port on your computer is a serial port of sorts (a Universal Serial Bus), but we cannot connect them directly together. The USB signals are different from the data signals our processor expects, plus the USB port on your computer has certain protocol by which it expects a device to identify itself and behave. There are many ways to make communication possible, but we will use a USB-TTL converter manufactured by FDTI because of its simplicity as a solution.

The USB-TTL adapter plugs into the usb port on your computer, and has a plug at the other end, terminating in 6 pins.

pin#
color
value
connects to
1
black
GND
"G"
2
brown
CTS#

3
red
VCC

4
orange
TxD
"R"
5
yellow
RxD
"T"
6
green
RTS#


We need to connect those pins—GND, TxD and RxD (#1, 4, 5)—to the appropriate pins ("G", "R" and "T") on the programming socket of our board. There are various approaches.
We will make a wire with a socket at either end—one connects to the USB-TTL cable, and the other attaches to the programming socket of our board. Here's how we do it:

Materials: thin gauge wire, three crimping socket terminals, one 4-position socket receptacle, one 6-position 0.1" spaced header, and small heat shrink tubing.


  1. Cut three thin gauge wires, approximately 4 inches long. (Preferrably black, orange and yellow to match those colors on our USB-TTL adapter) Strip the last 1 cm of the wires to insert it into the wire terminal.
  2. Crimp the two crimping tabs of the terminal (the left-most in the photo below) to the end of the wire, and shape the connection with a pair of needle-nosed pliers to assure that the socket is firmly joined to the wire. Repeat for all three wires.
  3. With your soldering iron, very delicately heat the joint you have made, and apply a tiny bit of solder to secure the socket to the end of the wire. Trim the excess wire which sticks beyond the end of the terminal with your clippers. Repeat for all three terminals.
  4. Stick the socket terminals into the appropriate positions on the socket receptacle. The yellow wire in the first position, the orange in the second, and black in the third. This corresponds to the labels "T", "R", and "G" on the bottom of your number 6 board. Note the orientation of the terminals and the housing in the photo below—so that the little metal tab on the back side of the terminal is caught by the free black plastic tab on the receptacle.
  5. Strip the other end of each of these wires to about 1 cm. This is the end that will solder onto the 6-position header that connects to the USB-TTL plug.
  6. Heat the end of each of these wires with the soldering iron, and try to get a little solder on the bare wire, to prepare to join it with the header.

  7. Heat each of the appropriate pins (#1, 4, and 5—black, orange, and yellow) on the header as well, and prep with a bit of solder.
  8. Cut three short pieces of heat shrink for each wire, and slip one onto each wire. These will insulate and strengthen the joints to the 0.1in header.

  9. Align the wires with their respective pins on the header, and solder to join them.
  10. Slip the small piece of heat shrink over the joints, and use a lighter or other heat source to shrink the tube.

  11. You are ready to go!


Be sure that you have installed the Virtual Com Port drivers for the USB-TTL device from FTDI. http://www.ftdichip.com/Drivers/VCP.htm
Otherwise your system will not recognize the adapter.



1 comment:

robert said...

Here is another set of crimping instructions at acroname robotics:

http://www.acroname.com/howto/crimp/crimp.html