2007 Microchip Technology Inc.
Preliminary
DS39636C-page 5
PIC18F2X1X/4X1X
Table of Contents
1.0
2.0
3.0
4.0
5.0
6.0
7.0
8.0
9.0
10.0 Timer0 Module ......................................................................................................................................................................... 113
11.0 Timer1 Module ......................................................................................................................................................................... 117
12.0 Timer2 Module ......................................................................................................................................................................... 123
13.0 Timer3 Module ......................................................................................................................................................................... 125
14.0 Capture/Compare/PWM (CCP) Modules ................................................................................................................................. 129
15.0 Enhanced Capture/Compare/PWM (ECCP) Module................................................................................................................ 137
16.0 Master Synchronous Serial Port (MSSP) Module .................................................................................................................... 151
17.0 Enhanced Universal Synchronous Receiver Transmitter (EUSART)....................................................................................... 191
18.0 10-Bit Analog-to-Digital Converter (A/D) Module ..................................................................................................................... 211
19.0 Comparator Module.................................................................................................................................................................. 221
20.0 Comparator Voltage Reference Module................................................................................................................................... 227
21.0 High/Low-Voltage Detect (HLVD)............................................................................................................................................. 231
22.0 Special Features of the CPU.................................................................................................................................................... 237
23.0 Instruction Set Summary.......................................................................................................................................................... 257
24.0 Development Support............................................................................................................................................................... 307
25.0 Electrical Characteristics.......................................................................................................................................................... 311
26.0 DC and AC Characteristics Graphs And Tables ...................................................................................................................... 349
27.0 Packaging Information.............................................................................................................................................................. 351
Appendix A: Revision History............................................................................................................................................................. 359
Appendix B: Device Differences ........................................................................................................................................................ 359
Appendix C: Conversion Considerations ........................................................................................................................................... 360
Appendix D: Migration From Baseline to Enhanced Devices ............................................................................................................ 360
Appendix E: Migration From Mid-Range to Enhanced Devices......................................................................................................... 361
Appendix F: Migration From High-End to Enhanced Devices............................................................................................................ 361
Index ................................................................................................................................................................................................. 363
The Microchip Web Site..................................................................................................................................................................... 373
Customer Change Notification Service.............................................................................................................................................. 373
Customer Support.............................................................................................................................................................................. 373
Reader Response.............................................................................................................................................................................. 374
PIC18F2X1X/4X1X Product Identification System............................................................................................................................. 375
Device Overview .......................................................................................................................................................................... 7
Oscillator Configurations............................................................................................................................................................ 23
Power-Managed Modes............................................................................................................................................................. 33
Reset.......................................................................................................................................................................................... 41
Memory Organization................................................................................................................................................................. 53
Flash Program Memory.............................................................................................................................................................. 75
8 x 8 Hardware Multiplier............................................................................................................................................................ 79
Interrupts.................................................................................................................................................................................... 81
I/O Ports..................................................................................................................................................................................... 95