PIC24FJ64GA004 FAMILY
28/44-Pin General Purpose, 16-Bit Flash Microcontrollers
High-Performance CPU
• Modified Harvard Architecture
• Up to 16 MIPS Operation @ 32 MHz
• 8 MHz Internal Oscillator with 4x PLL Option and
Multiple Divide Options
• 17-Bit by 17-Bit Single-Cycle Hardware Multiplier
• 32-Bit by 16-Bit Hardware Divider
• 16-Bit x 16-Bit Working Register Array
• C Compiler Optimized Instruction Set Architecture:
- 76 base instructions
- Flexible addressing modes
• Two Address Generation Units (AGUs) for Separate
Read and Write Addressing of Data Memory
Analog Features
• 10-Bit, up to 13-Channel Analog-to-Digital Converter:
- 500 ksps conversion rate
- Conversion available during Sleep and Idle
• Dual Analog Comparators with Programmable
Input/Output Configuration
Peripheral Features
• Peripheral Pin Select (PPS):
- Allows independent I/O mapping of many peripherals
- Up to 26 available pins (44-pin devices)
- Continuous hardware integrity checking and safety
interlocks prevent unintentional configuration changes
• 8-Bit Parallel Master/Slave 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
• Hardware Real-Time Clock/Calendar (RTCC):
- Provides clock, calendar and alarm functions
• Programmable Cyclic Redundancy Check (CRC)
• Two 3-Wire/4-Wire SPI modules (support 4 Frame
modes) with 8-Level FIFO Buffer
• Two I
2
C™ 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
- 4-level deep FIFO buffer
• Five 16-Bit Timers/Counters with Programmable Prescaler
• Five 16-Bit Capture Inputs
• Five 16-Bit Compare/PWM Outputs
• Configurable Open-Drain Outputs on Digital I/O Pins
• Up to 3 External Interrupt Sources
Special Microcontroller Features
•
•
•
•
Operating Voltage Range of 2.0V to 3.6V
5.5V Tolerant Input (digital pins only)
High-Current Sink/Source (18 mA/18 mA) on All I/O Pins
Flash Program Memory:
- 10,000 erase/write
- 20-year data retention minimum
Power Management modes:
- Sleep, Idle, Doze and Alternate Clock modes
- Operating current: 650
A/MIPS,
typical at 2.0V
- Sleep current: 150 nA, typical at 2.0V
Fail-Safe Clock Monitor (FSCM) Operation:
- Detects clock failure and switches to on-chip,
low-power RC oscillator
On-Chip, 2.5V Regulator with Tracking mode
Power-on Reset (POR), Power-up Timer (PWRT)
and Oscillator Start-up Timer (OST)
Flexible Watchdog Timer (WDT) with On-Chip,
Low-Power RC Oscillator for Reliable Operation
In-Circuit Serial Programming™ (ICSP™) and
In-Circuit Debug (ICD) via 2 Pins
JTAG Boundary Scan Support
•
•
•
•
•
•
•
Comparators
Remappable Peripherals
10-Bit A/D
(ch)
Program
Memory
(bytes)
Remappable
Pins
SRAM
(bytes)
Compare/
PWM
Output
Device
UART w/
IrDA
®
Capture
Input
Timers
16-Bit
I
2
C™
Pins
PMP/PSP
Y
Y
Y
Y
Y
Y
Y
Y
PIC24FJ16GA002
PIC24FJ32GA002
PIC24FJ48GA002
PIC24FJ64GA002
PIC24FJ16GA004
PIC24FJ32GA004
PIC24FJ48GA004
PIC24FJ64GA004
28
28
28
28
44
44
44
44
16K
32K
48K
64K
16K
32K
48K
64K
4K
8K
8K
8K
4K
8K
8K
8K
16
16
16
16
26
26
26
26
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
2
2
2
2
2
2
2
2
SPI
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
10
10
10
10
13
13
13
13
2
2
2
2
2
2
2
2
2010-2013 Microchip Technology Inc.
DS39881E-page 1
JTAG
Y
Y
Y
Y
Y
Y
Y
Y
PIC24FJ64GA004 FAMILY
Pin Diagrams
28-Pin SPDIP, SSOP, SOIC
MCLR
AN0/V
REF
+/CN2/RA0
AN1/V
REF
-/CN3/RA1
PGED1/AN2/C2IN-/RP0/CN4/RB0
PGEC1/AN3/C2IN+/RP1/CN5/RB1
AN4/C1IN-/SDA2/RP2/CN6/RB2
AN5/C1IN+/SCL2/RP3/CN7/RB3
V
SS
OSCI/CLKI/CN30/RA2
OSCO/CLKO/CN29/PMA0/RA3
SOSCI/RP4/PMBE/CN1/RB4
SOSCO/T1CK/CN0/PMA1/RA4
V
DD
PGED3/ASDA1/RP5/CN27/PMD7/RB5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
28
27
26
25
24
23
22
21
20
19
18
17
16
15
V
DD
V
SS
AN9/RP15/CN11/PMCS1/RB15
AN10/CV
REF
/RTCC/RP14/CN12/PMWR/RB14
AN11/RP13/CN13/PMRD/RB13
AN12/RP12/CN14/PMD0/RB12
PGEC2/TMS/RP11/CN15/PMD1/RB11
PGED2/TDI/RP10/CN16/PMD2/RB10
V
CAP
/V
DDCORE
DISVREG
TDO/SDA1/RP9/CN21/PMD3/RB9
TCK/SCL1/RP8/CN22/PMD4/RB8
RP7/INT0/CN23/PMD5/RB7
PGEC3/ASCL1/RP6/CN24/PMD6/RB6
PGED1/AN2/C2IN-/RP0/CN4/RB0
PGEC1/AN3/C2IN+/RP1/CN5/RB1
AN4/C1IN-/SDA2/RP2/CN6/RB2
AN5/C1IN+/SCL2/RP3/CN7/RB3
V
SS
OSCI/CLKI/CN30/RA2
OSCO/CLKO/CN29/PMA0/RA3
28 27 26 25 24 23 22
1
21
2
20
3
19
4
PIC24FJXXGA002
18
5
17
6
16
7
15
8 9 10 11 12 13 14
SOSCI/RP4/PMBE/CN1/RB4
SOSCO/T1CK/CN0/PMA1/RA4
V
DD
PGED3/ASDA1/RP5/CN27/PMD7/RB5
PGEC3/ASCL1/RP6/CN24/PMD6/RB6
RP7/INT0/CN23/PMD5/RB7
TCK/SCL1/RP8/CN22/PMD4/RB8
AN1/V
REF
-/CN3/RA1
AN0/V
REF
+/CN2/RA0
MCLR
V
DD
V
SS
AN9/RP15/CN11/PMCS1/RB15
AN10/CV
REF
/RTCC/RP14/CN12/PMWR/RB14
28-Pin QFN
(1)
PIC24FJXXGA002
AN11/RP13/CN13/PMRD/RB13
AN12/RP12/CN14/PMD0/RB12
PGEC2/TMS/RP11/CN15/PMD1/RB11
PGED2/TDI/RP10/CN16/PMD2/RB10
V
CAP
/V
DDCORE
DISVREG
TDO/SDA1/RP9/CN21/PMD3/RB9
Legend:
Note 1:
RPn
represents remappable peripheral pins. Gray shading indicates 5.5V tolerant input pins.
Back pad on QFN devices should be connected to Vss.
DS39881E-page 2
2010-2013 Microchip Technology Inc.
PIC24FJ64GA004 FAMILY
Pin Diagrams (Continued)
44-Pin QFN
(1)
44
43
42
41
40
39
38
37
36
35
34
SDA1/RP9/CN21/PMD3/RB9
RP22/CN18/PMA1/RC6
RP23/CN17/PMA0/RC7
RP24/CN20/PMA5/RC8
RP25/CN19/PMA6/RC9
DISVREG
V
CAP
/V
DDCORE
PGED2/RP10/CN16/PMD2/RB10
PGEC2/RP11/CN15/PMD1/RB11
AN12/RP12/CN14/PMD0/RB12
AN11/RP13/CN13/PMRD/RB13
1
2
3
4
5
6
7
8
9
10
11
SCL1/RP8/CN22/PMD4/RB8
RP7/INT0/CN23/PMD5/RB7
PGEC3/ASCL1/RP6/CN24/PMD6/RB6
PGED3/ASDA1/RP5/CN27/PMD7/RB5
V
DD
V
SS
RP21/CN26/PMA3/RC5
RP20/CN25/PMA4/RC4
RP19/CN28/PMBE/RC3
TDI/PMA9/RA9
SOSCO/T1CK/CN0/RA4
PIC24FJXXGA004
Legend:
Note 1:
RPn
represents remappable peripheral pins. Gray shading indicates 5.5V tolerant input pins.
Back pad on QFN devices should be connected to Vss.
2010-2013 Microchip Technology Inc.
TMS/PMA10/RA10
TCK/PMA7/RA7
AN10/CV
REF
/RTCC/RP14/CN12/PMWR/RB14
AN9/RP15/CN11/PMCS1/RB15
AV
SS
AV
DD
MCLR
AN0/V
REF
+/CN2/RA0
AN1/V
REF
-/CN3/RA1
PGED1/AN2/C2IN-/RP0/CN4/RB0
PGEC1/AN3/C2IN+/RP1/CN5/RB1
12
13
14
15
16
17
18
19
20
21
22
33
32
31
30
29
28
27
26
25
24
23
SOSCI/RP4/CN1/RB4
TDO/PMA8/RA8
OSCO/CLKO/CN29/RA3
OSCI/CLKI/CN30/RA2
V
SS
V
DD
AN8/RP18/CN10/PMA2/RC2
AN7/RP17/CN9/RC1
AN6/RP16/CN8/RC0
AN5/C1IN+/SCL2/RP3/CN7/RB3
AN4/C1IN-/SDA2/RP2/CN6/RB2
DS39881E-page 3
PIC24FJ64GA004 FAMILY
Pin Diagrams (Continued)
44-Pin TQFP
SCL1/RP8/CN22/PMD4/RB8
RP7/INT0/CN23/PMD5/RB7
PGEC3/RP6/ASCL1/CN24/PMD6/RB6
PGED3/RP5/ASDA1/CN27/PMD7/RB5
V
DD
V
SS
RP21/CN26/PMA3/RC5
RP20/CN25/PMA4/RC4
RP19/CN28/PMBE/RC3
TDI/PMA9/RA9
SOSCO/T1CK/CN0/RA4
SDA1/RP9/CN21/PMD3/RB9
RP22/CN18/PMA1/RC6
RP23/CN17/PMA0/RC7
RP24/CN20/PMA5/RC8
RP25/CN19/PMA6/RC9
DISVREG
V
CAP
/V
DDCORE
PGED2/RP10/CN16/PMD2/RB10
PGEC2/RP11/CN15/PMD1/RB11
AN12/RP12/CN14/PMD0/RB12
AN11/RP13/CN13/PMRD/RB13
44
43
42
41
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
Legend:
RPn
represents remappable peripheral pins. Gray shading indicates 5.5V tolerant input pins.
TMS/PMA10/RA10
TCK/PMA7/RA7
REF
/RTCC/RP14/CN12/PMWR/RB14
AN10/CV
AN9/RP15/CN11/PMCS1/RB15
AV
SS
AV
DD
MCLR
AN0/V
REF
+/CN2/RA0
AN1/V
REF
-/CN3/RA1
PGED1/AN2/C2IN-/RP0/CN4/RB0
PGEC1/AN3/C2IN+/RP1/CN5/RB1
12
13
14
15
16
17
18
19
20
21
22
1
2
3
4
5
6
7
8
9
10
11
PIC24FJXXGA004
SOSCI/RP4/CN1/RB4
TDO/PMA8/RA8
OSCO/CLKO/CN29/RA3
OSCI/CLKI/CN30/RA2
V
SS
V
DD
AN8/RP18/CN10/PMA2/RC2
AN7/RP17/CN9/RC1
AN6/RP16/CN8/RC0
AN5/C1IN+/SCL2/RP3/CN7/RB3
AN4/C1IN-/SDA2/RP2/CN6/RB2
DS39881E-page 4
2010-2013 Microchip Technology Inc.
PIC24FJ64GA004 FAMILY
Table of Contents
1.0 Device Overview .......................................................................................................................................................................... 7
2.0 Guidelines for Getting Started with 16-Bit Microcontrollers........................................................................................................ 17
3.0 CPU ........................................................................................................................................................................................... 23
4.0 Memory Organization ................................................................................................................................................................. 29
5.0 Flash Program Memory.............................................................................................................................................................. 47
6.0 Resets ........................................................................................................................................................................................ 53
7.0 Interrupt Controller ..................................................................................................................................................................... 59
8.0 Oscillator Configuration .............................................................................................................................................................. 95
9.0 Power-Saving Features............................................................................................................................................................ 103
10.0 I/O Ports ................................................................................................................................................................................... 105
11.0 Timer1 ..................................................................................................................................................................................... 125
12.0 Timer2/3 and Timer4/5 ............................................................................................................................................................ 127
13.0 Input Capture............................................................................................................................................................................ 133
14.0 Output Compare....................................................................................................................................................................... 135
15.0 Serial Peripheral Interface (SPI)............................................................................................................................................... 141
16.0 Inter-Integrated Circuit (I
2
C™) ................................................................................................................................................. 151
17.0 Universal Asynchronous Receiver Transmitter (UART) ........................................................................................................... 159
18.0 Parallel Master Port (PMP)....................................................................................................................................................... 167
19.0 Real-Time Clock and Calendar (RTCC) .................................................................................................................................. 177
20.0 Programmable Cyclic Redundancy Check (CRC) Generator .................................................................................................. 189
21.0 10-Bit High-Speed A/D Converter ............................................................................................................................................ 193
22.0 Comparator Module.................................................................................................................................................................. 203
23.0 Comparator Voltage Reference................................................................................................................................................ 207
24.0 Special Features ...................................................................................................................................................................... 209
25.0 Development Support............................................................................................................................................................... 219
26.0 Instruction Set Summary .......................................................................................................................................................... 223
27.0 Electrical Characteristics .......................................................................................................................................................... 231
28.0 Packaging Information.............................................................................................................................................................. 251
Appendix A: Revision History............................................................................................................................................................. 267
Appendix B: Additional Guidance for PIC24FJ64GA004 Family Applications ................................................................................... 268
Index ................................................................................................................................................................................................. 269
The Microchip Web Site ..................................................................................................................................................................... 273
Customer Change Notification Service .............................................................................................................................................. 273
Customer Support .............................................................................................................................................................................. 273
Reader Response .............................................................................................................................................................................. 274
Product Identification System ............................................................................................................................................................ 275
2010-2013 Microchip Technology Inc.
DS39881E-page 5