Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
HIGHLIGHTS
This section of the manual contains the following major topics:
ICSP
28
ICSP
VDD
VSS
RB7
RB6
To application circuit
Isolation circuits
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.
The Microchip programming specification states that the device should be programmed at 5V.
Special considerations must be made if your application circuit operates at 3V only. These con-
siderations may include totally isolating the PICmicro during programming. 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 battery operated system may operate from three 1.5V cells giv-
ing 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 pro-
gramming margins have been achieved. This ensures the PICmicro operation over the voltage
range of the system.
The 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 are not affected by this issue because the 28
Oscillator Start-up Timer waits for 1024 oscillations before any code is executed. However, RC
oscillators do not require any start-up time and, therefore, the Oscillator Start-up Timer is not
used. The programmer 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
ICSP
will be incremented to some value X. Now when the device enters programming mode, the pro-
gram counter will not be zero and the programmer 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 to
ground while programming. This will prevent any oscillations from occurring during programming.
Now all that is left is how to connect the application circuit to the programmer. This depends a lot
on the programming environment and will be discussed in that section.
28
ICSP
ICSP
00A8 3FFF <blank> | 00A8 1C0C btfss PIR1,RBIF
00A9 3FFF <blank> | 00A9 28AE goto EndISR
00AA 3FFF <blank> | 00AA 1806 btfsc PORTB,0
. | .
. | .
. | .
-----------------------------------------------------------------------------------------
2N2907 14 U2A
3 0.1 1 74HC126
R7
U1D 100 RB6 2 3 PRB6
U1A
11 13 R6 +8V
2 R5 14 7
1 12
3 100 1
100 TLE2144A 2 Q3 U2B
0.1 R1
+15V 5.1k 10 U2C
74HC126
9 8
R4
Example Driver Board Schematic
PVPP
1 1 13 U2D
2 Q2 74HC126
2N2907
3 12 11
R8
U1C 100
U1B
9 R9 +15V
6 R10 8
7 10
5 100 1 JP3
100 TLE2144A 2 Q4 PVPP 1
TLE2144A 2N2222 PVDD 2
VPP C8 3 3
0.001 RB7 4
PRB6 5
JP1 R2
5.1k HEADER
1 VPP
2 VDD
3 RB7
4
5 RB6 +15V VR1
LM7808
HEADER 1 VIN VOUT 2 +8V
Note: All resistors are in Ohms,
all capacitors are in F.
JP2 C5 C9 C4
0.1 GND 100 0.1
1 +15V
2 3
HEADER
Section 28. ICSP
DS31028A-page 28-11
28
ICSP
PICmicro MID-RANGE MCU FAMILY
28.9 Design Tips
Question 1: When I try to do ICSP, the entire program is shifted (offset) in the device
program memory.
Answer 1:
If the MCLR pin does not rise fast enough, while the devices voltage is in the valid operating
range, the internal Program Counter (PC) can increment. This means that the PC is no longer
pointing to the address that you expected to be at. The exact location depends on the number of
device clocks that occurred in the valid operating region of the device.
Question 2: I am using a PRO MATE II with a socket that I designed to bring the pro-
gramming signal to my application board. Sometimes when I try to do ICSP,
the program memory is programmed wrong.
Answer 2:
The voltages / timings may be violated at the device. This could be due to the:
Application board circuitry
Cable length from programmer to target
Large capacitance on VDD which affects levels / timings
28
ICSP