■ FIGURE 2
■ FIGURE 3
programming specs. You can get the
programming specs for any PIC at the
You also don’t want to load
down the clock or data signal. The
components that are crossed out
show what not to include in your
circuit. The diodes on the Data and
Clock lines are a mistake because
there is two-way communication
when programming and verifying the
part. It’s pretty easy to see why they
should not be included in your design.
What isn’t quite so clear is the
diode between the MCLR reset circuit
and the MCLR/Vpp pin. This is recommended because the PIC programmer sends a high voltage signal to the
Vpp line of around 12V-13.5V for a
period of time. You don’t want that
signal feeding into your Vdd regulator.
This is actually just a safety precaution
though, because the current is small
and the MCLR pull-up resistor will
knock it down to prevent any damage.
I use a 4.7K, but a 1K will work fine.
Another recommendation which
is often missed is the series resistors
on the PGD and PGC lines between
the PIC and the rest of the circuit.
These isolate your circuit from the
PGD and PGC signals so your circuit
doesn’t load down the PIC programmer. This is usually where people
have a problem with ICSP; 100 ohm
resistors should not affect your circuit
function but it should be plenty of
resistance to isolate the programmer.
Another approach to ICSP isolation is to add a switch to your circuit.
This is the way I handled it on the
original version of my Zipper board. A
long time ago when I was just getting
started with PICBasic, I wanted a simple
BASIC Stamp-like module to program.
The Zipper was the result. I didn’t know
about the clock and data series
resistance idea or the MCLR diode suggestion because I didn’t read all of the
data sheet information. Before I added
the switch, I could not get ICSP to work
properly. I used the microEngineering
Labs ( www.melabs.com) EPIC
programmer back then, but I tested
ICSP with several PIC programmers and
had inconsistent results. My solution
was to use a smaller 100 ohm MCLR
pull-up and that seemed to help on
some programmers that created their
Vpp voltage using a voltage divider
arrangement. It still wasn’t good
I then tried a four pole switch that
allowed me to disconnect the PGC,
PGD, Vdd, and MCLR pins from my
circuit during programming to prevent
it from loading down the clock and
data and eliminate the MCLR resistor
from the programming connection.
Figure 3 shows the schematic for that
type of arrangement. This worked
very well and it’s what I ended up
doing with the Zipper.
Figure 4 shows the finished
original Zipper design with the
ICSP header setup for the
microEngineering Labs EPIC PIC
Programmer which was very popular back then. It’s still one of the best
parallel port programmers available.
To use the Zipper, I would just
slide the switch to program position
to download code and then slide it
back to run the code. Eventually, I
replaced the EPIC header with a six-pin
SIP header to match the Olimex PG1
programmer that is a surface-mount
version similar to my EZPIC programmer. This way, I could include a PIC
programmer with the module for a lower
price. I’m slowly phasing out that design
as I use the Ultimate OEM bootloaders
more than anything else now, but this is
another option for successful ICSP.
Now this next section should be
worth the price of your subscription.
While playing with the PICkit2 programmer from Microchip, I actually read the
manual. (No really, I did.) It details that
the sixth pin on the PICkit2 ICSP
connector — also known as the AUX pin
— can be used to regenerate the internal
oscillator calibration OSCCAL value that
is set at the factory and placed in the
last location of program memory.
Remember, I talked about how that
value could be erased if you erase the
whole PIC 12F675 chip back in the
January article? Well, if you tie the AUX
pin to the GP4/T1G pin of the 12F675
■ FIGURE 4
March 2007 13