English
Language : 

PIC18FXX20 Datasheet, PDF (259/366 Pages) Microchip Technology – 64/80-Pin High Performance 1 Mbit Enhanced FLASH Microcontrollers with A/D
PIC18FXX20
23.4.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.
23.4.3
CONFIGURATION REGISTER
PROTECTION
The configuration registers can be write protected. The
WRTC bit controls protection of the Configuration reg-
isters. In User mode, the WRTC bit is readable only.
WRTC can only be written via ICSP or an external
programmer.
23.5 ID Locations
Eight memory locations (200000h - 200007h) are des-
ignated as ID locations, where the user can store
checksum or other code identification numbers. These
locations are accessible 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.
23.6 In-Circuit Serial Programming
PIC18FXX20 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. 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.
Note:
When performing in-circuit serial program-
ming, verify that power is connected to all
VDD and AVDD pins of the microcontroller,
and that all VSS and AVSS pins are
grounded.
23.7 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 of the resources are not available for
general use. Table 23-4 shows which features are
consumed by the background debugger.
TABLE 23-4: DEBUGGER RESOURCES
I/O pins
Stack
Program Memory
Data Memory
RB6, RB7
2 levels
Last 576 bytes
Last 10 bytes
To use the In-Circuit Debugger function of the micro-
controller, the design must implement In-Circuit Serial
Programming connections to 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.
23.8 Low Voltage ICSP Programming
The LVP bit Configuration register, CONFIG4L,
enables low voltage ICSP programming. This mode
allows the microcontroller to be programmed via ICSP
using a VDD source in the operating voltage range. This
only means that VPP does not have to be brought to
VIHH, but can instead be left at the normal operating
voltage. In this mode, the RB5/PGM pin is dedicated to
the programming function and ceases to be a general
purpose I/O pin. During programming, VDD is applied to
the MCLR/VPP pin. To enter Programming mode, VDD
must be applied to the RB5/PGM, provided the LVP bit
is set. The LVP bit defaults to a (‘1’) from the factory.
Note 1: The High Voltage Programming mode is
always available, regardless of the state
of the LVP bit, by applying VIHH to the
MCLR pin.
2: While in Low Voltage ICSP mode, the
RB5 pin can no longer be used as a gen-
eral purpose I/O pin, and should be held
low during normal operation.
3: When using low voltage ICSP program-
ming (LVP) and the pull-ups on PORTB
are enabled, bit 5 in the TRISB register
must be cleared to disable the pull-up on
RB5 and ensure the proper operation of
the device.
If Low Voltage Programming mode is not used, the LVP
bit can be programmed to a '0' and RB5/PGM becomes
a digital I/O pin. However, the LVP bit may only be pro-
grammed when programming is entered with VIHH on
MCLR/VPP.
It should be noted that once the LVP bit is programmed
to ‘0’, only the High Voltage Programming mode is
available and only High Voltage Programming mode
can be used to program the device.
When using low voltage ICSP, the part must be sup-
plied 4.5V to 5.5V, if a bulk erase will be executed. This
includes reprogramming of the code protect bits from
an on state to an off state. For all other cases of low
voltage ICSP, the part may be programmed at the nor-
mal operating voltage. This means unique user IDs, or
user code can be reprogrammed or added.
 2003 Microchip Technology Inc.
Advance Information
DS39609A-page 257