PIC24FJ64GB004 FAMILY
Analog Features:
• 10-Bit, up to 13-Channel Analog-to-Digital (A/D)
Converter:
- 500 ksps conversion rate
- Conversion available during Sleep and Idle
• Three Analog Comparators with Programmable
Input/Output Configuration
• Charge Time Measurement Unit (CTMU):
- Supports capacitive touch sensing for touch
screens and capacitive switches
- Provides high-resolution time measurement and
simple temperature sensing
Peripheral Features:
• Peripheral Pin Select:
- Allows independent I/O mapping of many peripherals
- Up to 25 available pins (44-pin devices)
- Continuous hardware integrity checking and safety
interlocks prevent unintentional configuration changes
• 8-Bit Parallel Master Port (PMP/PSP):
- Up to 16-bit multiplexed addressing, with up to
11 dedicated address pins on 44-pin devices
- Programmable polarity on control lines
- Supports legacy Parallel Slave Port
Pin Diagrams
28-Pin SPDIP, SOIC, SSOP(1)
• Hardware Real-Time Clock/Calendar (RTCC):
- Provides clock, calendar and alarm functions
- Functions even in Deep Sleep mode
• Two 3-Wire/4-Wire SPI modules (support 4 Frame
modes) with 8-Level FIFO Buffer
• Two I2C™ modules support Multi-Master/Slave mode
and 7-Bit/10-Bit Addressing
• Two UART modules:
- Supports RS-485, RS-232 and LIN/J2602
- On-chip hardware encoder/decoder for IrDA®
- Auto-wake-up on Start bit
- Auto-Baud Detect (ABD)
- 4-level deep FIFO buffer
• Five 16-Bit Timers/Counters with Programmable
Prescaler
• Five 16-Bit Capture Inputs, each with a Dedicated Time
Base
• Five 16-Bit Compare/PWM Outputs, each with a
Dedicated Time Base
• Programmable, 32-Bit Cyclic Redundancy Check (CRC)
Generator
• Configurable Open-Drain Outputs on Digital I/O Pins
• Up to 3 External Interrupt Sources
MCLR
PGED3/AN0/C3INC/VREF+/ASDA1(2)/RP5/PMD7/CTED1/VBUSVLD/VCMPST1/CN2/RA0
PGEC3/AN1/C3IND/VREF-/ASCL1(2)/RP6/PMD6/CTED2/SESSVLD/VCMPST2/CN3/RA1
PGED1/AN2/C2INB/DPH/RP0/PMD0/CN4/RB0
PGEC1/AN3/C2INA/DMH/RP1/PMD1/CN5/RB1
AN4/C1INB/DPLN/SDA2/RP2/PMD2/CN6/RB2
AN5/C1INA/DMLN/RTCC/SCL2/RP3/PMWR/CN7/RB3
VSS
OSCI/CLKI/C1IND/PMCS1/CN30/RA2
OSCO/CLKO/PMA0/CN29/RA3
SOSCI/C2IND/RP4/PMBE/CN1/RB4
SOSCO/SCLKI/T1CK/C2INC/PMA1/CN0/RA4
VDD
TMS/USBID/CN27/RB5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
28 VDD
27 VSS
26 AN9/C3INA/VBUSCHG/RP15/VBUSST/CN11/RB15
25 AN10/C3INB/CVREF/VCPCON/VBUSON/RP14/CN12/RB14
24 AN11/C1INC/RP13/PMRD/REFO/SESSEND/CN13/RB13
23 VUSB
22 PGEC2/D-/VMIO/RP11/CN15/RB11
21 PGED2/D+/VPIO/RP10/CN16/RB10
20 VCAP/VDDCORE
19 DISVREG
18 TDO/SDA1/RP9/PMD3/RCV/CN21/RB9
17 TCK/USBOEN/SCL1/RP8/PMD4/CN22/RB8
16 TDI/RP7/PMD5/INT0/CN23/RB7
15 VBUS
Legend:
Note 1:
2:
RPn represents remappable peripheral pins.
Gray shading indicates 5.5V tolerant input pins.
Alternative multiplexing for SDA1 and SCL1 when the I2C1SEL bit is set.
DS39940D-page 4
2010 Microchip Technology Inc.
PIC24FJ64GB004 FAMILY
Table of Contents
1.0 Device Overview .......................................................................................................................................................................... 9
2.0 Guidelines for Getting Started with 16-bit Microcontrollers ........................................................................................................ 19
3.0 CPU ........................................................................................................................................................................................... 25
4.0 Memory Organization ................................................................................................................................................................. 31
5.0 Flash Program Memory.............................................................................................................................................................. 55
6.0 Resets ........................................................................................................................................................................................ 63
7.0 Interrupt Controller ..................................................................................................................................................................... 69
8.0 Oscillator Configuration ............................................................................................................................................................ 107
9.0 Power-Saving Features............................................................................................................................................................ 117
10.0 I/O Ports ................................................................................................................................................................................... 127
11.0 Timer1 ...................................................................................................................................................................................... 149
12.0 Timer2/3 and Timer4/5 ............................................................................................................................................................ 151
13.0 Input Capture with Dedicated Timers ....................................................................................................................................... 157
14.0 Output Compare with Dedicated Timers .................................................................................................................................. 161
15.0 Serial Peripheral Interface (SPI)............................................................................................................................................... 171
16.0 Inter-Integrated Circuit (I2C™) ................................................................................................................................................. 181
17.0 Universal Asynchronous Receiver Transmitter (UART) ........................................................................................................... 189
18.0 Universal Serial Bus with On-The-Go Support (USB OTG) ..................................................................................................... 197
19.0 Parallel Master Port (PMP)....................................................................................................................................................... 231
20.0 Real-Time Clock and Calendar (RTCC) .................................................................................................................................. 241
21.0 32-Bit Programmable Cyclic Redundancy Check (CRC) Generator ........................................................................................ 253
22.0 10-Bit High-Speed A/D Converter ............................................................................................................................................ 259
23.0 Triple Comparator Module........................................................................................................................................................ 269
24.0 Comparator Voltage Reference................................................................................................................................................ 273
25.0 Charge Time Measurement Unit (CTMU) ................................................................................................................................ 275
26.0 Special Features ...................................................................................................................................................................... 279
27.0 Development Support............................................................................................................................................................... 293
28.0 Instruction Set Summary .......................................................................................................................................................... 297
29.0 Electrical Characteristics .......................................................................................................................................................... 305
30.0 Packaging Information.............................................................................................................................................................. 327
Appendix A: Revision History............................................................................................................................................................. 341
The Microchip Web Site ..................................................................................................................................................................... 349
Customer Change Notification Service .............................................................................................................................................. 349
Customer Support .............................................................................................................................................................................. 349
Reader Response .............................................................................................................................................................................. 350
Product Identification System ............................................................................................................................................................ 351
2010 Microchip Technology Inc.
DS39940D-page 7