Hacking USB Serial Ports

Today we’ve got a super-simple gadget hack of a commercial USB serial port adapter.
There are times when you need a low-voltage RS-232 port for interfacing with a microcontroller, some hobby project, or for poking around in some interesting system. And during many of these times, you may not want to go dig out the Arduino board or can’t find the right capacitors to build a MAX232 board. Or perhaps you are in a town or even a country without an awesome electronics junk store like Halted – you poor things! What can you do?

Enter the hacked USB Serial port:

The Keyspan USB to RS-232 adapter

Fig 1 – Hacked Keyspan USB adapter

At most big-name electronics stores or even amazon, you can get an RS-232 USB adapter for your PC for about $10 bucks. With a little luck and a steady hand, these devices can easily be hacked to provide all your RS-232 translation needs: USB to 3.3v serial, 12v RS-232 to 3.3v RS-232, and of course their original purpose of USB to 12v RS-232.
How it’s works:The most desirable type of adapter uses at least two chips: a USB controller chip such as a microcontroller and a level translator chip such as a MAX232. Other types can be hacked but they will probably need you to dump the firmware, rewrite it, and reprogram the device. That’s fun and all, but for now we’re just looking for a simple and CHEAP way to get a low-voltage USB serial port. Here’s a simplified diagram of what we’re working with.

USB Serial Port Diagram

Fig 2 – Simplified System Diagram

As you can see, the host controller does all the heavy lifting of talking USB, buffering the data that the PC sent, and retransmitting it as RS-232. Usually, the micro is running from 3.3v so it’s UART output is 3.3v. Those signals are then piped into a generic level shifter device to translate the 0-3.3v swing of the micro into a -12v to +12v swing for the DB9 connector. So by splitting the system at the 3.3v RS-232 point (TxD2, RxD2) you get TWO low-voltage interfaces for the price of one. On the left side, you get a USB serial port with 3.3v output that you can use to talk to a PIC or something. And on the right side, you get a free MAX232 interface that you can use on a standard DB9 PC serial port to get a second 3.3v serial interface to talk to that same PIC.
Continued on the next page…
This entry was posted in Hacks. Bookmark the permalink.

One Response to "Hacking USB Serial Ports"

Leave a reply