Datasheet
2002 Microchip Technology Inc. Preliminary DS39598C-page 101
PIC16F818/819
12.17 In-Circuit Serial Programming
PIC16F818/819 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 12-10 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.
For general information of serial programming, please
refer to the In-Circuit Serial Programming™ (ICSP™)
Guide (DS30277).
FIGURE 12-10: TYPICAL IN-CIRCUIT
SERIAL PROGRAMMING
CONNECTION
12.18 Low Voltage ICSP Programming
The LVP bit of the configuration word enables low volt-
age ICSP programming. This mode allows the micro-
controller to be programmed via ICSP using a V
DD
source in the operating voltage range. This only means
that V
PP does not have to be brought to VIHH, but can
instead be left at the normal operating voltage. In this
mode, the RB3/PGM pin is dedicated to the program-
ming function and ceases to be a general purpose I/O
pin. During programming, V
DD is applied to the MCLR
pin. To enter Programming mode, VDD must be applied
to the RB3/PGM, provided the LVP bit is set. The LVP
bit defaults to on (‘1’) from the factory.
If Low Voltage Programming mode is not used, the LVP
bit can be programmed to a '0' and RB3/PGM becomes
a digital I/O pin. However, the LVP bit may only be pro-
grammed when programming is entered with V
IHH on
MCLR
. The LVP bit can only be charged when using
high voltage on MCLR
.
It should be noted, that once the LVP bit is programmed
to 0, only the High Voltage Programming mode is avail-
able and only High Voltage Programming mode can be
used to program the device.
When using low voltage ICSP, the part must be supplied
at 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 off-state. For all other cases of low voltage
ICSP, the part may be programmed at the normal oper-
ating voltage. This means calibration values, unique
user IDs, or user code can be reprogrammed or added.
External
Connector
Signals
To No r m a l
Connections
To N orm a l
Connections
PIC16F818/819
V
DD
VSS
MCLR/VPP
RB6
RB7
+5V
0V
V
PP
CLK
Data I/O
VDD
* * *
*
* Isolation devices (as required).
†
RB3 only used in LVP mode.
RB3
†
To Programmer
Note 1: The High Voltage Programming mode is
always available, regardless of the state
of the LVP bit, by applying V
IHH to the
MCLR
pin.
2: While in Low Voltage ICSP mode, the
RB3 pin can no longer be used as a
general purpose I/O pin.
3: When using Low Voltage ICSP Program-
ming (LVP) and the pull-ups on PORTB
are enabled, bit 3 in the TRISB register
must be cleared to disable the pull-up on
RB3 and ensure the proper operation of
the device.
4: RB3 should not be allowed to float if LVP
is enabled. An external pull-down device
should be used to default the device to
normal Operating mode. If RB3 floats
high, the PIC16F818/819 device will
enter Programming mode.
5: LVP mode is enabled by default on all
devices shipped from Microchip. It can be
disabled by clearing the LVP bit in the
CONFIG register.
6: Disabling LVP will provide maximum
compatibility to other PIC16CXXX devices.