PIC18(L)F2X/4XK22
28/40/44-Pin, Low-Power, High-Performance
Microcontrollers with XLP Technology
High-Performance RISC CPU:
• C Compiler Optimized Architecture:
- Optional extended instruction set designed to
optimize re-entrant code
• Up to 1024 Bytes Data EEPROM
• Up to 64 Kbytes Linear Program Memory
Addressing
• Up to 3896 Bytes Linear Data Memory Address-
ing
• Up to 16 MIPS Operation
• 16-bit Wide Instructions, 8-bit Wide Data Path
• Priority Levels for Interrupts
• 31-Level, Software Accessible Hardware Stack
• 8 x 8 Single-Cycle Hardware Multiplier
eXtreme Low-Power Features (XLP)
(PIC18(L)F2X/4XK22):
•
•
•
•
Sleep mode: 20 nA, typical
Watchdog Timer: 300 nA, typical
Timer1 Oscillator: 800 nA @ 32 kHz
Peripheral Module Disable
Special Microcontroller Features:
•
•
•
•
2.3V to 5.5V Operation – PIC18FXXK22 devices
1.8V to 3.6V Operation – PIC18LFXXK22 devices
Self-Programmable under Software Control
High/Low-Voltage Detection (HLVD) module:
- Programmable 16-Level
- Interrupt on High/Low-Voltage Detection
Programmable Brown-out Reset (BOR):
- With software enable option
- Configurable shutdown in Sleep
Extended Watchdog Timer (WDT):
- Programmable period from 4 ms to 131s
In-Circuit Serial Programming™ (ICSP™):
- Single-Supply 3V
In-Circuit Debug (ICD)
Flexible Oscillator Structure:
• Precision 16 MHz Internal Oscillator Block:
- Factory calibrated to ± 1%
- Selectable frequencies, 31 kHz to 16 MHz
- 64 MHz performance available using PLL –
no external components required
• Four Crystal modes up to 64 MHz
• Two External Clock modes up to 64 MHz
• 4X Phase Lock Loop (PLL)
• Secondary Oscillator using Timer1 @ 32 kHz
• Fail-Safe Clock Monitor:
- Allows for safe shutdown if peripheral clock
stops
- Two-Speed Oscillator Start-up
•
•
•
•
Peripheral Highlights:
• Up to 35 I/O Pins plus 1 Input-Only Pin:
- High-Current Sink/Source 25 mA/25 mA
- Three programmable external interrupts
- Four programmable interrupt-on-change
- Nine programmable weak pull-ups
- Programmable slew rate
• SR Latch:
- Multiple Set/Reset input options
• Two Capture/Compare/PWM (CCP) modules
• Three Enhanced CCP (ECCP) modules:
- One, two or four PWM outputs
- Selectable polarity
- Programmable dead time
- Auto-Shutdown and Auto-Restart
- PWM steering
• Two Master Synchronous Serial Port (MSSP)
modules:
- 3-wire SPI (supports all 4 modes)
- I
2
C Master and Slave modes with address
mask
Analog Features:
• Analog-to-Digital Converter (ADC) module:
- 10-bit resolution, up to 30 external channels
- Auto-acquisition capability
- Conversion available during Sleep
- Fixed Voltage Reference (FVR) channel
- Independent input multiplexing
• Analog Comparator module:
- Two rail-to-rail analog comparators
- Independent input multiplexing
• Digital-to-Analog Converter (DAC) module:
- Fixed Voltage Reference (FVR) with 1.024V,
2.048V and 4.096V output levels
- 5-bit rail-to-rail resistive DAC with positive
and negative reference selection
• Charge Time Measurement Unit (CTMU) module:
- Supports capacitive touch sensing for touch
screens and capacitive switches
2010-2016 Microchip Technology Inc.
DS40001412G-page 1
PIC18(L)F2X/4XK22
• Two Enhanced Universal Synchronous
Asynchronous Receiver Transmitter (EUSART)
modules:
- Supports RS-485, RS-232 and LIN
- RS-232 operation using internal oscillator
- Auto-Wake-up on Break
- Auto-Baud Detect
TABLE 1:
PIC18(L)F2X/4XK22 FAMILY TYPES
10-bit
A/D Channels
(2)
ECCP
(Half-Bridge)
ECCP
(Full-Bridge)
16-bit Timer
4
4
4
4
4
4
4
4
Comparator
8-bit Timer
3
3
3
3
3
3
3
3
Program
Memory
# Single-Word
Instructions
Flash
(Bytes)
Data
Memory
I/O
(1)
EEPROM
(Bytes)
SRAM
(Bytes)
MSSP
BOR/LVD
Y
Y
Y
Y
Y
Y
Y
Y
SR Latch
Y
Y
Y
Y
Y
Y
Y
Y
EUSART
CTMU
Y
Y
Y
Y
Y
Y
Y
Y
CCP
Device
SPI
2
2
2
2
2
2
2
2
PIC18(L)F23K22
PIC18(L)F24K22
PIC18(L)F25K22
PIC18(L)F26K22
PIC18(L)F43K22
PIC18(L)F44K22
PIC18(L)F45K22
PIC18(L)F46K22
Note 1:
2:
8K
16K
32K
64k
8K
16K
32K
64k
4096
8192
16384
32768
4096
8192
16384
32768
512
768
1536
3896
512
768
1536
3896
256
256
256
1024
256
256
256
1024
25
25
25
25
36
36
36
36
19
19
19
19
30
30
30
30
2
2
2
2
2
2
2
2
1
1
1
1
2
2
2
2
2
2
2
2
1
1
1
1
I
2
C
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
One pin is input only.
Channel count includes internal FVR and DAC channels.
DS40001412G-page 2
2010-2016 Microchip Technology Inc.
PIC18(L)F2X/4XK22
FIGURE 1:
28-PIN PDIP, SOIC, SSOP DIAGRAM
MCLR/V
PP
/RE3
RA0
RA1
RA2
RA3
RA4
RA5
V
SS
RA7
RA6
RC0
RC1
RC2
RC3
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
FIGURE 2:
28-PIN QFN, UQFN
(1)
DIAGRAM
RA2
RA3
RA4
RA5/
V
SS
RA7
RA6
28 27 26 25 24 23 22
1
2
3
4
PIC18(L)F2XK22
5
6
7
8 9 10 11 12 13 14
RC0
RC1
RC2
RC3
RC4
RC5
RC6
RA1
RA0
MCLR/V
PP
/RE3
RB7/PGD
RB6/PGC
RB5
RB4
21
20
19
18
17
16
15
PIC18(L)F2XK22
RB3
RB2
RB1
RB0
V
DD
V
SS
RC7
Note
1:
The 28-pin UQFN package is available only for PIC18(L)F23K22 and PIC18(L)F24K22.
2010-2016 Microchip Technology Inc.
DS40001412G-page 3
PIC18(L)F2X/4XK22
FIGURE 3:
40-PIN PDIP DIAGRAM
MCLR/V
PP
/RE3
RA0
RA1
RA2
RA3
RA4
RA5
RE0
RE1
RE2
V
DD
V
SS
RA7
RA6
RC0
RC1
RC2
RC3
RD0
RD1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
22
21
RB7/PGD
RB6/PGC
RB5
RB4
RB3
RB2
RB1
RB0
V
DD
V
SS
RD7
RD6
RD5
RD4
RC7
RC6
RC5
RC4
RD3
RD2
FIGURE 4:
40-PIN UQFN DIAGRAM
40
39
38
37
36
35
34
33
32
31
RC6
RC5
RC4
RD3
RD2
RD1
RD0
RC3
RC2
RC1
RC7
RD4
RD5
RD6
RD7
V
SS
V
DD
RB0
RB1
RB2
1
2
3
4
5
PIC18(L)F4XK22
6
7
8
9
10
RB3
RB4
RB5
PGC/RB6
PGD/RB7
MCLR/V
PP
/RE3
RA0
RA1
RA2
RA3
11
12
13
14
15
16
17
18
19
20
30
29
28
27
26
25
24
23
22
21
RC0
RA6
RA7
V
SS
V
DD
RE2
RE1
RE0
RA5
RA4
PIC18(L)F4XK22
DS40001412G-page 4
2010-2016 Microchip Technology Inc.
PIC18(L)F2X/4XK22
FIGURE 5:
44-PIN TQFP DIAGRAM
44
43
42
41
40
39
38
37
36
35
34
RC6
RC5
RC4
RD3
RD2
RD1
RD0
RC3
RC2
RC1
NC
RC7
RD4
RD5
RD6
RD7
V
SS
V
DD
RB0
RB1
RB2
RB3
1
2
3
4
5
6
PIC18(L)F4XK22
7
8
9
10
11
33
32
31
30
29
28
27
26
25
24
23
NC
RC0
RA6
RA7
V
SS
V
DD
RE2
RE1
RE0
RA5
RA4
FIGURE 6:
44-PIN QFN DIAGRAM
RC7
RD4
RD5
RD6
RD7
V
SS
V
DD
V
DD
RB0
RB1
RB2
1
2
3
4
5
6
PIC18(L)F4XK22
7
8
9
10
11
2010-2016 Microchip Technology Inc.
RB3
NC
RB4
RB5
PGC/RB6
PGD/RB7
MCLR/V
PP
/RE3
RA0
RA1
RA2
RA3
44
43
42
41
40
39
38
37
36
35
34
RC6
RC5
RC4
RD3
RD2
RD1
RD0
RC3
RC2
RC1
RC0
33 RA6
32 RA7
31 V
SS
30 V
SS
29 V
DD
28 V
DD
27 RE2
26 RE1
25 RE0
24 RA5
23 RA4
22
21
20
19
18
17
16
15
14
13
12
NC
NC
RB4
RB5
PGC/RB6
PGD/RB7
MCLR/V
PP
/RE3
RA0
RA1
RA2
RA3
22
21
20
19
18
17
16
15
14
13
12
DS40001412G-page 5