Datasheet

Table Of Contents
PIC18F1220/1320
DS39605F-page 188 © 2007 Microchip Technology Inc.
19.5.2 DATA EEPROM
CODE PROTECTION
The entire data EEPROM is protected from external
reads and writes by two bits: CPD and WRTD. CPD
inhibits external reads and writes of data EEPROM.
WRTD inhibits external writes to data EEPROM. The
CPU can continue to read and write data EEPROM,
regardless of the protection bit settings.
19.5.3 CONFIGURATION REGISTER
PROTECTION
The configuration registers can be write-protected. The
WRTC bit controls protection of the configuration
registers. In normal execution mode, the WRTC bit is
readable only. WRTC can only be written via ICSP or
an external programmer.
19.6 ID Locations
Eight memory locations (200000h-200007h) are
designated as ID locations, where the user can store
checksum or other code identification numbers. These
locations are both readable and writable during normal
execution through the TBLRD and TBLWT instructions,
or during program/verify. The ID locations can be read
when the device is code-protected.
19.7 In-Circuit Serial Programming
PIC18F1220/1320 microcontrollers can be serially
programmed 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. 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 (see Table 19-4).
19.8 In-Circuit Debugger
When the DEBUG bit in configuration register,
CONFIG4L, is programmed to a ‘0’, the In-Circuit
Debugger functionality is enabled. This function allows
simple debugging functions when used with MPLAB
®
IDE. When the microcontroller has this feature
enabled, some resources are not available for general
use. Table 19-5 shows which resources are required by
the background debugger.
TABLE 19-5: DEBUGGER RESOURCES
To use the In-Circuit Debugger function of the
microcontroller, the design must implement In-Circuit
Serial Programming connections to MCLR
/VPP, VDD,
V
SS, RB7 and RB6. This will interface to the In-Circuit
Debugger module available from Microchip, or one of the
third party development tool companies (see the note fol-
lowing Section 19.7 “In-Circuit Serial Programming”
for more information).
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.
TABLE 19-4: ICSP/ICD CONNECTIONS
Signal Pin Notes
PGD RB7/PGD/T1OSI/
P1D/KBI3
Shared with T1OSC – protect
crystal
PGC RB6/PGC/T1OSO/
T13CKI/P1C/KBI2
Shared with T1OSC – protect
crystal
MCLR
MCLR/VPP/RA5
V
DD VDD
VSS VSS
PGM RB5/PGM/KBI1 Optional – pull RB5 low is
LVP enabled
I/O pins: RB6, RB7
Stack: 2 levels
Program Memory: 512 bytes
Data Memory: 10 bytes