Datasheet PIC18F24/25/44/45/54/55Q35 (Microchip)

制造商Microchip
描述Versatile MCUs with Configurable Logic, Mixed‑Voltage Support & Security
页数 / 页1039 / 1 — PIC18F24/25/44/45/54/55Q35 Full-Featured 28/40/48-. Pin Microcontrollers. …
文件格式/大小PDF / 14.8 Mb
文件语言英语

PIC18F24/25/44/45/54/55Q35 Full-Featured 28/40/48-. Pin Microcontrollers. PIC18F24/25/44/45/54/55Q35. Introduction

Datasheet PIC18F24/25/44/45/54/55Q35 Microchip

该数据表的模型线

文件文字版本

link to page 1039
PIC18F24/25/44/45/54/55Q35 Full-Featured 28/40/48- Pin Microcontrollers PIC18F24/25/44/45/54/55Q35
Product Page Links
Introduction
The PIC18-Q35 microcontroller family, with its focused set of peripherals, provides an effective method to implement hardware-based solutions. This device family includes the Configurable Logic Block (CLB) peripheral, enabling users to incorporate hardware-based custom logic into their applications. The CLB is comprised of 128 individual logic elements. Each logic element’s Look Up Table (LUT) based design offers vast customization options, while the CPU- independent operation improves the response time and power consumption. The CLB offers a mode where a predefined configuration is automatically loaded upon power-up or reset while the CPU remains in a non‑executing state. The PIC18-Q35 microcontroller family also offers Enhanced Code Protection features that can provide increased security and protection of user firmware and data. These enhanced features include the ability to disable the programming and debugging interface to allow for one time device programmability and effectively block any unauthorized attempts to communicate with the device via the ICSP™ interface. The PIC18-Q35 microcontroller family is available in 28/40/48-pin packages, and includes a Multi-Voltage I/O (MVIO) interface with multiple pins I/O powered by an alternative VDD pin, allowing these pins to operate at a different voltage domain than the rest of the microcontroller. The family also includes an 8-bit Signal Routing Port module to interconnect digital peripherals without using external pins. Additional features include a 10-bit Analog-to-Digital Converter with Computation (ADCC) capable of 300 ksps; a vectored interrupt controller with fixed latency for handling interrupts; system bus arbiter; Direct Memory Access (DMA) capabilities; Universal Asynchronous Receiver-Transmitter (UART) with support for asynchronous, DMX-512, Digital Addressable Lighting Interface (DALI®) and Local Interconnect Network (LIN) protocols; Serial Peripheral Interface (SPI); and I2C. This family also includes memory features such as Memory Access Partition (MAP) and the Device Information Area (DIA) which stores factory calibration values to help improve temperature sensor accuracy.
PIC18-Q35 Family Summary Table 1.
Memory Overview
PIC18F24Q35 PIC18F25Q35 Devices PIC18F44Q35 PIC18F45Q35 PIC18F54Q35 PIC18F55Q35
Program Flash Memory 16 KB 32 KB Data SRAM 1 KB 2 KB Data EEPROM 256B 256B Memory Access Partition (MAP) Yes Yes Device Information Area (DIA) Yes Yes Programming and Debugging Interface Disable (PDID) Yes Yes  Preliminary Data Sheet DS40002678A - 1 © 2026 Microchip Technology Inc. and its subsidiaries Document Outline Introduction PIC18-Q35 Family Summary Features Operating Characteristics Memory Power-Saving Functionality Digital Peripherals Analog Peripherals Clocking Structure Programming/Debug Features Block Diagram Table of Contents 1.  Packages 2.  Pin Diagrams 2.1.  2.2.  2.3.  2.4.  2.5.  2.6.  3.  Pin Allocation Tables 4.  Guidelines for Getting Started with PIC18-Q35 Microcontrollers 4.1.  Basic Connection Requirements 4.2.  Power Supply Pins 4.2.1.  Decoupling Capacitors 4.2.2.  Tank Capacitors 4.3.  Master Clear (MCLR) Pin 4.4.  In-Circuit Serial Programming™ (ICSP™) Pins 4.5.  External Oscillator Pins 4.6.  Unused I/Os 5.  Register and Bit Naming Conventions 5.1.  Register Names 5.2.  Bit Names 5.2.1.  Short Bit Names 5.2.2.  Long Bit Names 5.2.3.  Bit Fields 5.3.  Register and Bit Naming Exceptions 5.3.1.  Status, Interrupt and Mirror Bits 6.  Register Legend 7.  PIC18 CPU 7.1.  System Arbitration 7.1.1.  Priority Lock 7.2.  Memory Access Scheme 7.2.1.  ISR Priority > Main Priority > Peripheral Priority 7.2.2.  Peripheral Priority > ISR Priority > Main Priority 7.2.3.  ISR Priority > Peripheral Priority > Main Priority 7.2.4.  Peripheral 1 Priority > ISR Priority > Main Priority > Peripheral 2 Priority 7.3.  8x8 Hardware Multiplier 7.3.1.  Operation 7.3.2.  16x16 Unsigned Multiplication Algorithm 7.3.3.  16x16 Signed Multiplication Algorithm 7.4.  PIC18 Instruction Cycle 7.4.1.  Instruction Flow/Pipelining 7.4.2.  Instructions in Program Memory 7.4.3.  Multi-Word Instructions 7.5.  STATUS Register 7.6.  Call Shadow Register 7.7.  Register Definitions: System Arbiter 7.7.1.  ISRPR 7.7.2.  MAINPR 7.7.3.  DMAxPR 7.7.4.  SCANPR 7.7.5.  PRLOCK 7.7.6.  PROD 7.7.7.  STATUS 7.8.  Register Summary - System Arbiter Control 8.  Device Configuration 8.1.  Configuration Settings 8.2.  Enhanced Code Protection 8.2.1.  Write Protection Settings 8.2.2.  Program Flash Memory Code Protection 8.2.3.  Data EEPROM Code Protection 8.2.4.  Storage Area Flash (SAF) Lock Enable 8.2.5.  Programming and Debugging Interface Disable (PDID) 8.2.5.1.  Software ICSP Enable 8.3.  User ID 8.4.  Device ID and Revision ID 8.5.  Register Definitions: Configuration Settings 8.5.1.  Configuration Byte 1 8.5.2.  Configuration Byte 2 8.5.3.  Configuration Byte 3 8.5.4.  Configuration Byte 4 8.5.5.  Configuration Byte 5 8.5.6.  Configuration Byte 6 8.5.7.  Configuration Byte 7 8.5.8.  Configuration Byte 8 8.5.9.  Configuration Byte 9 8.5.10.  Configuration Byte 10 8.5.11.  Configuration Byte 11 8.5.12.  Configuration Byte 12 8.5.13.  Configuration Byte 13 8.5.14.  Configuration Byte 14 8.6.  Register Summary - Configuration Settings 8.7.  Register Definitions: Device ID and Revision ID 8.7.1.  Device ID 8.7.2.  Revision ID 8.8.  Register Summary - DEVID/REVID 8.9.  Register Definitions: Software ICSP Enable 8.9.1.  ICSPEN Lock Register 8.9.2.  In-Circuit Serial Programming Interface Enable Register 9.  Memory Organization 9.1.  Program Memory Organization 9.1.1.  Memory Access Partition 9.1.1.1.  Application Block 9.1.1.2.  Boot Block 9.1.1.3.  Storage Area Flash 9.1.2.  Program Counter 9.1.3.  Return Address Stack 9.1.3.1.  Top-of-Stack Access 9.1.3.2.  Return Stack Pointer 9.1.3.3.  PUSH and POP Instructions 9.1.3.4.  Fast Register Stack 9.1.4.  Look-up Tables in Program Memory 9.1.4.1.  Computed GOTO 9.1.4.2.  Program Flash Memory Access 9.2.  Device Information Area 9.2.1.  Microchip Unique Identifier (MUI) 9.2.2.  External Unique Identifier (EUI) 9.2.3.  Standard Parameters for the Temperature Sensor 9.2.4.  Fixed Voltage Reference Data 9.3.  Device Configuration Information 9.4.  Data Memory Organization 9.4.1.  Bank Select Register 9.4.2.  Access Bank 9.5.  Data Addressing Modes 9.5.1.  Inherent and Literal Addressing 9.5.2.  Direct Addressing 9.5.3.  Indirect Addressing 9.5.3.1.  FSR Registers and the INDF Operand 9.5.3.2.  FSR Registers and POSTINC, POSTDEC, PREINC and PLUSW 9.5.3.3.  Operations by FSRs on FSRs 9.6.  Data Memory and the Extended Instruction Set 9.6.1.  Indexed Addressing with Literal Offset 9.6.2.  Instructions Affected by Indexed Literal Offset Mode 9.6.3.  Mapping the Access Bank in Indexed Literal Offset Mode 9.6.4.  PIC18 Instruction Execution and the Extended Instruction Set 9.7.  Register Definitions: Memory Organization 9.7.1.  PCL 9.7.2.  PCLAT 9.7.3.  TOS 9.7.4.  STKPTR 9.7.5.  WREG 9.7.6.  INDF 9.7.7.  POSTDEC 9.7.8.  POSTINC 9.7.9.  PREINC 9.7.10.  PLUSW 9.7.11.  FSR 9.7.12.  BSR 9.8.  Register Summary - Memory Organization 10.  NVM - Nonvolatile Memory Module 10.1.  Operations 10.2.  Unlock Sequence 10.3.  Program Flash Memory (PFM) 10.3.1.  Page Erase 10.3.2.  Page Read 10.3.3.  Word Read 10.3.4.  Page Write 10.3.5.  Word Write 10.3.6.  Word Modify 10.3.7.  Write Verify 10.3.8.  Unexpected Termination of Write Operation 10.3.9.  User ID, Device ID, Configuration Settings Access, DIA and DCI 10.3.10.  Table Pointer Operations 10.3.10.1.  Table Pointer Register 10.3.10.2.  Table Latch Register 10.3.10.3.  Table Read Operations 10.3.10.4.  Table Write Operations 10.3.10.5.  Table Pointer Boundaries 10.3.10.6.  Reading the Program Flash Memory 10.4.  Data Flash Memory (DFM) 10.4.1.  Reading the DFM 10.4.2.  Writing to DFM 10.4.3.  Erasing the DFM 10.4.4.  DFM Write Verify 10.4.5.  Operation During Code-Protect and Write-Protect 10.4.6.  Protection Against Spurious Writes 10.5.  Register Definitions: NVM 10.5.1.  NVMCON0 10.5.2.  NVMCON1 10.5.3.  NVMLOCK 10.5.4.  NVMADR 10.5.5.  NVMDAT 10.5.6.  TBLPTR 10.5.7.  TABLAT 10.6.  Register Summary - NVM 11.  VIC - Vectored Interrupt Controller Module 11.1.  Overview 11.2.  Interrupt Control and Status Registers 11.3.  Interrupt Vector Table 11.3.1.  Interrupt Vector Table Base Address (IVTBASE) 11.3.2.  Interrupt Vector Table Contents 11.3.3.  Interrupt Vector Table Address Calculation 11.3.4.  Access Control for IVTBASE Registers 11.4.  Interrupt Priority 11.4.1.  User (Software) Priority 11.4.2.  Natural Order (Hardware) Priority 11.5.  Interrupt Operation 11.5.1.  Serving a High- or Low-Priority Interrupt While the Main Routine Code Is Executing 11.5.2.  Serving a High-Priority Interrupt While a Low-Priority Interrupt Is Pending 11.5.3.  Preempting Low-Priority Interrupts 11.5.4.  Simultaneous High- and Low-Priority Interrupts 11.6.  Context Saving 11.6.1.  Accessing Shadow Registers 11.7.  Returning from Interrupt Service Routine (ISR) 11.8.  Interrupt Latency 11.8.1.  Aborting Interrupts 11.9.  Interrupt Setup Procedure 11.10.  External Interrupt Pins 11.11.  Wake-Up from Sleep 11.12.  Interrupt Compatibility 11.13.  Register Definitions: Interrupt Control 11.13.1.  INTCON0 11.13.2.  INTCON1 11.13.3.  IVTBASE 11.13.4.  IVTAD 11.13.5.  IVTLOCK 11.13.6.  SHADCON 11.13.7.  Peripheral Interrupt Enable Register 0 11.13.8.  Peripheral Interrupt Enable Register 1 11.13.9.  Peripheral Interrupt Enable Register 2 11.13.10.  Peripheral Interrupt Enable Register 3 11.13.11.  Peripheral Interrupt Enable Register 4 11.13.12.  Peripheral Interrupt Enable Register 5 11.13.13.  Peripheral Interrupt Enable Register 6 11.13.14.  Peripheral Interrupt Enable Register 7 11.13.15.  Peripheral Interrupt Enable Register 8 11.13.16.  Peripheral Interrupt Enable Register 9 11.13.17.  Peripheral Interrupt Enable Register 10 11.13.18.  Peripheral Interrupt Enable Register 11 11.13.19.  Peripheral Interrupt Request Register 0 11.13.20.  Peripheral Interrupt Request Register 1 11.13.21.  Peripheral Interrupt Request Register 2 11.13.22.  Peripheral Interrupt Request Register 3 11.13.23.  Peripheral Interrupt Request Register 4 11.13.24.  Peripheral Interrupt Request Register 5 11.13.25.  Peripheral Interrupt Request Register 6 11.13.26.  Peripheral Interrupt Request Register 7 11.13.27.  Peripheral Interrupt Request Register 8 11.13.28.  Peripheral Interrupt Request Register 9 11.13.29.  Peripheral Interrupt Request Register 10 11.13.30.  Peripheral Interrupt Request Register 11 11.13.31.  Peripheral Interrupt Request Register 0 11.13.32.  Peripheral Interrupt Priority Register 1 11.13.33.  Peripheral Interrupt Priority Register 2 11.13.34.  Peripheral Interrupt Priority Register 3 11.13.35.  Peripheral Interrupt Priority Register 4 11.13.36.  Peripheral Interrupt Priority Register 5 11.13.37.  Peripheral Interrupt Priority Register 6 11.13.38.  Peripheral Interrupt Priority Register 7 11.13.39.  Peripheral Interrupt Priority Register 8 11.13.40.  Peripheral Interrupt Priority Register 9 11.13.41.  Peripheral Interrupt Priority Register 10 11.13.42.  Peripheral Interrupt Priority Register 11 11.14.  Register Summary - Interrupts 12.  OSC - Oscillator Module (With Fail-Safe Clock Monitor) 12.1.  Clock Source Types 12.1.1.  External Clock Sources 12.1.1.1.  EC Mode 12.1.1.2.  HS Modes 12.1.1.3.  Oscillator Start-Up Timer (OST) 12.1.1.4.  4x PLL 12.1.1.5.  Secondary Oscillator 12.1.1.5.1.  SOSC Start-Up Timing 12.1.2.  Internal Clock Sources 12.1.2.1.  HFINTOSC 12.1.2.1.1.  HFINTOSC Frequency Tuning 12.1.2.2.  MFINTOSC 12.1.2.3.  LFINTOSC 12.1.2.4.  SFINTOSC 12.1.2.5.  ADCRC 12.1.3.  Oscillator Status and Manual Enable 12.2.  Clock Switching 12.2.1.  NOSC and NDIV Bits 12.2.2.  COSC and CDIV Bits 12.2.3.  CSWHOLD 12.2.4.  PLL Input Switch 12.2.5.  Clock Switch and Sleep 12.3.  Fail-Safe Clock Monitor (FSCM) 12.3.1.  Fail-Safe Detection 12.3.2.  Fail-Safe Operation - FOSC Fail-Safe Clock Monitor 12.3.3.  Fail-Safe Operation - Primary and Secondary Fail-Safe Clock Monitors 12.3.4.  Fail-Safe Clock Monitor Fault Injection 12.3.5.  Fail-Safe Condition Clearing 12.3.6.  Reset or Wake-Up from Sleep 12.4.  Active Clock Tuning (ACT) 12.4.1.  ACT Lock Status 12.4.2.  ACT Out-of-Range Status 12.4.3.  ACT Update Disable 12.4.4.  ACT Interrupts 12.5.  Register Definitions: Oscillator Module 12.5.1.  ACTCON 12.5.2.  OSCCON1 12.5.3.  OSCCON2 12.5.4.  OSCCON3 12.5.5.  OSCTUNE 12.5.6.  OSCFRQ 12.5.7.  OSCSTAT 12.5.8.  OSCEN 12.5.9.  FSCMCON 12.6.  Register Summary - Oscillator Module 13.  CRC - Cyclic Redundancy Check Module with Memory Scanner 13.1.  Module Overview 13.2.  Polynomial Implementation 13.3.  Data Sources 13.3.1.  CRC from User Data 13.3.2.  CRC from Flash 13.4.  CRC Check Value 13.5.  CRC Interrupt 13.6.  Configuring the CRC Module 13.6.1.  Register Overlay 13.7.  Scanner Module Overview 13.8.  Scanning Modes 13.8.1.  TRIGEN = 0, BURSTMD = 0 13.8.2.  TRIGEN = 1, BURSTMD = 0 13.8.3.  TRIGEN = x, BURSTMD = 1 13.9.  Configuring the Scanner 13.10.  Scanner Interrupts 13.11.  WWDT Interaction 13.12.  Operation During Sleep 13.13.  Peripheral Module Disable 13.14.  Register Definitions: CRC and Scanner Control 13.14.1.  CRC Control Register 0 13.14.2.  CRC Control Register 1 13.14.3.  CRC Control Register 2 13.14.4.  CRC Data Registers 13.14.5.  CRC Output Registers 13.14.6.  CRC Shift Registers 13.14.7.  CRC XOR Registers 13.14.8.  Scanner Access Control Register 0 13.14.9.  Scan Low Address Registers 13.14.10.  Scan High Address Registers 13.14.11.  SCAN Trigger Selection Register 13.15.  Register Summary - CRC 14.  Resets 14.1.  Power-on Reset (POR) 14.2.  Brown-out Reset (BOR) 14.2.1.  BOR Is Always On 14.2.2.  BOR Is Off in Sleep 14.2.3.  BOR Controlled by Software 14.2.4.  BOR Is Always Off 14.2.5.  BOR and Bulk Erase 14.3.  Low-Power Brown-out Reset (LPBOR) 14.3.1.  Enabling LPBOR 14.3.2.  LPBOR Module Output 14.4.  MCLR Reset 14.4.1.  MCLR Enabled 14.4.2.  MCLR Disabled 14.5.  Windowed Watchdog Timer (WWDT) Reset 14.6.  RESET Instruction 14.7.  Stack Overflow/Underflow Reset 14.8.  Programming Mode Exit 14.9.  Power-up Timer (PWRT) 14.10.  Start-Up Sequence 14.10.1.  Memory Execution Violation 14.11.  Determining the Cause of a Reset 14.12.  Power Control (PCON0/PCON1) Registers 14.13.  Register Definitions: Power Control 14.13.1.  BORCON 14.13.2.  PCON0 14.13.3.  PCON1 14.14.  Register Summary - BOR Control and Power Control 15.  WWDT - Windowed Watchdog Timer 15.1.  Independent Clock Source 15.2.  WWDT Operating Modes 15.2.1.  WWDT Is Always On 15.2.2.  WWDT Is Off in Sleep 15.2.3.  WWDT Controlled by Software 15.3.  Time-Out Period 15.4.  Watchdog Window 15.5.  Clearing the Watchdog Timer 15.5.1.  CLRWDT Considerations (Windowed Mode) 15.6.  Operation During Sleep 15.7.  Register Definitions: Windowed Watchdog Timer Control 15.7.1.  Watchdog Timer Control Register 0 15.7.2.  Watchdog Timer Control Register 1 15.7.3.  WWDT Prescaler Select Register 15.7.4.  WWDT Prescaler Select Register 15.7.5.  WDT Timer Register 15.8.  Register Summary - WDT Control 16.  DMA - Direct Memory Access 16.1.  DMA Registers 16.2.  DMA Organization 16.3.  DMA Interface 16.3.1.  Special Function Registers with DMA Access only 16.3.2.  DMA Addressing 16.3.3.  DMA Message Size/Counters 16.3.4.  DMA Message Transfers 16.3.4.1.  Starting DMA Message Transfers 16.3.4.1.1.  User Software Control 16.3.4.1.2.  Hardware Trigger, SIRQ 16.3.4.2.  Stopping DMA Message Transfers 16.3.4.2.1.  User Software Control 16.3.4.2.2.  Hardware Trigger, AIRQ 16.3.4.2.3.  Source Count Reload 16.3.4.2.4.  Destination Count Reload 16.3.4.2.5.  Clearing the EN Bit 16.4.  Disable DMA Message Transfer Upon Completion 16.4.1.  Clearing the SIRQEN Bit 16.4.2.  Source/Destination Stop 16.5.  Types of Hardware Triggers 16.5.1.  Edge Trigger Requests 16.5.2.  Level Trigger Requests 16.6.  Types of Data Transfers 16.7.  DMA Interrupts 16.7.1.  DMA Source Count Interrupt 16.7.2.  DMA Destination Count Interrupt 16.7.3.  Abort Interrupt 16.7.4.  Overrun Interrupt 16.8.  DMA Setup and Operation 16.8.1.  Source Stop 16.8.2.  Destination Stop 16.8.3.  Continuous Transfer 16.8.4.  Transfer from SFR to GPR 16.8.5.  Overrun Condition 16.8.6.  Abort Trigger, Message Complete 16.8.7.  Abort Trigger, Message in Progress 16.9.  Reset 16.10.  Power-Saving Mode Operation 16.10.1.  Sleep Mode 16.10.2.  Idle Mode 16.10.3.  Doze Mode 16.10.4.  Peripheral Module Disable 16.11.  Example Setup Code 16.12.  Register Overlay 16.13.  Register Definitions: DMA 16.13.1.  DMASELECT 16.13.2.  DMAnCON0 16.13.3.  DMAnCON1 16.13.4.  DMAnBUF 16.13.5.  DMAnSSA 16.13.6.  DMAnSSZ 16.13.7.  DMAnSCNT 16.13.8.  DMAnSPTR 16.13.9.  DMAnDSA 16.13.10.  DMAnDSZ 16.13.11.  DMAnDCNT 16.13.12.  DMAnDPTR 16.13.13.  DMAnSIRQ 16.13.14.  DMAnAIRQ 16.14.  Register Summary - DMA 17.  Power-Saving Modes 17.1.  Doze Mode 17.1.1.  Doze Operation 17.1.2.  Interrupts During Doze 17.2.  Sleep Mode 17.2.1.  Wake-Up from Sleep 17.2.2.  Wake-Up Using Interrupts 17.2.3.  Low-Power Sleep Mode 17.2.3.1.  Sleep Current vs. Wake-Up Time 17.2.3.2.  Peripheral Usage in Sleep 17.3.  Idle Mode 17.3.1.  Idle and Interrupts 17.3.2.  Idle and WWDT 17.4.  Peripheral Operation in Power-Saving Modes 17.5.  Register Definitions: Power-Savings Control 17.5.1.  Doze and Idle Register 17.5.2.  VREGCON 17.6.  Register Summary - Power-Savings Control 18.  PMD - Peripheral Module Disable 18.1.  Overview 18.2.  Disabling a Module 18.3.  Enabling a Module 18.4.  Register Definitions: Peripheral Module Disable 18.4.1.  PMD Control Register 0 18.4.2.  PMD Control Register 1 18.4.3.  PMD Control Register 2 18.4.4.  PMD Control Register 3 18.4.5.  PMD Control Register 4 18.4.6.  PMD Control Register 5 18.4.7.  PMD Control Register 6 18.5.  Register Summary - PMD 19.  I/O Ports 19.1.  Overview 19.2.  PORTx - Data Register 19.3.  LATx - Output Latch 19.4.  TRISx - Direction Control 19.5.  ANSELx - Analog Control 19.6.  WPUx - Weak Pull-Up Control 19.7.  INLVLx - Input Threshold Control 19.8.  SLRCONx - Slew Rate Control 19.9.  ODCONx - Open-Drain Control 19.10.  Edge Selectable Interrupt-on-Change 19.11.  I2C Pad Control 19.12.  I/O Priorities 19.13.  MCLR/VPP/RE3 Pin 19.14.  Register Definitions: Port Control 19.14.1.  PORTx 19.14.2.  LATx 19.14.3.  TRISx 19.14.4.  ANSELx 19.14.5.  WPUx 19.14.6.  INLVLx 19.14.7.  SLRCONx 19.14.8.  ODCONx 19.14.9.  RxyI2C 19.15.  Register Summary - I/O Ports 20.  SRPORT – Signal Routing Port 20.1.  Operation 20.1.1.  Signal Routing Port Clock 20.1.2.  Signal Routing Port Input 20.1.3.  Signal Routing Port Output and Data Register 20.1.4.  Interrupt-on-Change and DMA/ADC Triggers 20.2.  Software Setup 20.3.  Register Definitions: Signal Routing Port 20.3.1.  PORTW 20.3.2.  LATW 20.3.3.  PORTWIN0 20.3.4.  PORTWIN1 20.3.5.  PORTWIN2 20.3.6.  PORTWIN3 20.3.7.  PORTWIN4 20.3.8.  PORTWIN5 20.3.9.  PORTWIN6 20.3.10.  PORTWIN7 20.3.11.  PORTWCLK 20.3.12.  PORTWDF 20.3.13.  Signal Routing Port Control Register 20.4.  Register Summary - Signal Routing Port 21.  IOC - Interrupt-on-Change 21.1.  Overview 21.2.  Enabling the Module 21.3.  Individual Pin Configuration 21.4.  Interrupt Flags 21.4.1.  Clearing Interrupt Flags 21.5.  Operation in Sleep 21.6.  Register Definitions: Interrupt-on-Change Control 21.6.1.  IOCxF 21.6.2.  IOCxN 21.6.3.  IOCxP 21.7.  Register Summary - Interrupt-on-Change Control 22.  PPS - Peripheral Pin Select Module 22.1.  Overview 22.2.  PPS Inputs 22.3.  PPS Outputs 22.4.  TRISxyPPS Register 22.5.  Bidirectional Pins 22.6.  PPS Lock 22.6.1.  PPS One-Way Lock 22.7.  Operation During Sleep 22.8.  Effects of a Reset 22.9.  Register Definitions: Peripheral Pin Select (PPS) 22.9.1.  Peripheral Input Selection Register 22.9.2.  Pin Rxy Output Source Selection Register 22.9.3.  TRISxy Source Selection Register 22.9.4.  PPS Lock Register 22.10.  Register Summary - Peripheral Pin Select Module 23.  MVIO - Multi-Voltage I/O 23.1.  Features 23.2.  Module Overview 23.2.1.  POR and Voltage Monitors 23.2.2.  Power Mode Selection 23.3.  Operation 23.3.1.  Power Sequencing 23.3.2.  Voltage Measurement 23.3.3.  Interrupts and DMA Triggers 23.3.4.  Sleep Mode 23.3.5.  Debug Operation 23.3.6.  Module Setup 23.4.  Register Definitions: MVIO 23.4.1.  MVIO Control Register 23.4.2.  MVIO Status Register 23.5.  Register Summary - MVIO 24.  CLC - Configurable Logic Cell 24.1.  CLC Setup 24.1.1.  Data Selection 24.1.2.  Data Gating 24.1.3.  Logic Function 24.1.4.  Output Polarity 24.2.  CLC Interrupts 24.3.  Effects of a Reset 24.4.  Output Mirror Copies 24.5.  Operation During Sleep 24.6.  CLC Setup Steps 24.7.  Register Overlay 24.8.  Register Definitions: Configurable Logic Cell 24.8.1.  CLC Instance Selection Register 24.8.2.  Configurable Logic Cell Control Register 24.8.3.  CLCn Signal Polarity Control Register 24.8.4.  CLCn Data 0 Select Register 24.8.5.  CLCn Data 1 Select Register 24.8.6.  CLCn Data 2 Select Register 24.8.7.  CLCn Data 3 Select Register 24.8.8.  CLCn Gate1 Logic Select Register 24.8.9.  CLCn Gate2 Logic Select Register 24.8.10.  CLCn Gate3 Logic Select Register 24.8.11.  CLCn Gate4 Logic Select Register 24.8.12.  CLC Data Output Register 24.9.  Register Summary - CLC Control 25.  CLB - Configurable Logic Block 25.1.  CLB Module Enable 25.2.  Basic Logic Element (BLE) 25.3.  CLB Module Inputs 25.3.1.  CLB Software Input Registers 25.3.2.  Programmable Edge Detectors 25.4.  CLB Module Outputs 25.4.1.  CLB Software Outputs 25.4.2.  CLB Peripheral Connections 25.4.3.  CLB PPS Outputs 25.5.  CLB Clock Selection 25.6.  CLB Interrupts 25.7.  Operation During Sleep Mode 25.8.  CLB Configuration 25.8.1.  CLB Automatic Configuration 25.9.  CLB Debug 25.10.  Register Definitions: Configurable Logic Block 25.10.1.  CLB Control Register 25.10.2.  CLB Software Input Register High Byte 25.10.3.  CLB Software Input Register Low Byte 25.10.4.  CLB Clock Selection 25.10.5.  CLB Output Register High Byte 25.10.6.  CLB Output Register Low Byte 25.10.7.  CLB Software Output Register High Byte 25.10.8.  CLB Software Output Register Low Byte 25.10.9.  CLB Debug Selection Register 0 25.10.10.  CLB Debug Selection Register 1 25.11.  Register Summary - CLB Control 26.  CLKREF - Reference Clock Output Module 26.1.  Clock Source 26.1.1.  Clock Synchronization 26.2.  Programmable Clock Divider 26.3.  Selectable Duty Cycle 26.4.  Operation in Sleep Mode 26.5.  Register Definitions: Reference Clock 26.5.1.  CLKRCON 26.5.2.  CLKRCLK 26.6.  Register Summary - Reference CLK 27.  TMR0 - Timer0 Module 27.1.  Timer0 Operation 27.1.1.  8-Bit Mode 27.1.2.  16-Bit Mode 27.2.  Clock Selection 27.2.1.  Synchronous Mode 27.2.2.  Asynchronous Mode 27.2.3.  Programmable Prescaler 27.2.4.  Programmable Postscaler 27.3.  Timer0 Output and Interrupt 27.3.1.  Timer0 Output 27.3.2.  Timer0 Interrupt 27.3.3.  Timer0 Example 27.4.  Operation During Sleep 27.5.  Register Definitions: Timer0 Control 27.5.1.  T0CON0 27.5.2.  T0CON1 27.5.3.  TMR0H 27.5.4.  TMR0L 27.6.  Register Summary - Timer0 28.  TMR1 - Timer1 Module with Gate Control 28.1.  Timer1 Operation 28.2.  Clock Source Selection 28.2.1.  Internal Clock Source 28.2.2.  External Clock Source 28.3.  Timer1 Prescaler 28.4.  Secondary Oscillator 28.5.  Timer1 Operation in Asynchronous Counter Mode 28.5.1.  Reading and Writing TMRx in Asynchronous Counter Mode 28.6.  Timer1 16-Bit Read/Write Mode 28.7.  Timer1 Gate 28.7.1.  Timer1 Gate Enable 28.7.2.  Timer1 Gate Source Selection 28.7.3.  Timer1 Gate Toggle Mode 28.7.4.  Timer1 Gate Single Pulse Mode 28.7.5.  Timer1 Gate Value Status 28.7.6.  Timer1 Gate Event Interrupt 28.8.  Timer1 Interrupt 28.9.  Timer1 Operation During Sleep 28.10.  CCP Capture/Compare Time Base 28.11.  CCP Special Event Trigger 28.12.  Peripheral Module Disable 28.13.  Register Definitions: Timer1 Control 28.13.1.  TxCON 28.13.2.  TxGCON 28.13.3.  TxCLK 28.13.4.  TxGATE 28.13.5.  TMRx 28.14.  Register Summary - Timer1 29.  TMR2 - Timer2 Module 29.1.  Timer2 Operation 29.1.1.  Free-Running Period Mode 29.1.2.  One Shot Mode 29.1.3.  Monostable Mode 29.2.  Timer2 Output 29.3.  External Reset Sources 29.4.  Timer2 Interrupt 29.5.  PSYNC Bit 29.6.  CSYNC Bit 29.7.  Operating Modes 29.8.  Operation Examples 29.8.1.  Software Gate Mode 29.8.2.  Hardware Gate Mode 29.8.3.  Edge Triggered Hardware Limit Mode 29.8.4.  Level Triggered Hardware Limit Mode 29.8.5.  Software Start One Shot Mode 29.8.6.  Edge Triggered One Shot Mode 29.8.7.  Edge Triggered Hardware Limit One Shot Mode 29.8.8.  Level Reset, Edge Triggered Hardware Limit One Shot Modes 29.8.9.  Edge Triggered Monostable Modes 29.8.10.  Level Triggered Hardware Limit One Shot Modes 29.9.  Timer2 Operation During Sleep 29.10.  Register Definitions: Timer2 Control 29.10.1.  TxTMR 29.10.2.  TxPR 29.10.3.  TxCON 29.10.4.  TxHLT 29.10.5.  TxCLKCON 29.10.6.  TxRST 29.11.  Register Summary - Timer2 30.  UTMR - Universal Timer Module 30.1.  Module Nomenclature 30.2.  Clock Source Selection 30.3.  UTMR Prescaler 30.4.  UTMR Operation 30.4.1.  Synchronous vs. Asynchronous Operation 30.4.2.  Timer Counter and Capture Registers 30.4.3.  Timer Period Register 30.4.4.  External Reset Source (ERS) 30.4.5.  Start, Stop and Reset Events 30.4.5.1.  Start Event 30.4.5.2.  Reset Event 30.4.5.3.  Stop Event 30.4.6.  Hardware Limit Mode 30.4.7.  One Shot Mode 30.4.8.  Run Status Flag 30.5.  UTMR Output Modes 30.6.  Interrupt and DMA Triggers 30.7.  Operation During Sleep 30.8.  Chaining Counter Timers 30.9.  Register Definitions: Universal Timer 30.9.1.  TUxyCON0 30.9.2.  TUxyCON1 30.9.3.  TUxyHLT 30.9.4.  TUxyPS 30.9.5.  TUxyTMR (16-bit) 30.9.6.  TUxyCR (16-bit) 30.9.7.  TUxyPR (16-bit) 30.9.8.  TUxyCLK 30.9.9.  TUxyERS 30.9.10.  TUCHAIN 30.10.  Register Summary - Universal Timer 31.  CCP - Capture/Compare/PWM Module 31.1.  CCP Module Configuration 31.1.1.  CCP Modules and Timer Resources 31.1.2.  Open-Drain Output Option 31.2.  Capture Mode 31.2.1.  Capture Sources 31.2.2.  Timer1 Mode for Capture 31.2.3.  Software Interrupt Mode 31.2.4.  CCP Prescaler 31.2.5.  Capture During Sleep 31.3.  Compare Mode 31.3.1.  CCPx Pin Configuration 31.3.2.  Timer1 Mode for Compare 31.3.3.  Compare During Sleep 31.4.  PWM Overview 31.4.1.  Standard PWM Operation 31.4.2.  Setup for PWM Operation 31.4.3.  Timer2 Timer Resource 31.4.4.  PWM Period 31.4.5.  PWM Duty Cycle 31.4.6.  PWM Resolution 31.4.7.  Operation in Sleep Mode 31.4.8.  Changes in System Clock Frequency 31.4.9.  Effects of Reset 31.5.  Register Definitions: CCP Control 31.5.1.  CCPxCON 31.5.2.  CCPxCAP 31.5.3.  CCPRx 31.6.  Register Summary - CCP Control 32.  Capture, Compare, and PWM Timers Selection 32.1.  Register Definitions: Capture, Compare, and PWM Timers Selection 32.1.1.  CCPTMRS0 32.2.  Register Summary - Capture, Compare, and PWM Timers Selection 33.  PWM - Pulse-Width Modulator with Compare 33.1.  Output Slices 33.1.1.  Output Polarity 33.1.2.  Operating Modes 33.1.2.1.  Left Aligned Mode 33.1.2.2.  Right Aligned Mode 33.1.2.3.  Center-Aligned Mode 33.1.2.4.  Variable Alignment Mode 33.1.2.5.  Compare Modes 33.1.2.5.1.  Pulsed Compare Mode 33.1.2.5.2.  Toggled Compare 33.1.3.  Push-Pull Mode 33.2.  Period Timer 33.3.  Clock Sources 33.3.1.  Clock Prescaler 33.4.  External Period Resets 33.5.  Buffered Period and Parameter Registers 33.6.  Synchronizing Multiple PWMs 33.7.  Interrupts 33.7.1.  Period Interrupt 33.7.1.1.  Period Interrupt Postscaler 33.7.2.  Parameter Interrupts 33.8.  Operation During Sleep 33.9.  Register Definitions: PWM Control 33.9.1.  PWMxERS 33.9.2.  PWMxCLK 33.9.3.  PWMxLDS 33.9.4.  PWMxPR 33.9.5.  PWMxCPRE 33.9.6.  PWMxPIPOS 33.9.7.  PWMxGIR 33.9.8.  PWMxGIE 33.9.9.  PWMxCON 33.9.10.  PWMxSaCFG 33.9.11.  PWMxSaP1 33.9.12.  PWMxSaP2 33.9.13.  PWMLOAD 33.9.14.  PWMEN 33.10.  Register Summary - PWM 34.  CWG - Complementary Waveform Generator Module 34.1.  Fundamental Operation 34.2.  Operating Modes 34.2.1.  Half Bridge Mode 34.2.2.  Push-Pull Mode 34.2.3.  Full Bridge Mode 34.2.3.1.  Direction Change in Full Bridge Mode 34.2.3.2.  Dead-Band Delay in Full Bridge Mode 34.2.4.  Steering Modes 34.2.4.1.  Synchronous Steering Mode 34.2.4.2.  Asynchronous Steering Mode 34.2.4.3.  Start-Up Considerations 34.3.  Clock Source 34.4.  Selectable Input Sources 34.5.  Output Control 34.5.1.  CWG Output 34.5.2.  Polarity Control 34.6.  Dead-Band Control 34.6.1.  Dead-Band Functionality in Half Bridge Mode 34.6.2.  Dead-Band Functionality in Full Bridge Mode 34.7.  Rising Edge and Reverse Dead Band 34.8.  Falling Edge and Forward Dead Band 34.9.  Dead-Band Jitter 34.10.  Auto-Shutdown 34.10.1.  Shutdown 34.10.2.  Software Generated Shutdown 34.10.3.  External Input Source 34.10.4.  Pin Override Levels 34.10.5.  Auto-Shutdown Interrupts 34.11.  Auto-Shutdown Restart 34.11.1.  Software-Controlled Restart 34.11.2.  Auto-Restart 34.12.  Operation During Sleep 34.13.  Configuring the CWG 34.14.  Register Definitions: CWG Control 34.14.1.  CWGxCON0 34.14.2.  CWGxCON1 34.14.3.  CWGxCLK 34.14.4.  CWGxISM 34.14.5.  CWGxSTR 34.14.6.  CWGxAS0 34.14.7.  CWGxAS1 34.14.8.  CWGxDBR 34.14.9.  CWGxDBF 34.15.  Register Summary - CWG 35.  NCO - Numerically Controlled Oscillator Module 35.1.  NCO Operation 35.1.1.  NCO Clock Sources 35.1.2.  Accumulator 35.1.3.  Adder 35.1.4.  Increment Registers 35.2.  Fixed Duty Cycle Mode 35.3.  Pulse Frequency Mode 35.4.  Output Polarity Control 35.5.  Interrupts 35.6.  Effects of a Reset 35.7.  Operation in Sleep 35.8.  Register Definitions: NCO 35.8.1.  NCOxCON 35.8.2.  NCOxCLK 35.8.3.  NCOxACC 35.8.4.  NCOxINC 35.9.  Register Summary - NCO 36.  DSM - Data Signal Modulator Module 36.1.  DSM Operation 36.1.1.  Modulator Signal Sources 36.1.2.  Carrier Signal Sources 36.2.  Carrier Synchronization 36.3.  Carrier Source Polarity Select 36.4.  Programmable Modulator Data 36.5.  Modulated Output Polarity 36.6.  Operation in Sleep Mode 36.7.  Effects of a Reset 36.8.  Peripheral Module Disable 36.9.  Register Definitions: Modulation Control 36.9.1.  DSM Control Register 0 36.9.2.  DSM Control Register 1 36.9.3.  Modulation Source Control 36.9.4.  DSM Low Carrier Control Register 36.9.5.  DSM High Carrier Control Register 36.10.  Register Summary - DSM 37.  UART - Universal Asynchronous Receiver Transmitter with Protocol Support 37.1.  UART I/O Pin Configuration 37.2.  UART Asynchronous Modes 37.2.1.  UART Asynchronous Transmitter 37.2.1.1.  Enabling the Transmitter 37.2.1.2.  Transmitting Data 37.2.1.3.  Transmit Data Polarity 37.2.1.4.  Transmit Interrupt Flag 37.2.1.5.  TSR Status 37.2.1.6.  Transmitter 7-Bit Mode 37.2.1.7.  Transmitter Parity Modes 37.2.1.8.  Asynchronous Transmission Setup 37.2.2.  UART Asynchronous Receiver 37.2.2.1.  Enabling the Receiver 37.2.2.2.  Receiving Data 37.2.2.3.  Receive Data Polarity 37.2.2.4.  Receive Interrupts 37.2.2.5.  Receive Framing Error 37.2.2.6.  Receiver Parity Modes 37.2.2.7.  Receive FIFO Overflow 37.2.2.8.  Asynchronous Reception Setup 37.2.3.  Asynchronous Address Mode 37.2.3.1.  Address Mode Transmit 37.2.3.2.  Address Mode Receive 37.3.  DMX Mode (Full-Featured UARTs Only) 37.3.1.  DMX Controller 37.3.2.  DMX Receiver 37.4.  LIN Modes (Full-Featured UARTs Only) 37.4.1.  LIN Host/Client Mode 37.4.2.  LIN Client Mode 37.4.2.1.  LIN Client Receiver 37.4.2.2.  LIN Client Transmitter 37.5.  DALI Mode (Full-Featured UARTs Only) 37.5.1.  Control Device 37.5.2.  Control Gear 37.6.  General Purpose Manchester (Full-Featured UARTs Only) 37.7.  Polarity 37.8.  Stop Bits 37.8.1.  Delayed Receive Interrupt 37.9.  Operation After FIFO Overflow 37.10.  Receive and Transmit Buffers 37.10.1.  FIFO Status 37.10.2.  FIFO Reset 37.11.  Flow Control 37.11.1.  Hardware Flow Control 37.11.2.  RS-485 Transceiver Control 37.11.3.  XON/XOFF Flow Control 37.12.  Checksum (Full-Featured UARTs Only) 37.12.1.  Transmit Checksum Method 37.12.2.  Receive Checksum Method 37.13.  Collision Detection (Full-Featured UARTs Only) 37.14.  RX/TX Activity Time-Out 37.15.  Clock Accuracy with Asynchronous Operation 37.16.  UART Baud Rate Generator 37.16.1.  Auto-Baud Detect 37.16.2.  Auto-Baud Overflow 37.16.3.  Auto Wake-on-Break 37.16.3.1.  Auto-Wake-Up Special Considerations 37.17.  Transmitting a Break 37.18.  Receiving a Break 37.19.  UART Operation During Sleep 37.20.  Register Definitions: UART 37.20.1.  UxCON0 37.20.2.  UxCON1 37.20.3.  UxCON2 37.20.4.  UxERRIR 37.20.5.  UxERRIE 37.20.6.  UxUIR 37.20.7.  UxFIFO 37.20.8.  UxBRG 37.20.9.  UxRXB 37.20.10.  UxTXB 37.20.11.  UxP1 37.20.12.  UxP2 37.20.13.  UxP3 37.20.14.  UxTXCHK 37.20.15.  UxRXCHK 37.21.  Register Summary - UART 38.  SPI - Serial Peripheral Interface Module 38.1.  SPI Controls 38.2.  SPI Operation 38.2.1.  Enabling and Disabling the SPI Module 38.2.2.  BUSY Bit 38.2.3.  Transmit and Receive FIFOs 38.2.4.  LSb vs. MSb-First Operation 38.2.5.  Input and Output Polarity Control 38.2.6.  Transfer Counter 38.2.6.1.  Total Bit Count Mode (BMODE = 0) 38.2.6.2.  Variable Transfer Size Mode (BMODE = 1) 38.2.6.3.  Transfer Counter in Client Mode 38.3.  Host Mode 38.3.1.  Full Duplex Mode 38.3.2.  Transmit Only Mode 38.3.3.  Receive Only Mode 38.3.4.  Transfer Off Mode 38.3.5.  Host Mode Client Select Control 38.3.5.1.  Hardware Client Select Control 38.3.5.2.  Software Client Select Control 38.3.6.  Host Mode SPI Clock Configuration 38.3.6.1.  SPI Clock Selection 38.3.6.2.  Clock and Data Change Alignment 38.3.6.3.  SCK Start-Up Delay 38.4.  Client Mode 38.4.1.  Client Mode Transmit Options 38.4.1.1.  SDO Drive/Tri-State 38.4.1.2.  SDO Output Data 38.4.2.  Client Mode Receive Options 38.4.3.  Client Mode Client Select 38.4.4.  Client Mode Clock Configuration 38.4.5.  Daisy-Chain Configuration 38.5.  SPI Operation in Sleep Mode 38.6.  SPI Interrupts 38.6.1.  SPI Receive Interrupt 38.6.2.  SPI Transmit Interrupt 38.6.3.  SPI Status Interrupts 38.6.3.1.  Shift Register Empty Interrupt 38.6.3.2.  Transfer Counter Is Zero Interrupt 38.6.3.3.  Start of Client Select and End of Client Select Interrupts 38.6.3.4.  Receiver Overflow and Transmitter Underflow Interrupts 38.7.  Register Definitions: Serial Peripheral Interface 38.7.1.  SPIxCON0 38.7.2.  SPIxCON1 38.7.3.  SPIxCON2 38.7.4.  SPIxCLK 38.7.5.  SPIxBAUD 38.7.6.  SPIxTCNT 38.7.7.  SPIxTWIDTH 38.7.8.  SPIxSTATUS 38.7.9.  SPIxRXB 38.7.10.  SPIxTXB 38.7.11.  SPIxINTE 38.7.12.  SPIxINTF 38.8.  Register Summary - SPI Control 39.  I2C - Inter-Integrated Circuit Module 39.1.  I2C Features 39.2.  I2C Terminology 39.3.  I2C Module Overview 39.3.1.  Byte Format 39.3.2.  SDA and SCL Pins 39.3.2.1.  SDA Hold Time 39.3.3.  Start Condition 39.3.4.  Acknowledge Sequence 39.3.5.  Restart Condition 39.3.6.  Stop Condition 39.3.7.  Bus Time-Out 39.3.8.  Address Buffers 39.3.9.  Transmit Buffer 39.3.10.  Receive Buffer 39.3.11.  Clock Stretching 39.3.11.1.  Clock Stretching for Buffer Operations 39.3.11.2.  Clock Stretching for Other Client Operations 39.3.12.  Data Byte Count 39.3.12.1.  Auto-Load I2CxCNT 39.3.12.1.1.  ACNTMD = 0 (8 bits are loaded into the low byte of I2CxCNT) 39.3.12.1.2.  ACNTMD = 1 (8 bits are loaded into the high byte of I2CxCNT) 39.3.12.1.3.  ACNTMD = 2 (16 bits are loaded into I2CxCNT) 39.3.13.  DMA Integration 39.3.13.1.  7-Bit Host Transmission 39.3.13.2.  10-Bit Host Transmission 39.3.13.3.  7/10-Bit Host Reception 39.3.13.4.  7-Bit Client Transmission 39.3.13.5.  10-Bit Client Transmission 39.3.13.6.  7/10-Bit Client Reception 39.3.14.  Interrupts 39.3.14.1.  High-Level Interrupts 39.3.14.2.  Condition-Specific Interrupts 39.3.15.  Operation in Sleep 39.4.  I2C Operation 39.4.1.  I2C Client Mode Operation 39.4.1.1.  Client Addressing Modes 39.4.1.2.  General Call Addressing Support 39.4.1.3.  Client Operation in 7-Bit Addressing Modes 39.4.1.3.1.  Client Transmission (7-Bit Addressing Mode) 39.4.1.3.2.  Client Reception (7-Bit Addressing Mode) 39.4.1.4.  Client Operation in 10-Bit Addressing Modes 39.4.1.4.1.  Client Transmission (10-Bit Addressing Mode) 39.4.1.4.2.  Client Reception (10-Bit Addressing Mode) 39.4.2.  I2C Host Mode Operation 39.4.2.1.  Bus Free Time 39.4.2.2.  Host Clock Timing 39.4.2.3.  Start Condition Timing 39.4.2.4.  Acknowledge Sequence Timing 39.4.2.5.  Restart Condition Timing 39.4.2.6.  Stop Condition Timing 39.4.2.7.  Host Operation in 7-Bit Addressing Modes 39.4.2.7.1.  Host Transmission (7-Bit Addressing Mode) 39.4.2.7.2.  Host Reception (7-Bit Addressing Mode) 39.4.2.8.  Host Operation in 10-Bit Addressing Modes 39.4.2.8.1.  Host Transmission (10-Bit Addressing Mode) 39.4.2.8.2.  Host Reception (10-Bit Addressing Mode) 39.4.3.  I2C Multi-Host Mode Operation 39.4.3.1.  Multi-Host Mode Clock Synchronization 39.4.3.2.  Multi-Host Mode Bus Arbitration 39.5.  Register Definitions: I2C Control 39.5.1.  I2CxCON0 39.5.2.  I2CxCON1 39.5.3.  I2CxCON2 39.5.4.  I2CxCON3 39.5.5.  I2CxSTAT0 39.5.6.  I2CxSTAT1 39.5.7.  I2CxPIR 39.5.8.  I2CxPIE 39.5.9.  I2CxERR 39.5.10.  I2CxCLK 39.5.11.  I2CxBAUD 39.5.12.  I2CxCNT 39.5.13.  I2CxBTO 39.5.14.  I2CxBTOC 39.5.15.  I2CxADB0 39.5.16.  I2CxADB1 39.5.17.  I2CxADR0 39.5.18.  I2CxADR1 39.5.19.  I2CxADR2 39.5.20.  I2CxADR3 39.5.21.  I2CxTXB 39.5.22.  I2CxRXB 39.6.  Register Summary - I2C 40.  HLVD - High/Low-Voltage Detect 40.1.  Operation 40.2.  Setup 40.3.  Current Consumption 40.4.  HLVD Start-Up Time 40.5.  Applications 40.6.  Operation During Sleep 40.7.  Operation During Idle and Doze Modes 40.8.  Effects of a Reset 40.9.  Register Definitions: HLVD Control 40.9.1.  High/Low-Voltage Detect Control Register 0 40.9.2.  High/Low-Voltage Detect Control Register 1 40.10.  Register Summary - HLVD 41.  FVR - Fixed Voltage Reference 41.1.  Independent Gain Amplifiers 41.2.  FVR Stabilization Period 41.3.  Register Definitions: FVR 41.3.1.  FVRCON 41.4.  Register Summary - FVR 42.  Temperature Indicator Module 42.1.  Module Operation 42.1.1.  Temperature Indicator Range 42.1.2.  Minimum Operating VDD 42.2.  Temperature Calculation 42.2.1.  Higher-Order Calibration 42.3.  ADC Acquisition Time 42.4.  Register Definitions: Temperature Indicator 42.4.1.  FVRCON 42.5.  Register Summary - Temperature Indicator 43.  ADC - Analog-to-Digital Converter with Computation Module 43.1.  ADC Configuration 43.1.1.  Port Configuration 43.1.2.  Channel Selection 43.1.2.1.  Channel Grouping 43.1.3.  ADC Voltage Reference 43.1.4.  Conversion Clock 43.1.5.  Interrupts 43.1.6.  Result Formatting 43.2.  ADC Operation 43.2.1.  Starting a Conversion 43.2.2.  Completion of a Conversion 43.2.3.  ADC Operation During Sleep 43.2.4.  External Trigger During Sleep 43.2.5.  Auto-Conversion Trigger 43.2.6.  ADC Conversion Procedure (Basic Mode) 43.3.  ADC Acquisition Requirements 43.4.  Computation Operation 43.4.1.  Digital Filter/Average 43.4.2.  Basic Mode 43.4.3.  Accumulate Mode 43.4.4.  Average Mode 43.4.5.  Burst Average Mode 43.4.6.  Low-Pass Filter Mode 43.4.7.  Threshold Comparison 43.4.8.  Repetition and Sampling Options 43.4.8.1.  Continuous Sampling Mode 43.4.8.2.  Double Sample Conversion 43.4.9.  Capacitive Voltage Divider (CVD) Features 43.4.9.1.  CVD Operation 43.4.9.2.  Precharge Control 43.4.9.3.  Acquisition Control for CVD (ADPRE > 0) 43.4.9.4.  Guard Ring Outputs 43.4.9.5.  Additional S/H Capacitance 43.5.  Register Definitions: ADC Control 43.5.1.  ADCON0 43.5.2.  ADCON1 43.5.3.  ADCON2 43.5.4.  ADCON3 43.5.5.  ADSTAT 43.5.6.  ADCLK 43.5.7.  ADREF 43.5.8.  ADPCH 43.5.9.  ADPRE 43.5.10.  ADACQ 43.5.11.  ADCAP 43.5.12.  ADRPT 43.5.13.  ADCNT 43.5.14.  ADFLTR 43.5.15.  ADRES 43.5.16.  ADPREV 43.5.17.  ADACC 43.5.18.  ADSTPT 43.5.19.  ADERR 43.5.20.  ADLTH 43.5.21.  ADUTH 43.5.22.  ADACT 43.5.23.  ADCGxA 43.5.24.  ADCGxB 43.5.25.  ADCGxC 43.5.26.  ADCGxE 43.5.27.  ADC Channel Group Selection Port F 43.6.  Register Summary - ADC 44.  DAC - Digital-to-Analog Converter Module 44.1.  Output Voltage Selection 44.2.  Ratiometric Output Level 44.3.  Operation During Sleep 44.4.  Effects of a Reset 44.5.  Register Definitions: DAC Control 44.5.1.  Digital-to-Analog Converter Control Register 44.5.2.  Digital-to-Analog Converter Data Register 44.6.  Register Summary - DAC 45.  CMP - Comparator Module 45.1.  Comparator Overview 45.2.  Comparator Control 45.2.1.  Comparator Enable 45.2.2.  Comparator Output 45.2.3.  Comparator Output Polarity 45.3.  Comparator Output Synchronization 45.4.  Comparator Hysteresis 45.5.  Comparator Interrupt 45.6.  Comparator Positive Input Selection 45.7.  Comparator Negative Input Selection 45.8.  Comparator Response Time 45.8.1.  Comparator Speed Selection 45.9.  Analog Input Connection Considerations 45.10.  Operation in Sleep Mode 45.11.  ADC Auto-Trigger Source 45.12.  Register Definitions: Comparator Control 45.12.1.  CMxCON0 45.12.2.  CMxCON1 45.12.3.  CMxNCH 45.12.4.  CMxPCH 45.12.5.  CMOUT 45.13.  Register Summary - Comparator 46.  ZCD - Zero-Cross Detection Module 46.1.  External Resistor Selection 46.2.  ZCD Logic Output 46.3.  ZCD Logic Polarity 46.4.  ZCD Interrupts 46.5.  Correction for ZCPINV Offset 46.5.1.  Correction by AC Coupling 46.5.2.  Correction by Offset Current 46.6.  Handling VPEAK Variations 46.7.  Operation During Sleep 46.8.  Effects of a Reset 46.9.  Disabling the ZCD Module 46.10.  Register Definitions: ZCD Control 46.10.1.  ZCDxCON 46.11.  Register Summary - ZCD 47.  Instruction Set Summary 47.1.  Standard Instruction Set 47.1.1.  Standard Instruction Set
 47.2.  Extended Instruction Set 47.2.1.  Extended Instruction Syntax 47.2.2.  Extended Instruction Set 47.2.3.  Byte-Oriented and Bit-Oriented Instructions in Indexed Literal Offset Mode 47.2.3.1.  Extended Instruction Syntax with Standard PIC18 Commands 47.2.4.  Considerations when Enabling the Extended Instruction Set 47.2.5.  Special Considerations with Microchip MPLAB® IDE Tools 48.  ICSP™ - In-Circuit Serial Programming™ 48.1.  High-Voltage Programming Entry Mode 48.2.  Low-Voltage Programming Entry Mode 48.3.  Common Programming Interfaces 49.  Register Summary 50.  Electrical Specifications 50.1.  Absolute Maximum Ratings 50.2.  Standard Operating Conditions 50.3.  DC Characteristics 50.3.1.  Supply Voltage 50.3.2.  Supply Current (IDD)(1) 50.3.3.  Power-Down Current (IPD)(1,2,3) 50.3.4.  I/O Ports 50.3.5.  Memory Programming Specifications 50.3.6.  Thermal Characteristics 50.4.  AC Characteristics 50.4.1.  External Clock/Oscillator Timing Requirements 50.4.2.  Internal Oscillator Parameters(1) 50.4.3.  PLL Specifications 50.4.4.  I/O and CLKOUT Timing Specifications 50.4.5.  Reset, WDT, Oscillator Start-Up Timer, Power-Up Timer, Brown-Out Reset and Low-Power Brown-Out Reset Specifications 50.4.6.  MVIO VDDIOx Low-Voltage Detect Characteristics 50.4.7.  High/Low-Voltage Detect Characteristics 50.4.8.  10-Bit Analog-to-Digital Converter (ADC) Accuracy Specifications(1,2) 50.4.9.  10-Bit Analog-to-Digital Converter (ADC) Conversion Timing Specifications 50.4.10.  8-Bit DAC Specifications 50.4.11.  Comparator Specifications 50.4.12.  Zero-Cross Detect (ZCD) Specifications 50.4.13.  Fixed Voltage Reference (FVR) Specifications 50.4.14.  Temperature Indicator Requirements 50.4.15.  Timer0 and Timer1 External Clock Requirements 50.4.16.  Capture/Compare/PWM Requirements (CCP) 50.4.17.  SPI Mode Requirements 50.4.18.  I2C Bus Start/Stop Bits Requirements 50.4.19.  I2C Bus Data Requirements 50.4.20.  Configurable Logic Cell (CLC) Characteristics 50.4.21.  Configurable Logic Block (CLB) Characteristics 51.  DC and AC Characteristics Graphs and Tables 52.  Packaging Information 52.1.  Package Details 53.  Appendix A: Revision History Product Identification System Microchip Information Trademarks Legal Notice Microchip Devices Code Protection Feature Product Page Links