BY FRED EADY
Robotics and electronics go hand in hand. If you're
also a Nuts & Volts reader, you know that we
assembled a working Silicon Laboratories-based USB
microcontroller interface in the Nuts & Volts Design Cycle
column. This month, we're going to pull that Nuts & Volts
USB project into RoboLand and put its resources to work
in a mechatronic kind of way.
The Vehicle
The transport mechanism in our case is a printed
circuit board (PCB). The fuel for our robotronic vehicle is
composed of silicon and floobydust. The silicon is supplied
by Silicon Laboratories and Microchip. The floobydust is a
PHOTO 1. As a robotician and SERVO reader, you are used
to supplying the NUTS of a project. This month, I'm supplying
the VOLTS with this USB-enabled project board.
A Silicon Laboratories CP2102 enables USB connectivity
to the on-board PIC18LF4620 microcontroller. Many a
mechatronic dream can be realized as 99% of the
PIC18LF4620's I/O is available to the robotic user/programmer.
36 SERVO 03.2009
product of our minds and the binary output we coax from
a PIC C compiler. The metallic, silicon, and fiberglass components of our logical conveyance are shown in Photo 1.
The circuitry you see in Photo 1 was originally intended
to introduce the feature set of the Silicon Laboratories
CP2102 USB-to-UART bridge IC. The CP2102 is a drop-in
replacement for legacy Maxim and Sipex RS-232 interfaces.
The major selling point of the chip is that the programmer
is not required to have indepth knowledge of the inner
workings of the USB protocol to use it. The CP2102 takes
care of the embedded USB intricacies with the help of a
factory-supplied VCP (Virtual Comm Port) driver at the
personal computer end. Thus, the USB programmer can
assemble a complete embedded USB-based application
without having to code any USB firmware. We went into
the CP2102's details in the Nuts & Volts Design Cycle
column. So, if you want to learn more about the CP2102
and what it takes to assemble your own embedded USB
interface project board, take some time to look at the
Design Cycle piece. After all, a combination of nuts, volts,
and servos can be found in many a robotic device.
In this discussion, we'll treat the CP2102/PIC18LF4620
circuit you see in Photo 1 as a black box programmable
module. The circuit layout for the PIC18LF4620-based
black box is displayed graphically in Schematic 1. All of
the programming will be aimed at the PIC. I'll compile our
applications using the HI-TECH C PRO Compiler for the
PIC18 MCU Family.
Think Big ... Start Small
Let's code up a simple USB communications link, send a
message across it, and use MPLAB and the new Microchip
ICD 3 debugger/programmer to view the results. To make
things a bit easier, I've already coded up a PIC18LF4620
EUSART driver. You can see the details of this by examining
the code in the download package available on the SERVO
website ( www.servomagazine.com). The driver is