ADVANCED TECHNIQUES FOR DESIGN ENGINEERS
■ BY FRED EADY
A DISCERNING TOUCH
I HAD THE PLEASURE OF taking last month’s Xilinx/Microchip capacitive touch
sensing prototype hardware on the road to Abel Elementary School in
Sarasota, FL. The occasion was Space Day, which is an annual space-science
event sponsored by the Lockheed Martin Corporation. Over 150 fourth and fifth
grade fingers touched the tin touch sensor, which was insulated by and tied
down to a desk with a piece of cellophane tape I scarfed from a teacher’s desk.
Thanks to a CleverScope and my Lenovo laptop, each of the Space Day fourth
and fifth graders also got to watch the relaxation oscillator waveforms change
in frequency as their fingers mingled with the touch plate’s capacitance.
Lockheed Martin throws Space Days all over the United
States in communities the company does business in.
The idea behind Space Day is to develop students’ interest
in math, science, and technology. From what I saw, we
have a good crop of scientists, engineers, and astronauts
coming along in Sarasota.
Last time, we took a look at the basic hardware and
firmware required to implement a capacitive touch system.
In doing so, we fashioned a relaxation oscillator out of a
couple of PIC microcontroller comparators and a Xilinx
CPLD set up as an SR Latch. This month, I’m going to
show you how to put together a capacitive touch system
using a single PIC microcontroller.
On the outside, the PIC16F727 looks just like any
other 40-pin PIC microcontroller. If you compare the
PIC18F4620 pinout to the PIC16F727 pinout, you will find
them functionally identical. The PIC16F727 pinout is also
identical to the functional physical pinout of the
PIC16F877. In that the PIC16F727
and PIC16F877 are 16F parts, it
■ PHOTO 1. We are going to reuse
some touch code from last time in this
project. The PIC16F727 touch hardware
is also reusable as you can push a
similar pinned PIC into the 40-pin socket
and use the circuit for projects that don’t
utilize capacitive touch sensing. In fact,
you can simply turn off the PIC16F727’s
capacitive sensing module and run the
PIC16F727 like an everyday PIC.
76 July 2008
stands to reason that the PIC18F4620 has an advantage
in terms of the amount of program Flash and SRAM.
However, there are some differences within the
PIC16F727 worth pointing out as these differences
directly affect our PIC16F727 design methodology.
The PIC16F727’s I/O subsystem is multiplexed just as
it is on the PIC18F4620 and PIC16F877. Note that the
PIC16F727 places a multiplexed VCAP function at pins 2,
7, and 14. A ceramic capacitor in the range of 0.1 μF to
1.0 μF must be attached to the VCAP pin of your choice
when the PIC16F727 is powered by + 5 VDC. The ceramic
capacitor on the selected VCAP pin acts as a bypass
capacitor for the PIC16F727’s internal LDO (low drop out)
voltage regulator. Due to the PIC16F727’s internal design,
the maximum supply voltage that can be applied to the
PIC16F727’s internal electronics is 3. 6 VDC. The
PIC16F727 LDO allows the PIC16F727 I/O to operate in
standard + 5 VDC systems while maintaining a safe operating
voltage for the PIC16F727 internal logic. If the PIC16F727
design is powered by a supply voltage equal to or below
3. 6 VDC and no + 5 VDC I/O interaction is required, the
services of a PIC16LF727 can be
employed. The PIC16LF727 does not
contain an internal LDO and as a
consequence doesn’t require an
external LDO bypass capacitor. You
can also use a PIC16F727 with a 3. 6
VDC power supply and disable the
PIC16F727’s internal LDO. Disabling
the PIC16F727’s VCAP pins will
reduce the PIC16F727’s operating
current by 300 μA.