Datasheet
2009-2018 Microchip Technology Inc. DS30009960F-page 5
PIC18F87K22 FAMILY
Table of Contents
1.0 Device Overview .......................................................................................................................................................................... 7
2.0 Guidelines for Getting Started with PIC18FXXKXX Microcontrollers ......................................................................................... 35
3.0 Oscillator Configurations ............................................................................................................................................................ 40
4.0 Power-Managed Modes ............................................................................................................................................................. 54
5.0 Reset .......................................................................................................................................................................................... 69
6.0 Memory Organization ................................................................................................................................................................. 83
7.0 Flash Program Memory............................................................................................................................................................ 107
8.0 External Memory Bus ............................................................................................................................................................... 117
9.0 Data EEPROM Memory ........................................................................................................................................................... 128
10.0 8 x 8 Hardware Multiplier.......................................................................................................................................................... 134
11.0 Interrupts .................................................................................................................................................................................. 136
12.0 I/O Ports ................................................................................................................................................................................... 160
13.0 Timer0 Module ......................................................................................................................................................................... 187
14.0 Timer1 Module ......................................................................................................................................................................... 190
15.0 Timer2 Module ......................................................................................................................................................................... 202
16.0 Timer3/5/7 Modules.................................................................................................................................................................. 204
17.0 Timer4/6/8/10/12 Modules........................................................................................................................................................ 216
18.0 Real-Time Clock and Calendar (RTCC)................................................................................................................................... 219
19.0 Capture/Compare/PWM (CCP) Modules ................................................................................................................................. 236
20.0 Enhanced Capture/Compare/PWM (ECCP) Module................................................................................................................ 249
21.0 Master Synchronous Serial Port (MSSP) Module .................................................................................................................... 272
22.0 Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART) ............................................................... 318
23.0 12-Bit Analog-to-Digital Converter (A/D) Module ..................................................................................................................... 342
24.0 Comparator Module.................................................................................................................................................................. 358
25.0 Comparator Voltage Reference Module................................................................................................................................... 366
26.0 High/Low-Voltage Detect (HLVD)............................................................................................................................................. 369
27.0 Charge Time Measurement Unit (CTMU) ................................................................................................................................ 375
28.0 Special Features of the CPU.................................................................................................................................................... 392
29.0 Instruction Set Summary .......................................................................................................................................................... 419
30.0 Development Support............................................................................................................................................................... 469
31.0 Electrical Characteristics .......................................................................................................................................................... 473
32.0 Packaging Information.............................................................................................................................................................. 515
Appendix A: Revision History............................................................................................................................................................. 523
Appendix B: Migration From PIC18F87J11 and PIC18F8722 to PIC18F87K22................................................................................ 524
The Microchip WebSite ...................................................................................................................................................................... 525
Customer Change Notification Service .............................................................................................................................................. 525
Customer Support.............................................................................................................................................................................. 525