USB to RS232 converter - Baby O serial servo control example

The Pololu USB to RS232 converter is based on the Silicon Labs CP2102 chip. The data sheet and drivers for Mac and Linux (available real soon now from Pololu) may be downloaded from SiLabs site. For the data sheet see:
silabs.com/public/documents/ … cp2102.pdf

You can also download a program from SiLabs that sets various chip parameters like its power draw, product string, etc. into the eprom. See
silabs.com/tgwWebApp/public/ … erface.htm

The Pololu adapter works fine, but the CP2103 chip probably would have been a better choice as it offers 4 extra general purpose data lines. A similar chip from FTDI, the FT232R, already allows this and USB-RS232 adapters using this chip are available from competing robotics suppliers for a price similar to the Pololu unit. Furthermore, the actual functions of the various control lines of FT232R can be reprogrammed by free, downloadable software.

In connecting the USB adapter to the Baby O, I did experience a reset problem. When the Baby O is off, TX from the USB adapter will power it up weakly through the input protection diodes on PD0 (RX). This was solved by using a 1N4148 diode to block DC from the USB adapter TX, together with a 150K pullup resistor (may not be necessary) to +5 on PD0. With the connection working, I produced a skeleton of a simple command interpreter that allows one to talk to the Baby O through a USB port. See below for links to the code.

More recently, I’ve expanded the command interpreter to implement a 4 channel (3 are implemented) interrupt-driven serial servo controller for a robotics application. Simple commands given over the serial line, such as “F 150”, set the F servo to maintain a neutral position.

Let’s encourage Pololu to try to keep ahead of the pack, and especially, to inform their customers about the availability of software and drivers for their products.

Cheers, Jim

Links to the code for the skeleton of a command intepreter, based on the “stdio” example distributed with WinAVR follows.
You’ll need (servo_control.c or command_I.c) plus uart.c and uart.h

uoxray.uoregon.edu/orangutan/servo_control.c
uoxray.uoregon.edu/orangutan/command_I.c
uoxray.uoregon.edu/orangutan/uart.c
uoxray.uoregon.edu/orangutan/uart.h

1 Like

Silicon Labs does have CP2102 drivers for Mac OSX running on Power PC chips:

http://www.silabs.com/tgwWebApp/public/web_content/products/Microcontrollers/USB/en/mcu_vcp.htm

However, these drivers don’t work on the Intel based Macs. I just ran into this problem about an hour ago, and found some mention of it on this message board:

http://www.surveyor.com/cgi-bin/yabb2/YaBB.pl?num=1161916754/4

According to an admin post, SILabs is aware of the problem, and intends to release a new driver in a couple of weeks. This post is dated October 2006. Oh well.

Two interesting workarounds I came across (but did not try) are to install Windows as a second OS (which you can do on the Intel based Mac’s remember), or even run it from within OSX using a virtual PC environment. This last one sounds iffy to me. And of course, if you own a Mac you probably aren’t a huge Windows fan anyway.

-Adam

P.S. Apparently the Linux drivers work just fine, and even come built in to some flavors.

We could not get the Pololu RS232-USB adapter to work with a Debian based linux system (actually, several versions of Ubuntu including XUbuntu).

According to one web site, Silicon Labs lifted their linux driver from the open source community but until recently, refused to release the code so that it may be fixed.

We gave up on the USB-RS232 adapter and hard-wired a level converter to use the standard serial port.

For those having problems and wanting to get the USB driver working, here is a link describing the recently released source code. I haven’t followed it up.

forum.sparkfun.com/viewtopic.php?p=5221&

Jim