PIC18(L)F2X/4XK50
Flash Memory Programming Specification
1.0
DEVICE OVERVIEW
Note 1:
The High-Voltage ICSP mode is always
available, regardless of the state of the
LVP bit, by applying V
IHH
to the MCLR/
V
PP
/RE3 pin.
2:
While in Low-Voltage ICSP mode, MCLR
is always enabled, regardless of the
MCLRE bit, and the RE3 pin can no
longer be used as a general purpose
input.
This
document
includes
the
programming
specifications for the following devices:
• PIC18F24K50
• PIC18F25K50
• PIC18F26K50
• PIC18F45K50
• PIC18F46K50
• PIC18LF24K50
• PIC18LF25K50
• PIC18LF26K50
• PIC18LF45K50
• PIC18LF46K50
2.0
PROGRAMMING OVERVIEW
2.2
The PIC18(L)F2X/4XK50 devices can be programmed
using either the high-voltage In-Circuit Serial
Programming™ (ICSP™) method or the low-voltage
ICSP method. Both methods can be done with the
device in the users’ system. The low-voltage ICSP
method is slightly different than the high-voltage
method and these differences are noted where
applicable. This programming specification applies to
the PIC18(L)F2X/4XK50 devices in all package types.
Dedicated ICSP/ICD Port (44-Pin
TQFP Only)
2.1
Hardware Requirements
In High-Voltage ICSP mode, the PIC18(L)F2X/4XK50
devices require two programmable power supplies:
one for V
DD
and one for MCLR/V
PP
/RE3. Both supplies
should have a minimum resolution of 0.25V. Refer to
Section 6.0
“AC/DC
Characteristics
Timing
Requirements for Program/Verify Test Mode”
for
additional information.
The PIC18F45K50/46K50 44-pin TQFP devices are
designed to support an alternate programming input:
the dedicated ICSP/ICD port. The primary purpose of
this port is to provide an alternate In-Circuit Debugging
(ICD) option and free the pins (RB6, RB7 and MCLR)
that would normally be used for debugging the
application. In conjunction with ICD capability,
however, the dedicated ICSP/ICD port also provides an
alternate port for ICSP. Setting the ICPRT
Configuration bit enables the dedicated ICSP/ICD port.
The dedicated ICSP/ICD port functions the same as
the default ICSP/ICD port; however, alternate pins are
used instead. Table 2-2 identifies the functionally
equivalent pins for ICSP purposes: The dedicated
ICSP/ICD port is an alternate port. Thus, ICSP is still
available through the default port even though the
ICPRT Configuration bit is set.
2.1.1
LOW-VOLTAGE ICSP
PROGRAMMING
Note:
In Low-Voltage ICSP mode, the PIC18(L)F2X/4XK50
devices can be programmed using a single V
DD
source
in the operating range. The MCLR/V
PP
/RE3 does not
have to be brought to a different voltage, but can
instead be left at the normal operating voltage. Refer to
Section 2.7 “Entering and Exiting Low-Voltage
ICSP Program/Verify Mode”
for additional hardware
parameters.
The ICPRT Configuration bit can only be
programmed through the default ICSP port.
By default the ICPORT Configuration bit is
enabled. When the ICPRT Configuration bit
is cleared (dedicated ICSP/ICD port is
disabled), the ICDPORTS pin should be
tied to either V
DD
or V
SS
on 44 TQFP
packages only. The ICPRT Configuration
bit must be maintained clear for all 28-pin
and 40-pin devices; otherwise, unexpected
operation may occur.
2012 Microchip Technology Inc.
DS41630B-page 1
PIC18(L)F2X/4XK50
2.2.1
ICPORT DISABLED
2.3
Pin Diagrams
Clearing the ICPRT bit in CONFIG4L disables the use
of the dedicated port function and leaves the dedicated
pins
floating.
High-voltage
and
low-voltage
programming are performed using the MCLR/V
PP
,
PGC and PGD pins as normal. This is otherwise known
as the legacy interface mode, using the standard
interface pins.
The pin diagrams for the PIC18(L)F2X/4XK50 family
are shown in Figures
2-1
through
2-4.
2.2.2
ICPORT ENABLED
Setting the ICPRT bit in CONFIG4L enables the use of
the dedicated port function through the dedicated pins.
This is the default setting for the ICPRT bit upon start-
up or Reset. When using devices in packages other
than the 44-pin TQFP, the ICPRT bit must be cleared.
The standard interface pins will remain operational,
even after the dedicated pins are enabled, unless the
user assigns another function to them in firmware. If
another function is not assigned to the standard pins
and both sets of pins remain operable for program-
ming, whichever high-voltage entry pin (the standard
V
PP
pin or the dedicated ICDV
PP
pin) is activated first
will take priority.
For high-voltage programming, if high-voltage is
detected on the ICDV
PP
pin first, the standard MCLR/
V
PP
pin will be ignored and programming must be
performed using the ICDPGC and ICDPGD pins. If
high-voltage is detected on the MCLR/V
PP
pin first, the
dedicated ICDV
PP
pin will be ignored and programming
must be performed using the PGC and PGD pins.
These same rules apply to the low-voltage
programming sequence.
TABLE 2-1:
PIN DESCRIPTIONS (DURING PROGRAMMING): PIC18(L)F2X/4XK50
During Programming
Pin Name
Pin
MCLR/V
PP
/RE3
V
DD
(1)
V
SS
(1)
RB6
RB7
ICDRST/ICDVPP
(2)
Pin Type
P
P
P
I
I/O
P
I
I/O
Pin Description
Programming Enable
Power Supply
Ground
Serial Clock
Serial Data
Programming Enable
Serial Clock
Serial Data
V
PP
V
DD
V
SS
PGC
PGD
V
PP
PGC
PGD
ICDCLK/ICDPGC
ICDDAT/ICDPGD
(2)
Legend:
I = Input, O = Output, P = Power
Note 1:
All power supply (V
DD
) and ground (V
SS
) pins must be connected.
2:
Dedicated ICSP/ICD Port available on 44-pin TQFP only when the ICPRT bit in CONFIG4L is enabled.
DS41630B-page 2
2012 Microchip Technology Inc.
PIC18(L)F2X/4XK50
FIGURE 2-1:
SDIP, SSOP, SOIC
MCLR/V
PP
/RE3
RA0
RA1
RA2
RA3
RA4
RA5
V
SS
RA7
RA6
RC0
RC1
RC2
V
USB3V3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
28
27
26
25
24
23
22
21
20
19
18
17
16
15
RB7/PGD
RB6/PGC
RB5
RB4
RB3
RB2
RB1
RB0
V
DD
V
SS
RC7
RC6
RC5
RC4
28-PIN SDIP, SSOP AND SOIC PIN DIAGRAMS
Note:
The following devices are included in 28-pin SDIP, SSOP and SOIC parts: PIC18F24K50, PIC18LF24K50,
PIC18F25K50, PIC18LF25K50, PIC18F26K50, PIC18LF26K50.
FIGURE 2-2:
28-Pin QFN
28-PIN QFN PIN DIAGRAMS
MCLR/V
PP
/RE3
RB7/PGD
RB6/PGC
RB5
RB4
21
20
19
18
17
16
15
28 27 26 25 24 23 22
RA2
RA3
RA4
RA5
V
SS
RA7
RA6
1
2
3
4
5
6
7
RB3
RB2
RB1
RB0
V
DD
V
SS
RC7
8 9 10 11 12 13 14
RA1
RA0
Note 1:
2012 Microchip Technology Inc.
PIC18F2XK50
PIC18F2XK50
RC0
RC1
RC2
The following devices are included in 28-pin QFN parts: PIC18F24K50, PIC18LF24K50, PIC18F25K50,
PIC18LF25K50, PIC18F26K50, PIC18LF26K50.
V
USB3V3
RC4
RC5
RC6
DS41630B-page 3