PIC18(L)F1XK50
20-Pin USB Flash Microcontrollers with XLP Technology
Universal Serial Bus Features
• USB V2.0 Compliant SIE
• Full Speed (12 Mb/s) and Low Speed (1.5 Mb/s)
• Supports Control, Interrupt, Isochronous and
Bulk Transfers
• Supports up to 16 Endpoints (8 bidirectional)
• 256-byte Dual Access RAM for USB
• Input-Change Interrupt on D+/D- for Detecting
Physical Connection to USB Host
Extreme Low-Power Management
PIC18LF1XK50 with XLP Technology
• Sleep mode: 24 nA
• Watchdog Timer: 450 nA
• Timer1 Oscillator: 790 nA @ 32 kHz
Analog Features
• Analog-to-Digital Converter (ADC) module:
- 10-bit resolution, nine external channels
- Auto acquisition capability
- Conversion available during Sleep
- Internal 1.024V Fixed Voltage Reference
(FVR) channel
- Independent input multiplexing
• Dual Analog Comparators:
- Rail-to-rail operation
- Independent input multiplexing
• Voltage Reference module:
- Programmable (% of V
DD
), 16 steps
- Two 16-level voltage ranges using V
REF
pins
- Programmable Fixed Voltage Reference
(FVR), 3 levels
• On-Chip 3.2V LDO Regulator – PIC18F1XK50
High-Performance RISC CPU
• C Compiler Optimized Architecture:
- Optional extended instruction set designed to
optimize re-entrant code
- 256 bytes, data EEPROM
- Up to 16 Kbytes linear program memory
addressing
- Up to 768 bytes linear data memory
addressing
• Priority Levels for Interrupts
• 8 x 8 Single-Cycle Hardware Multiplier
Flexible Oscillator Structure
• CPU Divider to Run the Core Slower than the
USB Peripheral
• 16 MHz Internal Oscillator Block:
- Software selectable frequencies, 31 kHz to
16 MHz
- Provides a complete range of clock speeds
from 31 kHz to 32 MHz when used with PLL
- User tunable to compensate for frequency
drift
• Four Crystal modes, up to 48 MHz
• External Clock modes, up to 48 MHz
• 4X Phase Lock Loop (PLL)
• Secondary Oscillator using Timer1 at 32 kHz
• Fail-Safe Clock Monitor:
- Allows for safe shutdown if primary or
secondary oscillator stops
• Two-Speed Oscillator Start-Up
Peripheral Highlights
• 14 I/O Pins plus 1 Input-Only Pin:
- High-current sink/source 25 mA/25 mA
- Seven programmable weak pull-ups
- Seven programmable interrupt-on-change
pins
- Three programmable external interrupts
- Programmable slew rate
• Enhanced Capture/Compare/PWM (ECCP)
module:
- One, two, three, 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)
- I
2
C™ Master and Slave modes (Slave mode
address masking)
• Enhanced Universal Synchronous Asynchronous
Receiver Transmitter (EUSART) module:
- Supports RS-485, RS-232 and LIN 2.0
- RS-232 operation using internal oscillator
- Auto-Baud Detect
- Auto-Wake-up on Break
• SR Latch mode
Special Microcontroller Features
Full 5.5V Operation – PIC18F1XK50
1.8V-3.6V Operation – PIC18LF1XK50
Self-Programmable under Software Control
Programmable Brown-out Reset (BOR):
- With software enable option
• Extended Watchdog Timer (WDT):
- Programmable period from 4ms to 131s
• Single-Supply 3V In-Circuit Serial Programming™
(ICSP™) via Two Pins
•
•
•
•
2008-2015 Microchip Technology Inc.
DS40001350F-page 1
PIC18(L)F1XK50
PIC18(L)F1XK50 Family Types
Data Sheet Index
Program
Memory
# Single-Word
Instructions
Flash
(bytes)
Data Memory
10-bit
A/D (ch)
(2)
ECCP
(PWM)
I/O
(1)
MSSP
EUSART
Timers
8/16-bit
1/3
1/3
Comp.
USB
Y
Y
SRAM
(bytes)
PIC18F13K50/
(A)
PIC18LF13K50
PIC18F14K50/
(A)
PIC18LF14K50
Note 1:
2:
3:
A.
8K
16K
4096
8192
512
(3)
768
(3)
256
256
15
15
11
11
1
1
Y
Y
Master
I
2
C™
Y
Y
Device
EEPROM
(bytes)
SPI
1
1
2
2
One pin is input only.
Channel count includes internal Fixed Voltage Reference (FVR) and Programmable Voltage Reference (CV
REF
) channels.
Includes the dual port RAM used by the USB module which is shared with the data memory.
DS40001350
PIC18(L)F1XK50 Data Sheet, 20-Pin USB Flash Microcontrollers with XLP Technology.
Data Sheet Index:
(Unshaded devices are described in this document)
Note:
For other small form-factor package availability and marking information, please visit
http://www.microchip.com/packaging
or contact your local sales office.
DS40001350F-page 2
2008-2015 Microchip Technology Inc.
PIC18(L)F1XK50
Pin Diagrams
FIGURE 1:
20-PIN PDIP, SSOP, SOIC (300 MIL)
V
DD
IOCA5/OSC1/CLKIN/RA5
AN3/IOCA3/OSC2/CLKOUT/RA4
IOCA3/MCLR/V
PP
/RA3
CCP1/P1A/T0CKI/RC5
P1B/C12OUT/SRQ/RC4
N7/P1C/C12IN3-/PGM/RC3
AN8/SS/T13CKI/T1OSCI/RC6
AN9/SDO/T1OSCO/RC7
IOCB7/TX/CK/RB7
1
2
3
4
5
6
7
8
9
10
20
19
18
17
16
15
14
13
12
11
V
SS
RA0/IOCA0/D+/PGD
RA1/IOCA1/D-/PGC
V
USB
RC0/AN4/C12IN+/INT0/V
REF
+
RC1/AN5/C12IN1-/INT1/V
REF
-
RC2/AN6/P1D/C12IN2-/CV
REF
/INT2
RB4/AN10/IOCB4/SDI/SDA
RB5/AN11/IOCB5/RX/DT
RB6/IOCB6/SCK/SCL
Note:
See
Table 1
for location of all peripheral functions.
FIGURE 2:
20-PIN QFN (5X5)
RA4/AN3/IOCA4/OSC2/CLKO
RA5/IOCA5/OSC1/CLKI
V
DD
Vss
RA0/IOCA0/D+/PGD
20 19 18 17 16
IOCA3/MCLR/V
PP
/RA3
CCP1/P1A/T0CKI/RC5
P1B/C12OUT/SRQ/RC4
AN7/P1C/C12IN3-/PGM/RC3
AN8/SS/T13CKI/T1OSCI/RC6
1
2
3
4
5
15
14
13
12
11
RA1/IOCA1/D-/PGC
V
USB
RC0/AN4/C12IN+/INT0/V
REF
+
RC1/AN1/C12IN1-/INT1/V
REF
-
RC2/AN6/P1D/C12IN2-/CV
REF
/INT2
PIC18(L)F1XK50
6 7 8 9 10
AN9/SDO/T1OSCO/RC7
IOCB7/TX/CK/RB7
IOCB6/SCK/SCL/RB6
IOCB5/AN11/RX/DT/RB5
IOCB4/AN10/SDI/SDA/RB4
Note:
See
Table 1
for location of all peripheral functions.
2008-2015 Microchip Technology Inc.
PIC18(L)F1XK50
DS40001350F-page 3
PIC18(L)F1XK50
TABLE 1:
20-Pin PDIP/SSOP/SOIC
20-PIN ALLOCATION TABLE (PIC18(L)F1XK50)
Comparator
20-Pin QFN
Reference
Interrupts
EUSART
Analog
Pull-up
Timers
MSSP
ECCP
RA0
RA1
RA3
RA4
RA5
RB4
RB5
RB6
RB7
RC0
RC1
RC2
RC3
RC4
RC5
RC6
RC7
V
USB
V
DD
V
SS
Note
(1)
19
18
4
3
2
13
12
11
10
16
15
14
7
6
5
8
9
17
1
20
1:
16
15
1
20
19
10
9
8
7
13
12
11
4
3
2
5
6
14
18
17
—
—
—
AN3
—
AN10
AN11
—
—
AN4
AN5
AN6
AN7
—
—
AN8
AN9
—
—
—
—
—
—
—
—
—
—
—
—
C12IN+
C12IN1-
C12IN2-
C12IN3-
C12OUT
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
V
REF
+
V
REF
-
CV
REF
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
P1D
P1C
P1B
CCP1/P1A
—
—
—
—
—
—
—
—
—
—
—
RX/DT
—
TX/CK
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
SDI/SDA
—
SCL/SCK
—
—
—
—
—
—
—
SS
SDO
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
T0CKI
T13CKI/T1OSCI
T1OSCO
—
—
—
IOCA0
IOCA1
IOCA3
IOCA4
IOCA5
IOCB4
IOCB5
IOCB6
IOCB7
INT0
INT1
INT2
—
—
—
—
—
—
—
—
—
—
Y
Y
Y
Y
Y
Y
Y
—
—
—
—
—
—
—
—
—
—
D+
D-
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
V
USB
—
—
PGD
PGC
MCLR/V
PP
OSC2/CLKOUT
OSC1/CLKIN
—
—
—
—
—
—
—
PGM
SRQ
—
—
—
—
V
DD
V
SS
Input only.
DS40001350F-page 4
2008-2015 Microchip Technology Inc.
Basic
USB
I/O
PIC18(L)F1XK50
Table of Contents
1.0 Device Overview .......................................................................................................................................................................... 7
2.0 Oscillator Module) ...................................................................................................................................................................... 13
3.0 Memory Organization ................................................................................................................................................................. 27
4.0 Flash Program Memory.............................................................................................................................................................. 49
5.0 Data EEPROM Memory ............................................................................................................................................................. 58
6.0 8 x 8 Hardware Multiplier............................................................................................................................................................ 62
7.0 Interrupts .................................................................................................................................................................................... 64
8.0 Low Dropout (LDO) Voltage Regulator ...................................................................................................................................... 77
9.0 I/O Ports ..................................................................................................................................................................................... 78
10.0 Timer0 Module ........................................................................................................................................................................... 96
11.0 Timer1 Module ........................................................................................................................................................................... 99
12.0 Timer2 Module ......................................................................................................................................................................... 104
13.0 Timer3 Module ......................................................................................................................................................................... 107
14.0 Enhanced Capture/Compare/PWM (ECCP) Module................................................................................................................ 111
15.0 Master Synchronous Serial Port (MSSP) Module .................................................................................................................... 133
16.0 Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART) ............................................................... 175
17.0 Analog-to-Digital Converter (ADC) Module .............................................................................................................................. 202
18.0 Comparator Module.................................................................................................................................................................. 215
19.0 Power-Managed Modes ........................................................................................................................................................... 227
20.0 SR Latch................................................................................................................................................................................... 233
21.0 Voltage References.................................................................................................................................................................. 236
22.0 Universal Serial Bus (USB) ...................................................................................................................................................... 241
23.0 Reset ........................................................................................................................................................................................ 267
24.0 Special Features of the CPU.................................................................................................................................................... 280
25.0 Instruction Set Summary .......................................................................................................................................................... 297
26.0 Development Support............................................................................................................................................................... 347
27.0 Electrical Specifications............................................................................................................................................................ 351
28.0 DC and AC Characteristics Graphs and Charts ....................................................................................................................... 385
29.0 Packaging Information.............................................................................................................................................................. 398
Appendix A: Revision History............................................................................................................................................................. 408
Appendix B: Device Differences ........................................................................................................................................................ 409
The Microchip Web Site ..................................................................................................................................................................... 410
Customer Change Notification Service .............................................................................................................................................. 410
Customer Support .............................................................................................................................................................................. 410
Product Identification System ............................................................................................................................................................ 411
2008-2015 Microchip Technology Inc.
DS40001350F-page 5