3
little interest to you. If you would want to make your own board with either of these connectors,
check Connector pin assignments (p. 13) for the pin assignments.
Programming details
Three pins of a PIC chip are central to programming the chip: MCLR, PGC, and PGD (and of
5V and ground). The MCLR pin is by default the reset pin of the chip. On newer chips this
pin can also be configured as an input pin. The PGC and PGD functions are often on pins that are
also I/O pins, on most chips RB6 and RB7.
On most chips programming mode is entered by the following sequence:
•
reset the chip: +5V present, MCLR is low.
•
MCLR quickly rises from low to Vpp (for most chips ~ 13V)
This sequence is called the Vdd-before-Vpp sequence. Vdd is the Microchip term for the +5V.
Another sequence, required by some PIC chips, is the Vpp-before-Vdd sequence, which is
described later. The Wisp648 requires (or generates) +5V. It can not be used with a lower voltage.
Note that MCLR must rise quickly. The exact timing requirement is in the programming
specification of each PIC, but it is such that no capacitor on the MCLR pin can be tolerated. As a
simple rule: the programmer must be connected directly to the MCLR pin, the rest of the circuit
connects via a 33k resistor (10k will often be enough, but 33k is recommended). A reset-delay
capacitor can still be present, but it must be on the other side of the 33k resistor.
When the chip is in programming mode PGC is used as clock line (programmer to target chip) and
PGD as the data line (bidirectional) to enter programming commands and data into the chip, or to
read the content of the chip. The programmer must be able to control these two pins: the rest of the
circuit must not load these pins too heavily. As a simple rule: it is OK when the programmer is
connected directly to the PGM and PGD pins, and the rest of the target circuit is connected via a
two resistors of 1k or higher.
The programming mode used by Wisp648 is called HVP for High Voltage Programming (because
a high voltage on the MCLR pin is used to enter programming mode). Some PIC chips support
another, more limited programming mode: LVP for Low Voltage Programming. To use LVP it
must be enabled in the configuration word in the chip. When so configured, one I/O pin (on most
chips RB4 or RB5) is now PGM, for ProGraMming enable. When this pin is high immediately
after a reset the chip enters the Low Voltage Programming mode. This LVP is not supported on all
PICs, and it claims one I/O pin, which for the popular 18-pins chips is right in the middle of the
only full 8-bits port. Hence LVP never became popular, and on newer PIC chips it is no longer
available. This would be of little interest to you as Wisp648 user, except for one bug which is
present in some PICs (but no-one seems to be able to tell in exactly which ones – it might even
depend on the silicon revision): when the PGM pin is high during reset this can interfere with high
voltage programming! This can happen even when LVP is not enabled in the image that is
programmed into the chip. The solution is to make sure that the PGM pin is tied low. This can be
done by adding a suitable resistor to the target circuit (maybe one is present already), or Wisp648
can take care of this via a pin in its programming interface. Note that the target circuit must allow
the PGM pin to be drawn low – if you connect it to +5V with 10 Ohm resistor Wisp648 will not be
able to pull it down. But 1k or more is OK. Note that this LVP problem is not specific to Wisp648:
whenever you use an HVP programmer with a chip that has this problem, you must take care to
pull the LVP pin of your target low.
Some PIC chips have a peculiar requirement for entering programming mode: Vpp (~ 13V) must
be applied to their MCLR pin and only after that the power (5V) must be applied. This is called the