capable PIC18F devices. Standard RS-232 serial ports
have been eliminated and replaced by USB portals on
most — if not all — of the PCs on the market today. In
terms of USB portals, microcontrollers large and small
are following the PC lead. However, RS-232 capability
remains a mainstay in the microcontroller world as
many embedded device applications rely on RS-232
connectivity. Microcontrollers like the PIC16F1459
provide the best of both worlds employing on-chip USB
functionality coupled with a native UART portal. Don’t let
the simplicity of this prototyping stick schematic fool you.
The PIC16F1459 is capable of revealing alternate
functions on selected I/O pins. For instance, I/O pin C1
can function as a comparator input and an external
interrupt pin when it is not busy supporting the ICSP
programming function. Depending on the pin, the
PIC16F1459 I/O subsystem supports DAC, analog, SPI,
I2C, timer input, interrupt on change, UART, and PWM
alternate functions.
I’ve popped the covers on our Rapid USB prototyping
stick in Photo 3. As you can see, the component count is
minimal. The LEDs in Photo 3 are connected in parallel in
such a way as to require only a single current-limiting
resistor. The logic level applied to the LED pins determines
if the red or green LED illuminates. The prototyping stick
comes preloaded with a bootloader that is supported by
the CCS C compiler IDE. So, don’t be tempted to plug
into the Rapid USB stick’s Tag-Connect programming
interface, which is located at dead center of its circuit
board. The flip side of the prototyping stick is shown in
Photo 4. In this view, you can clearly see the Tag-Connect’s ICSP contacts. The six pads directly above the
47K resistor interface with the Tag-Connect cable’s “bed
of nails.” The 47K resistor and the trio of capacitors are
all that’s needed to support the PIC16F1459.
The shorting blocks jumper-select one of the
PIC16F1459 I/O lines on each of the four-position male
headers. The pair of selected I/O lines is routed to the
prototyping cable connector mounted to the far left of
Photo 3. The prototyping cable shown in Photo 2 is
loaded with a red, white, and green conductor. The green
conductor is grounded. The header pin/conductor logic is
laid out in Figure 1. The pushbutton is electrically
connected to the PIC16F1459’s C1 pin. The advantage to
this connection is that the pushbutton can be used to
trigger the external interrupt pin. Naturally, the pushbutton
position (open or closed) can also be sensed by reading
the logic level presented to pin C1.
Let's Blink an LED
It may seem immaterial, but learning to simply blink
an LED provides important information about how to
structure our applications. The code captured in
Screenshot 1 blinks the prototyping stick’s red LED. If you
are familiar with the CCS C compiler, you know that the
Project Wizard will build an include file (xxxx.h) that is
referenced at the top of your C source code. In the case
Post comments on this article and find any associated files and/or downloads at www.nutsvolts.com/
index.php?/magazine/article/november2014_DesignCycle.
ADVANCED TECHNIQUES FOR DESIGN ENGINEERS
November 2014 53
; Photo 3. This is a top-side aerial view of the raw Rapid USB
prototyping stick. The I/O selection headers are top-center.
One I/O line on each four-position header is routed to the
prototyping cable connector on the far left.
; Photo 4. The PIC16F1459 is supported by only four external
components. All of the USB and CPU clocking is handled
internally by the microcontroller.
Header Position White Conductor Red Conductor
1 PIN_CO PIN_C2
2 PIN_C3 PIN_C5
3 PIN_B5 PIN_B7
4 PIN_B4 PIN_B6
; Figure 1. The header shunts in conjunction with the
prototyping cable connector allow two of the
PIC16F1459's I/O pins to be routed to an external
destination.
; Photo 2.
With the power
of the CCS PIC C
compiler behind
them, this set of
components is
a formidable
development
platform and
learning tool.