TB013
DS91013B-page 2-10 Preliminary 2000 Microchip Technology Inc.
Pins RB6 and RB7 are used by the PICmicro MCU for
serial programming. RB6 is the clock line and RB7 is
the data line. RB6 is driven by the programmer. RB7 is
a bidirectional pin that is driven by the programmer
when programming, and driven by the PICmicro MCU
when verifying. These pins must be isolated from the
rest of the application circuit so as not to affect the sig-
nals during programming. You must take into consider-
ation the output impedance of the programmer when
isolating RB6 and RB7 from the rest of the circuit. This
isolation circuit must account for RB6 being an input on
the PICmicro MCU, and for RB7 being bidirectional
(can be driven by both the PICmicro MCU and the pro-
grammer). For instance, PRO MATE® II has an output
impedance of 1k¾. If the design permits, these pins
should not be used by the application. This is not the
case with most applications so it is recommended that
the designer evaluate whether these signals need to be
buffered. As a designer, you must consider what type of
circuitry is connected to RB6 and RB7 and then make
a decision on how to isolate these pins. Figure 1 does
not show any circuitry to isolate RB6 and RB7 on the
application circuit because this is very application
dependent.
The total capacitance on the programming pins affects
the rise rates of these signals as they are driven out of
the programmer. Typical circuits use several hundred
microfarads of capacitance on VDD which helps to
dampen noise and ripple. However, this capacitance
requires a fairly strong driver in the programmer to
meet the rise rate timings for VDD. Most programmers
are designed to simply program the PICmicro MCU
itself and don’t have strong enough drivers to power the
application circuit. One solution is to use a driver board
between the programmer and the application circuit.
The driver board requires a separate power supply that
is capable of driving the VPP and VDD pins with the
correct rise rates and should also provide enough cur-
rent to power the application circuit. RB6 and RB7 are
not buffered on this schematic but may require buffer-
ing depending upon the application. A sample driver
board schematic is shown in Appendix A.
The Microchip programming specification states that
the device should be programmed at 5V. Special con-
siderations must be made if your application circuit
operates at 3V only. These considerations may include
totally isolating the PICmicro MCU during program-
ming. The other issue is that the device must be verified
at the minimum and maximum voltages at which the
application circuit will be operating. For instance, a bat-
tery operated system may operate from three 1.5V
cells giving an operating voltage range of 2.7V to 4.5V.
The programmer must program the device at 5V and
must verify the program memory contents at both 2.7V
and 4.5V to ensure that proper programming margins
have been achieved. This ensures the PICmicro MCU
option over the voltage range of the system.
This final issue deals with the oscillator circuit on the
application board. The voltage on MCLR/VPP must rise
to the specified program mode entry voltage before the
device executes any code. The crystal modes available
on the PICmicro MCU are not affected by this issue
because the Oscillator Start-up Timer waits for 1024
oscillations before any code is executed. However, RC
oscillators do not require any startup time and, there-
fore, the Oscillator Startup Timer is not used. The pro-
grammer must drive MCLR/VPP to the program mode
entry voltage before the RC oscillator toggles four
times. If the RC oscillator toggles four or more times,
the program counter will be incremented to some value
X. Now when the device enters programming mode,
the program counter will not be zero and the program-
mer will start programming your code at an offset of X.
There are several alternatives that can compensate for
a slow rise rate on MCLR/VPP. The first method would
be to not populate the R, program the device, and then
insert the R. The other method would be to have the
programming interface drive the OSC1 pin of the
PICmicro MCU to ground while programming. This will
prevent any oscillations from occurring during program-
ming.
Now all that is left is how to connect the application cir-
cuit to the programmer. This depends a lot on the
programming environment and will be discussed in that
section.
Programmer
The second consideration is the programmer.
PIC16CXXX MCUs only use serial programming and
therefore all programmers supporting these devices
will support ICSP. One issue with the programmer is the
drive capability. As discussed before, it must be able to
provide the specified rise rates on the ICSP signals and
also provide enough current to power the application
circuit. Appendix A shows an example driver board.
This driver schematic does not show any buffer circuitry
for RB6 and RB7. It is recommended that an evaluation
be performed to determine if buffering is required.
Another issue with the programmer is what VDD levels
are used to verify the memory contents of the PICmicro
MCU. For instance, the PRO MATE II verifies program
memory at the minimum and maximum VDD levels for
the specified device and is therefore considered a pro-
duction quality programmer. On the other hand, the
PICSTART® Plus only verifies at 5V and is for prototyp-
ing use only. The Microchip programming specifica-
tions state that the program memory contents should
be verified at both the minimum and maximum VDD lev-
els that the application circuit will be operating. This
implies that the application circuit must be able to han-
dle the varying VDD voltages.
Note: The driver board design MUST be tested
in the user’s application to determine the
effects of the application circuit on the
programming signals timing. Changes
may be required if the application places
a significant load on VDD, VPP, RB6 OR
RB7.