DESIGNCYCLETHE
ADVANCED TECHNIQUES FOR DESIGN ENGINEERS
■ BY FRED EADY
ZEROG GOES USB
The ZeroG - PIC24FJ128GA006 Trainer project sparked quite a bit of Nuts&Volts
reader interest. In fact, the ZeroG design stirred up so much email dust that I
was compelled to offer the ZeroG - PIC24FJ128GA006 Trainer as a kit in the
EDTP web store. It seems that our Design Cycle USB discussions have been
popular with the Nuts & Volts readers, as well. So, this month we’re going to
take the ZeroG Trainer basic design, remove the ZG2100M Wi-Fi module,
replace the original PIC24FJ128GA006 with a USB-enabled one, do some minor
modification work on a new printed circuit board, and add a USB portal.
THE MICROCHIP PIC24FJ256GN106
The PIC24FJ256GB106 is a 16-bit USB v2.0-compliant
microcontroller. To make this USB-enabled design easy for
you to assemble, I’ve chosen this PIC for its high level of
availability, low cost, and low pin count. As the numbers
in its name imply, the PIC24FJ256GB106 is the largest
microcontroller of the smallest PIC24FJxxxGBxxx series in
terms of internal program memory. Sporting only 64 pins,
the PIC24FJ256GB106 internals include 256K of high
endurance program Flash and 16K of SRAM.
Like other members of its family, the
PIC24FJ256GB106 I/O subsystem is based on a set of
remappable peripherals. This PIC has 29 remappable pins
which can be assigned to digital-only I/O pins using its
■ PHOTO 1. The PIC24F/PIC32MX USB Trainer PCB is
designed to integrate with a perfboard or dedicated
external PCB with standard 0.1 inch headers.
58
June 2010
general-purpose timer clock inputs and timer-related
peripherals such as input capture and output compare.
Serial communications I/O pins tied to UART and SPI
portals are also remappable. External interrupt inputs and
comparator module outputs are eligible for remapping, as
well. Note that you can’t find a dedicated UART pin in
Figure 1. However, you can find dedicated I2C and RTCC
pins. Basically, any peripheral I/O pins that you can readily
identify are not remappable.
The PIC24FJ256GB106 does a bunch of things with
USB that we won’t cover in our USB discussion. For
instance, if your design requires it, the PIC can act as a
low speed or full speed USB host. Although we won’t use
its host mode capability, we will take advantage of
everything else USB that this PIC offers. The
PIC24FJ256GB106’s USB support is total to the point that
all we need to do to tap into its USB potential is add a
USB connector and a 3. 3 volt regulator to our design.
SPEAKING OF DESIGNS
Turn your attention to Photo 1. The deceptively simply
printed circuit board (PCB) is the base component of a
PIC24F/PIC32MX USB Trainer. If you’re wondering how
PIC32MX got into the PIC24F/PIC32MX USB Trainer’s
moniker, compare Figure 1 to Figure 2.
This is a good time to show you how peripheral pin
select allows the PIC32MX and PIC24FJ256GB106
microcontrollers to lay eggs in the same nest. Note that in
Figure 2 PIC32MX pins 31 and 32 can be configured as
UART I/O. Those same PIC24F/PIC32MX USB Trainer I/O
pins in Figure 1 are remappable (RP10 and RP17). Recall
that we can use the PIC24FJ256GB106’s peripheral pin
select feature to remap UART I/O. The same UART