Document
PIC18F2XK20/4XK20
28/40/44-Pin Flash 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 3936 bytes Linear Data Memory Addressing • 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
Flexible Oscillator Structure
• Precision 16 MHz Internal Oscillator Block: - Factory calibrated to ± 1% - Software selectable frequencies range of 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
Special Microcontroller Features
• Operating Voltage Range: 1.8V to 3.6V • Self-Programmable under Software Control • Programmable 16-Level High/Low-Voltage
Detection (HLVD) module: - Interrupt on High/Low-Voltage Detection • Programmable Brown-out Reset (BOR): - With software enable option • Extended Watchdog Timer (WDT): - Programmable period from 4 ms to 131s • Single-Supply 3V In-Circuit Serial Programming™ (ICSP™) via Two Pins • In-Circuit Debug (ICD) via Two Pins
Extreme Low-Power Management with XLP
• Sleep Mode: < 100 nA @ 1.8V • Watchdog Timer: < 800 nA @ 1.8V • Timer1 Oscillator: < 800 nA @ 32 kHz and 1.8V
Analog Features
• Analog-to-Digital Converter (ADC) Module: - 10-bit resolution, 13 External Channels - Auto-acquisition capability - Conversion available during Sleep - 1.2V Fixed Voltage Reference (FVR) channel - Independent input multiplexing
• Analog Comparator Module: - Two rail-to-rail analog comparators - Independent input multiplexing
• Voltage Reference (CVREF) Module - Programmable (% VDD), 16 steps - Two 16-level voltage ranges using VREF pins
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 - Eight programmable weak pull-ups - Programmable slew rate
• Capture/Compare/PWM (CCP) Module • Enhanced CCP (ECCP) module:
- One, two or four PWM outputs - Selectable polarity - Programmable dead time - Auto-shutdown and auto-restart • Master Synchronous Serial Port (MSSP) Module - 3-wire SPI (supports all four modes) - I2C™ Master and Slave modes with address
mask • Enhanced Universal Synchronous Asynchronous
Receiver Transmitter (EUSART) Module: - Supports RS-485, RS-232 and LIN - RS-232 operation using internal oscillator - Auto-Wake-up on Break - Auto-Baud Detect
2010-2015 Microchip Technology Inc.
DS40001303H-page 1
PIC18F2XK20/4XK20
-
PIC18F2XK20/4XK20 Family Types
EUSART
Device
Program Memory
Data Memory
Flash # Single-Word SRAM EEPROM I/O(1)
(bytes) Instructions (bytes) (bytes)
10-bit
A/D (ch)(2)
CCP/ ECCP (PWM)
MSSP
SPI
Master I2C™
Comp.
Timers 8/16-bit
PIC18F23K20 8K
4096
512
256
25
11
1/1
Y
Y
1
2
1/3
PIC18F24K20 16K
8192
768
256
25
11
1/1
Y
Y
1
2
1/3
PIC18F25K20 32K
16384
1536
256
25
11
1/1
Y
Y
1
2
1/3
PIC18F26K20 64k
32768
3936 1024 25
11
1/1
Y
Y
1
2
1/3
PIC18F43K20 8K
4096
512
256
36
14
1/1
Y
Y
1
2
1/3
PIC18F44K20 16K
8192
768
256
36
14
1/1
Y
Y
1
2
1/3
PIC18F45K20 32K
16384
1536
256
36
14
1/1
Y
Y
1
2
1/3
PIC18F46K20 64k
32768
3936 1024 36
14
1/1
Y
Y
1
2
1/3
Note 1: One pin is input-only. 2: Channel count includes internal Fixed Voltage Reference channel.
Note: For other small form-factor package availability and marking information, please visit http://www.microchip.com/packaging or contact your local sales office.
DS40001303H-page 2
2010-2015 Microchip Technology Inc.
Pin Diagrams
FIGURE 1:
Note:
28-PIN SPDIP, SOIC, SSOP
MCLR/VPP/RE3 1 AN0/C12IN0-/RA0 2 AN1/C12IN1-/RA1 3 AN2/VREF-/CVREF/C2IN+/RA2 4 AN3/VREF+/C1IN+/RA3 5 T0CKI/C1OUT/RA4 6 AN4/SS/HLVDIN/C2OUT/RA5 7
VSS 8 OSC1/CLKIN/RA7 9 OSC2/CLKOUT/RA6 10 T1OSO/T13CKI/RC0 11 T1OSI/CCP2(1)/RC1 12
CCP1/P1A/RC2 13 SCK/SCL/RC3 14
See Table 1 for pin allocation table.
FIGURE 2:
28-PIN QFN/UQFN
PIC18F23K20 PIC18F24K20 PIC18F25K20 PIC18F26K20
PIC18F2XK20/4XK20
28 RB7/KBI3/PGD 27 RB6//KBI2/PGC 26 RB5/KBI1/PGM 25 RB4/KBI0/AN11/P1D 24 RB3/AN9/C12IN2-/CCP2(1) 23 RB2/INT2/AN8/P1B 22 RB1/INT1/AN10/C12IN3-/P1C 21 RB0/INT0/FLT0/AN12 20 VDD 19 VSS 18 RC7/RX/DT 17 RC6/TX/CK 16 RC5/SDO 15 RC4/SDI/SDA
RA1/AN1/C12IN1RA0/AN0/C12IN0RE3/MCLR/VPP RB7/KBI3/PGD RB6/KBI2/PGC RB5/KBI1/PGM RB4/KBI0/AN11/P1D
AN2/VREF-/CVREF/C2IN+/RA2 1 AN3/VREF+/C1IN+/RA3 2 T0CKI/C1OUT/RA4 3
AN4/SS/HLVDIN/C2OUT/RA5 4 VSS 5
O.