English
Language : 

PIC16F87-E Datasheet, PDF (149/228 Pages) Microchip Technology – 18/20/28-Pin Enhan lashMicrocontrollers with nanoWatt Technology
15.14 In-Circuit Debugger
When the DEBUG bit in the Configuration Word is
programmed to a ‘0’, the In-Circuit Debugger function-
ality is enabled. This function allows simple debugging
functions when used with MPLAB® ICD. When the
microcontroller has this feature enabled, some of the
resources are not available for general use. Table 15-7
shows which features are consumed by the background
debugger.
TABLE 15-7: DEBUGGER RESOURCES
I/O pins
RB6, RB7
Stack
1 level
Program Memory
Address 0000h must be NOP
Data Memory
Last 100h words
0x070 (0x0F0, 0x170, 0x1F0)
0x1EB-0x1EF
To use the In-Circuit Debugger function of the micro-
controller, the design must implement In-Circuit Serial
Programming connections to RA5/MCLR/VPP, VDD,
GND, RB7 and RB6. This will interface to the In-Circuit
Debugger module available from Microchip, or one of
the third party development tool companies.
15.15 Program Verification/Code
Protection
If the code protection bit(s) have not been
programmed, the on-chip program memory can be
read out for verification purposes.
15.16 ID Locations
Four memory locations (2000h-2003h) are designated
as ID locations, where the user can store checksum or
other code identification numbers. These locations are
not accessible during normal execution but are
readable and writable during program/verify. It is
recommended that only the four Least Significant bits
of the ID location are used.
15.17 In-Circuit Serial Programming
PIC16F87/88 microcontrollers can be serially pro-
grammed while in the end application circuit. This is
simply done with two lines for clock and data and three
other lines for power, ground and the programming
voltage (see Figure 15-13 for an example). This allows
customers to manufacture boards with unprogrammed
devices and then program the microcontroller just
before shipping the product. This also allows the most
recent firmware or a custom firmware to be
programmed.
PIC16F87/88
For more information on serial programming, please
refer to the “PIC16F87/88 Flash Memory Programming
Specification” (DS39607).
Note:
The Timer1 oscillator shares the T1OSI
and T1OSO pins with the PGD and PGC
pins used for programming and
debugging.
When using the Timer1 oscillator, In-
Circuit Serial Programming™ (ICSP™)
may not function correctly (high voltage or
low voltage), or the In-Circuit Debugger
(ICD) may not communicate with the
controller. As a result of using either ICSP
or ICD, the Timer1 crystal may be
damaged.
If ICSP or ICD operations are required, the
crystal should be disconnected from the
circuit (disconnect either lead), or installed
after programming. The oscillator loading
capacitors may remain in-circuit during
ICSP or ICD operation.
FIGURE 15-13:
TYPICAL IN-CIRCUIT
SERIAL PROGRAMMING
CONNECTION
External
Connector
Signals
+5V
0V
VPP
CLK
Data I/O
RB3/PGM
To Normal
Connections
*
PIC16F87/88
VDD
VSS
RA5/MCLR/VPP
RB6
RB7
RB3†
***
VDD
To Normal
Connections
* Isolation devices (as required).
† RB3 only used in LVP mode.
 2005 Microchip Technology Inc.
DS30487C-page 147