PIC24FJ64GA104 39951c
PIC24FJ64GA104 39951c
PIC24FJ64GA104 39951c
Data Sheet
28/44-Pin, 16-Bit General Purpose
Flash Microcontrollers
with nanoWatt XLP Technology
• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
ISBN:978-1-60932-440-7
Microchip received ISO/TS-16949:2002 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
Tempe, Arizona; Gresham, Oregon and design centers in California
and India. The Company’s quality system processes and procedures
are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping
devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.
Remappable Peripherals
Program Memory
Comparators
Compare/PWM
10-Bit A/D
PMP/PSP
Remappable
(Bytes)
(Bytes)
SRAM
CTMU
RTCC
I2C™
UART w/
PIC24FJ
Pins
Capture
(ch)
Output
Timers
16-Bit
IrDA®
Input
Pins
SPI
Device
32GA102 28 32K 8K 16 5 5 5 2 2 2 10 3 Y Y Y
64GA102 28 64K 8K 16 5 5 5 2 2 2 10 3 Y Y Y
32GA104 44 32K 8K 26 5 5 5 2 2 2 13 3 Y Y Y
64GA104 44 64K 8K 26 5 5 5 2 2 2 13 3 Y Y Y
Pin Diagrams
MCLR 1 28 VDD
AN0/C3INC/VREF+/CN2/CTED1/RA0 2 27 VSS
AN1/C3IND/VREF-/CN3/CTED2/RA1 3 26 AN9/C3INA/RP15/CN11/PMCS1/RB15
PIC24FJXXGA102
PGED1/AN2/C2INB/RP0/CN4/RB0 4 25 AN10/C3INB/CVREF/RTCC/RP14/CN12/PMWR/RB14
PGEC1/AN3/C2INA/RP1/CN5/RB1 5 24 AN11/C1INC/RP13/CN13/PMRD/REFO/RB13
AN4/C1INB/RP2/SDA2/CN6/RB2 6 23 AN12/RP12/CN14/PMD0/RB12
AN5/C1INA/RP3/SCL2/CN7/RB3 7 22 PGEC2/TMS/RP11/CN15/PMD1/RB11
VSS 8 21 PGED2/TDI/RP10/CN16/PMD2/RB10
OSCI/CLKI/C1IND/CN30/RA2 9 20 VCAP/VDDCORE
OSCO/CLKO/PMA0/CN29/RA3 10 19 DISVREG
SOSCI/C2IND/RP4/PMBE/CN1/RB4 11 18 TDO/RP9/SDA1/CN21/PMD3/RB9
SOSCO/SCLKI/T1CK/C2INC/CN0/PMA1/RA4 12 17 TCK/RP8/SCL1/CN22/PMD4/RB8
VDD 13 16 RP7/INT0/CN23/PMD5/RB7
PGED3/RP5/ASDA1(2)/CN27/PMD7/RB5 14 15 PGC3/EMUC3/RP6/ASCL1(2)/CN24/PMD6/RB6
AN10/C3INB/CVREF/RTCC/RP14/CN12/PMWR/RB14
28-Pin QFN(1,3)
AN9/C3INA/RP15/CN11/PMCS1/RB15
AN0/C3INC/VREF+/CN2/CTED1/RA0
AN1/C3IND/VREF-/CN3/CTED2/RA1
MCLR
VDD
VSS
28 27 26 25 24 23 22
PGED1/AN2/C2INB/RP0/CN4/RB0 1 21 AN11/C1INC/RP13/CN13/PMRD/REFO/RB13
PGEC1/AN3/C2INA/RP1/CN5/RB1 2 20 AN12/RP12/CN14/PMD0/RB12
AN4/C1INB/SDA2/RP2/CN6/RB2 3 19 PGEC2/TMS/RP11/CN15/PMD1/RB11
AN5/C1INA/SCL2/RP3/CN7/RB3 4 PIC24FJXXGA102 18 PGED2/TDI/RP10/CN16/PMD2/RB10
VSS 5 17 VCAP/VDDCORE
OSCI/CLKI/C1IND/CN30/RA2 6 16 DISVREG
OSCO/CLKO/CN29/PMA0/RA3 7 15 TDO/RP9/SDA1/CN21/PMD3/RB9
8 9 10 11 12 13 14
PGED3/RP5/ASDA1(2)/CN27/PMD7/RB5
PGEC3/RP6/ASCL1(2)/CN24/PMD6/RB6
SOSCI/C2IND/RP4/PMBE/CN1/RB4
RP7/INT0/CN23/PMD5/RB7
SOSCO/SCLKI/T1CK/C2INC/CN0/PMA1/RA4
VDD
TCK/RP8/SCL1/CN22/PMD4/RB8
PGED3/RP5/ASDA1(2)/CN27/PMD7/RB5
PGEC3/RP6/ASCL1(2)/CN24/PMD6/RB6
SOSCO/SCLKI/T1CK/C2INC/CN0/RA4
44-PIN TQFP,
44-Pin QFN(1,3)
RP8/SCL1/CN22/PMD4/RB8
RP7/INT0/CN23/PMD5/RB7
RP19/CN28/PMBE/RC3
RP21/CN26/PMA3/RC5
RP20/CN25/PMA4/RC4
TDI/PMA9/RA9
VDD
VSS
42
41
39
38
37
35
44
43
40
36
34
RP9/SDA1/CN21/PMD3/RB9 1 33 SOSCI/C1IND/RP4/CN1/RB4
RP22/CN18/PMA1/RC6 2 32 TDO/PMA8/RA8
RP23/CN17/PMA0/RC7 3 31 OSCO/CLKO/CN29/RA3
RP24/CN20/PMA5/RC8 4 30 OSCI/CLKI/C1IND/CN30/RA2
RP25/CN19/PMA6/RC9 5 29 VSS
DISVREG 6 PIC24FJXXGA104 28 VDD
VCAP/VDDCORE 7 27 AN8/RP18/PMA2/CN10/RC2
PGED2/RP10/CN16/PMD2/RB10 8 26 AN7/RP17/CN9/RC1
PGEC2/RP11/CN15/PMD1/RB11 9 25 AN6/RP16/CN8/RC0
AN12/RP12/CN14/PMD0/RB12 10 24 AN5/C1INA/RP3/SCL2/CN7/RB3
AN11/C1INC/RP13/PMRD/REFO/CN13/RB13 11 23 AN4/C1INB/RP2/SDA2/CN6/RB2
15
17
22
12
13
14
16
18
19
20
21
MCLR
AN10/C3INB/CVREF/RTCC/RP14/CN12/PMWR/RB14
AN0/C3INC/VREF+/CN2/CTED1/RA0
AN1/C3IND/VREF-/CN3/CTED2/RA1
TMS/PMA10/RA10
PGED1/AN2/C2INB/RP0/CN4/RB0
PGEC1/AN3/C2INA/RP1/CN5/RB1
TCK/PMA7/RA7
AN9/C3INA/RP15/CN11/RB15
AVDD
AVSS
Errata
An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current
devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision
of silicon and revision of document to which it applies.
To determine if an errata sheet exists for a particular device, please check with one of the following:
• Microchip’s Worldwide Web site; http://www.microchip.com
• Your local Microchip sales office (see last page)
When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are
using.
EA MUX 16
Address Bus
Literal Data
24 16 16
Inst Latch
RP(1)
Inst Register
RP0:RP25
Instruction
Decode &
Control
Divide
Control Signals Support
OSCO/CLKO 16 x 16
OSCI/CLKI W Reg Array
17 x 17
Timing Power-up Multiplier
Generation Timer
Oscillator
FRC/LPRC Start-up Timer
REFO
Oscillators 16-Bit ALU
Power-on
Reset
16
Precision
Band Gap Watchdog
Reference Timer
DISVREG BOR and
Voltage
Regulator LVD(2)
10-Bit
Timer1 Timer2/3(3) Timer4/5(3) RTCC Comparators(3)
ADC
PMP/PSP
Note 1: Not all I/O pins or features are implemented on all device pinout configurations. See Table 1-2 for specific implementations by pin count.
2: BOR functionality is provided when the on-board voltage regulator is enabled.
3: These peripheral I/Os are only accessible through remappable pins.
VDD
VSS
R1 (1) (1)
16-bit microcontrollers requires attention to a minimal R2
set of device pin connections before proceeding with (EN/DIS)VREG
MCLR
development. VCAP/VDDCORE
C1
The following pins must always be connected: C7
PIC24FXXXX
• All VDD and VSS pins
VDD
(see Section 2.2 “Power Supply Pins”) VSS
C6(2) C3(2)
• All AVDD and AVSS pins, regardless of whether or VSS
VDD
not the analog device features are used
AVDD
AVSS
VDD
VSS
(see Section 2.2 “Power Supply Pins”)
• MCLR pin
(see Section 2.3 “Master Clear (MCLR) Pin”)
C5(2) C4(2)
• ENVREG/DISVREG and VCAP/VDDCORE pins
(PIC24FJ devices only)
(see Section 2.4 “Voltage Regulator Pins
Key (all values are recommendations):
(ENVREG/DISVREG and VCAP/VDDCORE)”)
C1 through C6: 0.1 F, 20V ceramic
These pins must also be connected if they are being
C7: 10 F, 6.3V or greater, tantalum or ceramic
used in the end application:
R1: 10 kΩ
• PGECx/PGEDx pins used for In-Circuit Serial
R2: 100Ω to 470Ω
Programming™ (ICSP™) and debugging purposes
Note 1: See Section 2.4 “Voltage Regulator Pins
(see Section 2.5 “ICSP Pins”)
(ENVREG/DISVREG and VCAP/VDDCORE)”
• OSCI and OSCO pins when an external oscillator for explanation of ENVREG/DISVREG pin
source is used connections.
(see Section 2.6 “External Oscillator Pins”) 2: The example shown is for a PIC24F device
Additionally, the following pins may be required: with five VDD/VSS and AVDD/AVSS pairs.
Other devices may have more or less pairs;
• VREF+/VREF- pins used when external voltage adjust the number of decoupling capacitors
reference for analog modules is implemented appropriately.
Note: The AVDD and AVSS pins must always be
connected, regardless of whether any of
the analog modules are being used.
The minimum mandatory connections are shown in
Figure 2-1.
ESR ()
family) must always be connected directly to either a 0.1
similar noise).
OSCO
For additional information and design guidance on
oscillator circuits, please refer to these Microchip
C2
Application Notes, available at the corporate web site
Oscillator
(www.microchip.com): GND Crystal
• AN826, “Crystal Oscillator Basics and Crystal C1
Selection for rfPIC™ and PICmicro® Devices”
• AN849, “Basic PICmicro® Oscillator Design” OSCI
• AN943, “Practical PICmicro® Oscillator Analysis
and Design”
• AN949, “Making Your Oscillator Work”
DEVICE PINS
Data Bus
Interrupt
Controller
16
8 16 16
Data Latch
23
PCH PCL Data RAM 16
23
Program Counter
Stack Loop Address
Control Control Latch
Logic Logic
23 16
RAGU
Address Latch WAGU
Program Memory
Control Signals
to Various Blocks Hardware
Multiplier 16 x 16
W Register Array
Divide
Support 16
16-Bit ALU
16
To Peripheral Modules
W9
W10
W11
W12
W13
W14 Frame Pointer
W15 Stack Pointer 0
7 0
Table Memory Page
TBLPAG
Address Register
7 0
Program Space Visibility
PSVPAG Page Address Register
15 0
Repeat Loop Counter
RCOUNT
Register
15 SRH SRL 0
IPL
— — — — — — — DC
2 1 0 RA N OV Z C
ALU STATUS Register (SR)
15 0
— — — — — — — — — — — — IPL3 PSV — — CPU Control Register (CORCON)
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: The IPL Status bits are read-only when NSTDIS (INTCON1<15>) = 1.
2: The IPL Status bits are concatenated with the IPL3 bit (CORCON<3>) to form the CPU Interrupt Priority
Level (IPL). The value in parentheses indicates the IPL when IPL3 = 1.
3.3 Arithmetic Logic Unit (ALU) The PIC24F CPU incorporates hardware support for
both multiplication and division. This includes a
The PIC24F ALU is 16 bits wide and is capable of addi- dedicated hardware multiplier and support hardware
tion, subtraction, bit shifts and logic operations. Unless for 16-bit divisor division.
otherwise mentioned, arithmetic operations are 2’s
complement in nature. Depending on the operation, the 3.3.1 MULTIPLIER
ALU may affect the values of the Carry (C), Zero (Z),
The ALU contains a high-speed, 17-bit x 17-bit
Negative (N), Overflow (OV) and Digit Carry (DC)
multiplier. It supports unsigned, signed or mixed sign
Status bits in the SR register. The C and DC Status bits
operation in several multiplication modes:
operate as Borrow and Digit Borrow bits, respectively,
for subtraction operations. 1. 16-bit x 16-bit signed
The ALU can perform 8-bit or 16-bit operations, 2. 16-bit x 16-bit unsigned
depending on the mode of the instruction that is used. 3. 16-bit signed x 5-bit (literal) unsigned
Data for the ALU operation can come from the W 4. 16-bit unsigned x 16-bit unsigned
register array, or data memory, depending on the 5. 16-bit unsigned x 5-bit (literal) unsigned
addressing mode of the instruction. Likewise, output
6. 16-bit unsigned x 16-bit signed
data from the ALU can be written to the W register array
or a data memory location. 7. 8-bit unsigned x 8-bit unsigned
TABLE 3-2: INSTRUCTIONS THAT USE THE SINGLE AND MULTI-BIT SHIFT OPERATION
Instruction Description
ASR Arithmetic shift right source register by one or more bits.
SL Shift left source register by one or more bits.
LSR Logical shift right source register by one or more bits.
FIGURE 4-1: PROGRAM SPACE MEMORY MAP FOR PIC24FJ64GA104 FAMILY DEVICES
PIC24FJ32GA10X PIC24FJ64GA10X
Unimplemented
Read ‘0’
7FFFFFh
800000h
Reserved Reserved
Configuration Memory Space
F7FFFEh
F80000h
Device Config Registers Device Config Registers
F8000Eh
F80010h
Reserved Reserved
FEFFFEh
FF0000h
DEVID (2) DEVID (2)
FFFFFFh
FIGURE 4-3: DATA SPACE MEMORY MAP FOR PIC24FJ64GA104 FAMILY DEVICES
MSB LSB
Address MSB LSB Address
0001h 0000h SFR
SFR Space
07FFh 07FEh Space
Near
0801h 0800h Data Space
1FFFh Data RAM 1FFEh
Implemented
2001h 2000h
Data RAM
27FFh 27FEh
2801h 2800h
Unimplemented
Read as ‘0’
7FFFh 7FFFh
8001h 8000h
Program Space
Visibility Area
FFFFh FFFEh
File All
Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Name Resets
PIC24FJ64GA104 FAMILY
WREG14 001C Working Register 14 0000
WREG15 001E Working Register 15 0800
SPLIM 0020 Stack Pointer Limit Value Register xxxx
PCL 002E Program Counter Low Word Register 0000
PCH 0030 — — — — — — — — Program Counter Register High Byte 0000
TBLPAG 0032 — — — — — — — — Table Memory Page Address Register 0000
PSVPAG 0034 — — — — — — — — Program Space Visibility Page Address Register 0000
RCOUNT 0036 Repeat Loop Counter Register xxxx
SR 0042 — — — — — — — DC IPL2 IPL1 IPL0 RA N OV Z C 0000
CORCON 0044 — — — — — — — — — — — — IPL3 PSV — — 0000
DISICNT 0052 — — Disable Interrupts Counter Register xxxx
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
DS39951C-page 35
TABLE 4-4: ICN REGISTER MAP
DS39951C-page 36
PIC24FJ64GA104 FAMILY
File All
Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Name Resets
CNEN1 0060 CN15IE CN14IE CN13IE CN12IE CN11IE CN10IE(1) CN9IE(1) CN8IE(1) CN7IE CN6IE CN5IE CN4IE CN3IE CN2IE CN1IE CN0IE 0000
(1) (1) (1)
CNEN2 0062 — CN30IE CN29IE CN28IE CN27IE CN26IE CN25IE CN24IE CN23IE CN22IE CN21IE CN20IE(1) CN19IE(1) CN18IE(1) CN17IE(1) CN16IE 0000
CNPU1 0068 CN15PUE CN14PUE CN13PUE CN12PUE CN11PUE CN10PUE(1) CN9PUE(1) CN8PUE(1) CN7PUE CN6PUE CN5PUE CN4PUE CN3PUE CN2PUE CN1PUE CN0PUE 0000
CNPU2 006A — CN30PUE CN29PUE CN28PUE(1) CN27PUE CN26PUE(1) CN25PUE(1) CN24PUE CN23PUE CN22PUE CN21PUE CN20PUE(1) CN19PUE(1) CN18PUE(1) CN17PUE(1) CN16PUE 0000
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1: Unimplemented in 28-pin devices; read as ‘0’.
2010 Microchip Technology Inc.
TABLE 4-5: INTERRUPT CONTROLLER REGISTER MAP
2010 Microchip Technology Inc.
All
File Name Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Resets
PIC24FJ64GA104 FAMILY
IPC3 00AA — — — — — — — — — AD1IP2 AD1IP1 AD1IP0 — U1TXIP2 U1TXIP1 U1TXIP0 0044
IPC4 00AC — CNIP2 CNIP1 CNIP0 — CMIP2 CMIP1 CMIP0 — MI2C1IP2 MI2C1IP1 MI2C1IP0 — SI2C1IP2 SI2C1IP1 SI2C1IP0 4444
IPC5 00AE — — — — — — — — — — — — — INT1IP2 INT1IP1 INT1IP0 0004
IPC6 00B0 — T4IP2 T4IP1 T4IP0 — OC4IP2 OC4IP1 OC4IP0 — OC3IP2 OC3IP1 OC3IP0 — — — — 4440
IPC7 00B2 — U2TXIP2 U2TXIP1 U2TXIP0 — U2RXIP2 U2RXIP1 U2RXIP0 — INT2IP2 INT2IP1 INT2IP0 — T5IP2 T5IP1 T5IP0 4444
IPC8 00B4 — — — — — — — — — SPI2IP2 SPI2IP1 SPI2IP0 — SPF2IP2 SPF2IP1 SPF2IP0 0044
IPC9 00B6 — IC5IP2 IC5IP1 IC5IP0 — IC4IP2 IC4IP1 IC4IP0 — IC3IP2 IC3IP1 IC3IP0 — — — — 4440
IPC10 00B8 — — — — — — — — — OC5IP2 OC5IP1 OC5IP0 — — — — 0040
IPC11 00BA — — — — — — — — — PMPIP2 PMPIP1 PMPIP0 — — — — 0040
IPC12 00BC — — — — — MI2C2IP2 MI2C2IP1 MI2C2IP0 — SI2C2IP2 SI2C2IP1 SI2C2IP0 — — — — 0440
IPC15 00C2 — — — — — RTCIP2 RTCIP1 RTCIP0 — — — — — — — — 0400
IPC16 00C4 — CRCIP2 CRCIP1 CRCIP0 — U2ERIP2 U2ERIP1 U2ERIP0 — U1ERIP2 U1ERIP1 U1ERIP0 — — — — 4440
IPC18 00C8 — — — — — — — — — — — — — LVDIP2 LVDIP1 LVDIP0 0004
IPC19 00CA — — — — — — — — — CTMUIP2 CTMUIP1 CTMUIP0 — — — — 0040
INTTREG 00E0 CPUIRQ — VHOLD — ILR3 ILR2 ILR1 ILR0 — VECNUM6 VECNUM5 VECNUM4 VECNUM3 VECNUM2 VECNUM1 VECNUM0 0000
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
DS39951C-page 37
TABLE 4-6: TIMER REGISTER MAP
DS39951C-page 38
PIC24FJ64GA104 FAMILY
All
File Name Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Resets
File All
Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Name Resets
IC1CON1 0140 — — ICSIDL ICTSEL2 ICTSEL1 ICTSEL0 — — — ICI1 ICI0 ICOV ICBNE ICM2 ICM1 ICM0 0000
IC1CON2 0142 — — — — — — — IC32 ICTRIG TRIGSTAT — SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000D
IC1BUF 0144 Input Capture 1 Buffer Register 0000
IC1TMR 0146 Timer Value 1 Register xxxx
IC2CON1 0148 — — ICSIDL ICTSEL2 ICTSEL1 ICTSEL0 — — — ICI1 ICI0 ICOV ICBNE ICM2 ICM1 ICM0 0000
IC2CON2 014A — — — — — — — IC32 ICTRIG TRIGSTAT — SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000D
IC2BUF 014C Input Capture 2 Buffer Register 0000
IC2TMR 014E Timer Value 2 Register xxxx
IC3CON1 0150 — — ICSIDL ICTSEL2 ICTSEL1 ICTSEL0 — — — ICI1 ICI0 ICOV ICBNE ICM2 ICM1 ICM0 0000
IC3CON2 0152 — — — — — — — IC32 ICTRIG TRIGSTAT — SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000D
IC3BUF 0154 Input Capture 3 Buffer Register 0000
IC3TMR 0156 Timer Value 3 Register xxxx
IC4CON1 0158 — — ICSIDL ICTSEL2 ICTSEL1 ICTSEL0 — — — ICI1 ICI0 ICOV ICBNE ICM2 ICM1 ICM0 0000
IC4CON2 015A — — — — — — — IC32 ICTRIG TRIGSTAT — SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000D
IC4BUF 015C Input Capture 4 Buffer Register 0000
PIC24FJ64GA104 FAMILY
IC4TMR 015E Timer Value 4 Register xxxx
IC5CON1 0160 — — ICSIDL ICTSEL2 ICTSEL1 ICTSEL0 — — — ICI1 ICI0 ICOV ICBNE ICM2 ICM1 ICM0 0000
IC5CON2 0162 — — — — — — — IC32 ICTRIG TRIGSTAT — SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000D
IC5BUF 0164 Input Capture 5 Buffer Register 0000
IC5TMR 0166 Timer Value 5 Register xxxx
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
DS39951C-page 39
TABLE 4-8: OUTPUT COMPARE REGISTER MAP
DS39951C-page 40
PIC24FJ64GA104 FAMILY
All
File Name Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Resets
OC1CON1 0190 — — OCSIDL OCTSEL2 OCTSEL1 OCTSEL0 ENFLT2 ENFLT1 ENFLT0 OCFLT2 OCFLT1 OCFLT0 TRIGMODE OCM2 OCM1 OCM0 0000
OC1CON2 0192 FLTMD FLTOUT FLTTRIEN OCINV — DCB1 DCB0 OC32 OCTRIG TRIGSTAT OCTRIS SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000C
OC1RS 0194 Output Compare 1 Secondary Register 0000
OC1R 0196 Output Compare 1 Register 0000
OC1TMR 0198 Timer Value 1 Register xxxx
OC2CON1 019A — — OCSIDL OCTSEL2 OCTSEL1 OCTSEL0 ENFLT2 ENFLT1 ENFLT0 OCFLT2 OCFLT1 OCFLT0 TRIGMODE OCM2 OCM1 OCM0 0000
OC2CON2 019C FLTMD FLTOUT FLTTRIEN OCINV — DCB1 DCB0 OC32 OCTRIG TRIGSTAT OCTRIS SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000C
OC2RS 019E Output Compare 2 Secondary Register 0000
OC2R 01A0 Output Compare 2 Register 0000
OC2TMR 01A2 Timer Value 2 Register xxxx
OC3CON1 01A4 — — OCSIDL OCTSEL2 OCTSEL1 OCTSEL0 ENFLT2 ENFLT1 ENFLT0 OCFLT2 OCFLT1 OCFLT0 TRIGMODE OCM2 OCM1 OCM0 0000
OC3CON2 01A6 FLTMD FLTOUT FLTTRIEN OCINV — DCB1 DCB0 OC32 OCTRIG TRIGSTAT OCTRIS SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000C
OC3RS 01A8 Output Compare 3 Secondary Register 0000
OC3R 01AA Output Compare 3 Register 0000
OC3TMR 01AC Timer Value 3 Register xxxx
OC4CON1 01AE — — OCSIDL OCTSEL2 OCTSEL1 OCTSEL0 ENFLT2 ENFLT1 ENFLT0 OCFLT2 OCFLT1 OCFLT0 TRIGMODE OCM2 OCM1 OCM0 0000
OC4CON2 01B0 FLTMD FLTOUT FLTTRIEN OCINV — DCB1 DCB0 OC32 OCTRIG TRIGSTAT OCTRIS SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000C
OC4RS 01B2 Output Compare 4 Secondary Register 0000
OC4R 01B4 Output Compare 4 Register 0000
OC4TMR 01B6 Timer Value 4 Register xxxx
OC5CON1 01B8 — — OCSIDL OCTSEL2 OCTSEL1 OCTSEL0 ENFLT2 ENFLT1 ENFLT0 OCFLT2 OCFLT1 OCFLT0 TRIGMODE OCM2 OCM1 OCM0 0000
OC5CON2 01BA FLTMD FLTOUT FLTTRIEN OCINV — DCB1 DCB0 OC32 OCTRIG TRIGSTAT OCTRIS SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000C
OC5RS 01BC Output Compare 5 Secondary Register 0000
OC5R 01BE Output Compare 5 Register 0000
OC5TMR 01C0 Timer Value 5 Register xxxx
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
2010 Microchip Technology Inc.
TABLE 4-9: I2C™ REGISTER MAP
2010 Microchip Technology Inc.
All
File Name Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Resets
PIC24FJ64GA104 FAMILY
TABLE 4-10: UART REGISTER MAPS
All
File Name Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Resets
U1MODE 0220 UARTEN — USIDL IREN RTSMD — UEN1 UEN0 WAKE LPBACK ABAUD RXINV BRGH PDSEL1 PDSEL0 STSEL 0000
U1STA 0222 UTXISEL1 UTXINV UTXISEL0 — UTXBRK UTXEN UTXBF TRMT URXISEL1 URXISEL0 ADDEN RIDLE PERR FERR OERR URXDA 0110
U1TXREG 0224 — — — — — — — Transmit Register xxxx
U1RXREG 0226 — — — — — — — Receive Register 0000
U1BRG 0228 Baud Rate Generator Prescaler Register 0000
U2MODE 0230 UARTEN — USIDL IREN RTSMD — UEN1 UEN0 WAKE LPBACK ABAUD RXINV BRGH PDSEL1 PDSEL0 STSEL 0000
U2STA 0232 UTXISEL1 UTXINV UTXISEL0 — UTXBRK UTXEN UTXBF TRMT URXISEL1 URXISEL0 ADDEN RIDLE PERR FERR OERR URXDA 0110
U2TXREG 0234 — — — — — — — Transmit Register xxxx
U2RXREG 0236 — — — — — — — Receive Register 0000
U2BRG 0238 Baud Rate Generator Prescaler Register 0000
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
DS39951C-page 41
TABLE 4-11: SPI REGISTER MAPS
DS39951C-page 42
PIC24FJ64GA104 FAMILY
All
File Name Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Resets
SPI1STAT 0240 SPIEN — SPISIDL — — SPIBEC2 SPIBEC1 SPIBEC0 SRMPT SPIROV SRXMPT SISEL2 SISEL1 SISEL0 SPITBF SPIRBF 0000
SPI1CON1 0242 — — — DISSCK DISSDO MODE16 SMP CKE SSEN CKP MSTEN SPRE2 SPRE1 SPRE0 PPRE1 PPRE0 0000
SPI1CON2 0244 FRMEN SPIFSD SPIFPOL — — — — — — — — — — — SPIFE SPIBEN 0000
SPI1BUF 0248 Transmit and Receive Buffer 0000
SPI2STAT 0260 SPIEN — SPISIDL — — SPIBEC2 SPIBEC1 SPIBEC0 SRMPT SPIROV SRXMPT SISEL2 SISEL1 SISEL0 SPITBF SPIRBF 0000
SPI2CON1 0262 — — — DISSCK DISSDO MODE16 SMP CKE SSEN CKP MSTEN SPRE2 SPRE1 SPRE0 PPRE1 PPRE0 0000
SPI2CON2 0264 FRMEN SPIFSD SPIFPOL — — — — — — — — — — — SPIFE SPIBEN 0000
SPI2BUF 0268 Transmit and Receive Buffer 0000
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
TRISB 02C8 TRISB15 TRISB14 TRISB13 TRISB12 TRISB11 TRISB10 TRISB9 TRISB8 TRISB7 TRISB6 TRISB5 TRISB4 TRISB3 TRISB2 TRISB1 TRISB0 EFBF
PORTB 02CA RB15 RB14 RB13 RB12 RB11 RB10 RB9 RB8 RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 xxxx
LATB 02CC LATB15 LATB14 LATB13 LATB12 LATB11 LATB10 LATB9 LATB8 LATB7 LATB6 LATB5 LATB4 LATB3 LATB2 LATB1 LATB0 xxxx
ODCB 02CE ODB15 ODB14 ODB13 ODB12 ODB11 ODB10 ODB9 ODB8 ODB7 ODB6 ODB5 ODB4 ODB3 ODB2 ODB1 ODB0 0000
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
2010 Microchip Technology Inc.
TRISC 02D0 — — — — — — TRISC9 TRISC8 TRISC7 TRISC6 TRISC5 TRISC4 TRISC3 TRISC2 TRISC1 TRISC0 03FF
PORTC 02D2 — — — — — — RC9 RC8 RC7 RC6 RC5 RC4 RC3 RC2 RC1 RC0 xxxx
LATC 02D4 — — — — — — LATC9 LATC8 LATC7 LATC6 LATC5 LATC4 LATC3 LATC2 LATC1 LATC0 xxxx
ODCC 02D6 — — — — — — ODC9 ODC8 ODC7 ODC6 ODC5 ODC4 ODC3 ODC2 ODC1 ODC0 0000
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal. Reset values shown are for 44-pin devices.
Note 1: Bits are unimplemented in 28-pin devices; read as ‘0’.
TABLE 4-15: PAD CONFIGURATION REGISTER MAP
2010 Microchip Technology Inc.
All
File Name Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Resets
PIC24FJ64GA104 FAMILY
ADC1BUF8 0310 ADC Data Buffer 8 xxxx
ADC1BUF9 0312 ADC Data Buffer 9 xxxx
ADC1BUFA 0314 ADC Data Buffer 10 xxxx
ADC1BUFB 0316 ADC Data Buffer 11 xxxx
ADC1BUFC 0318 ADC Data Buffer 12 xxxx
ADC1BUFD 031A ADC Data Buffer 13 xxxx
ADC1BUFE 031C ADC Data Buffer 14 xxxx
ADC1BUFF 031E ADC Data Buffer 15 xxxx
AD1CON1 0320 ADON — ADSIDL — — — FORM1 FORM0 SSRC2 SSRC1 SSRC0 — — ASAM SAMP DONE 0000
AD1CON2 0322 VCFG2 VCFG1 VCFG0 r — CSCNA — — BUFS — SMPI3 SMPI2 SMPI1 SMPI0 BUFM ALTS 0000
AD1CON3 0324 ADRC r r SAMC4 SAMC3 SAMC2 SAMC1 SAMC0 ADCS7 ADCS6 ADCS5 ADCS4 ADCS3 ADCS2 ADCS1 ADCS0 0000
AD1CHS 0328 CH0NB — — CH0SB4 CH0SB3 CH0SB2 CH0SB1 CH0SB0 CH0NA — — CH0SA4 CH0SA3 CH0SA2 CH0SA1 CH0SA0 0000
AD1PCFG 032C PCFG15 PCFG14 PCFG13 PCFG12(1) PCFG11 PCFG10 PCFG9 PCFG8(1) PCFG7(1) PCFG6(1) PCFG5 PCFG4 PCFG3 PCFG2 PCFG1 PCFG0 0000
(1) CSSL8(1) CSSL7(1) CSSL6(1)
AD1CSSL 0330 CSSL15 CSSL14 CSSL13 CSSL12 CSSL11 CSSL10 CSSL9 CSSL5 CSSL4 CSSL3 CSSL2 CSSL1 CSSL0 0000
Legend: — = unimplemented, read as ‘0’, r = reserved, maintain as ‘0’. Reset values are shown in hexadecimal.
Note 1: Bits are not available on 28-pin devices; read as ‘0’.
All
File Name Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Resets
CTMUCON 033C CTMUEN — CTMUSIDL TGEN EDGEN EDGSEQEN IDISSEN CTTRIG EDG2POL EDG2SEL1 EDG2SEL0 EDG1POL EDG1SEL1 EDG1SEL0 EDG2STAT EDG1STAT 0000
CTMUICON 033E ITRIM5 ITRIM4 ITRIM3 ITRIM2 ITRIM1 ITRIM0 IRNG1 IRNG0 — — — — — — — — 0000
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
DS39951C-page 44
PIC24FJ64GA104 FAMILY
TABLE 4-18: PARALLEL MASTER/SLAVE PORT REGISTER MAP
All
File Name Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Resets
PMCON 0600 PMPEN — PSIDL ADRMUX1 ADRMUX0 PTBEEN PTWREN PTRDEN CSF1 CSF0 ALP — CS1P BEP WRSP RDSP 0000
PMMODE 0602 BUSY IRQM1 IRQM0 INCM1 INCM0 MODE16 MODE1 MODE0 WAITB1 WAITB0 WAITM3 WAITM2 WAITM1 WAITM0 WAITE1 WAITE0 0000
PMADDR 0604 — CS1 — — — ADDR10(1) ADDR9(1) ADDR8(1) ADDR7(1) ADDR6(1) ADDR5(1) ADDR4(1) ADDR3(1) ADDR2(1) ADDR1 ADDR0 0000
PMDOUT1 Parallel Port Data Out Register 1 (Buffers 0 and 1) 0000
PMDOUT2 0606 Parallel Port Data Out Register 2 (Buffers 2 and 3) 0000
PMDIN1 0608 Parallel Port Data In Register 1 (Buffers 0 and 1) 0000
PMDIN2 060A Parallel Port Data In Register 2 (Buffers 2 and 3) 0000
PMAEN 060C — PTEN14 — — — PTEN10(1) PTEN9(1) PTEN8(1) PTEN7(1) PTEN6(1) PTEN5(1) PTEN4(1) PTEN3(1) PTEN2(1) PTEN1 PTEN0 0000
PMSTAT 060E IBF IBOV — — IB3F IB2F IB1F IB0F OBE OBUF — — OB3E OB2E OB1E OB0E 0000
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1: Bits are not available on 28-pin devices; read as ‘0’.
CRCCON1 0640 CRCEN — CSIDL VWORD4 VWORD3 VWORD2 VWORD1 VWORD0 CRCFUL CRCMPT CRCISEL CRCGO LENDIAN — — — 0000
CRCCON2 0642 — — — DWIDTH4 DWIDTH3 DWIDTH2 DWIDTH1 DWIDTH0 — — — PLEN4 PLEN3 PLEN2 PLEN1 PLEN0 0000
2010 Microchip Technology Inc.
All
File Name Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Resets
CMSTAT 0650 CMIDL — — — — C3EVT C2EVT C1EVT — — — — — C3OUT C2OUT C1OUT 0000
CVRCON 0652 — — — — — CVREFP CVREFM1 CVREFM0 CVREN CVROE CVRR CVRSS CVR3 CVR2 CVR1 CVR0 0000
CM1CON 0654 CEN COE CPOL — — — CEVT COUT EVPOL1 EVPOL0 — CREF — — CCH1 CCH0 0000
CM2CON 065C CEN COE CPOL — — — CEVT COUT EVPOL1 EVPOL0 — CREF — — CCH1 CCH0 0000
CM3CON 0664 CEN COE CPOL — — — CEVT COUT EVPOL1 EVPOL0 — CREF — — CCH1 CCH0 0000
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
PIC24FJ64GA104 FAMILY
RPINR8 0690 — — — IC4R4 IC4R3 IC4R2 IC4R1 IC4R0 — — — IC3R4 IC3R3 IC3R2 IC3R1 IC3R0 1F1F
RPINR9 0692 — — — — — — — — — — — IC5R4 IC5R3 IC5R2 IC5R1 IC5R0 001F
RPINR11 0696 — — — OCFBR4 OCFBR3 OCFBR2 OCFBR1 OCFBR0 — — — OCFAR4 OCFAR3 OCFAR2 OCFAR1 OCFAR0 1F1F
RPINR18 06A4 — — — U1CTSR4 U1CTSR3 U1CTSR2 U1CTSR1 U1CTSR0 — — — U1RXR4 U1RXR3 U1RXR2 U1RXR1 U1RXR0 1F1F
RPINR19 06A6 — — — U2CTSR4 U2CTSR3 U2CTSR2 U2CTSR1 U2CTSR0 — — — U2RXR4 U2RXR3 U2RXR2 U2RXR1 U2RXR0 1F1F
RPINR20 06A8 — — — SCK1R4 SCK1R3 SCK1R2 SCK1R1 SCK1R0 — — — SDI1R4 SDI1R3 SDI1R2 SDI1R1 SDI1R0 1F1F
RPINR21 06AA — — — — — — — — — — — SS1R4 SS1R3 SS1R2 SS1R1 SS1R0 001F
RPINR22 06AC — — — SCK2R4 SCK2R3 SCK2R2 SCK2R1 SCK2R0 — — — SDI2R4 SDI2R3 SDI2R2 SDI2R1 SDI2R0 1F1F
RPINR23 06AE — — — — — — — — — — — SS2R4 SS2R3 SS2R2 SS2R1 SS2R0 001F
RPOR0 06C0 — — — RP1R4 RP1R3 RP1R2 RP1R1 RP1R0 — — — RP0R4 RP0R3 RP0R2 RP0R1 RP0R0 0000
RPOR1 06C2 — — — RP3R4 RP3R3 RP3R2 RP3R1 RP3R0 — — — RP2R4 RP2R3 RP2R2 RP2R1 RP2R0 0000
RPOR2 06C4 — — — RP5R4 RP5R3 RP5R2 RP5R1 RP5R0 — — — RP4R4 RP4R3 RP4R2 RP4R1 RP4R0 0000
RPOR3 06C6 — — — RP7R4 RP7R3 RP7R2 RP7R1 RP7R0 — — — RP6R4 RP6R3 RP6R2 RP6R1 RP6R0 0000
RPOR4 06C8 — — — RP9R4 RP9R3 RP9R2 RP9R1 RP9R0 — — — RP8R4 RP8R3 RP8R2 RP8R1 RP8R0 0000
RPOR5 06CA — — — RP11R4 RP11R3 RP11R2 RP11R1 RP11R0 — — — RP10R4 RP10R3 RP10R2 RP10R1 RP10R0 0000
RPOR6 06CC — — — RP13R4 RP13R3 RP13R2 RP13R1 RP13R0 — — — RP12R4 RP12R3 RP12R2 RP12R1 RP12R0 0000
RPOR7 06CE — — — RP15R4 RP15R3 RP15R2 RP15R1 RP15R0 — — — RP14R4 RP14R3 RP14R2 RP14R1 RP14R0 0000
RPOR8(1) 06D0 — — — RP17R4 RP17R3 RP17R2 RP17R1 RP17R0 — — — RP16R4 RP16R3 RP16R2 RP16R1 RP16R0
DS39951C-page 45
0000
RPOR9(1) 06D2 — — — RP19R4 RP19R3 RP19R2 RP19R1 RP19R0 — — — RP18R4 RP18R3 RP18R2 RP18R1 RP18R0 0000
RPOR10(1) 06D4 — — — RP21R4 RP21R3 RP21R2 RP21R1 RP21R0 — — — RP20R4 RP20R3 RP20R2 RP20R1 RP20R0 0000
RPOR11(1) 06D6 — — — RP23R4 RP23R3 RP23R2 RP23R1 RP23R0 — — — RP22R4 RP22R3 RP22R2 RP22R1 RP22R0 0000
RPOR12(1) 06D8 — — — RP25R4 RP25R3 RP25R2 RP25R1 RP25R0 — — — RP24R4 RP24R3 RP24R2 RP24R1 RP24R0 0000
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1: Registers are unimplemented in 28-pin devices; read as ‘0’.
TABLE 4-23: SYSTEM REGISTER MAP
DS39951C-page 46
PIC24FJ64GA104 FAMILY
All
File Name Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Resets
RCON 0740 TRAPR IOPUWR — — — DPSLP CM PMSLP EXTR SWR SWDTEN WDTO SLEEP IDLE BOR POR Note 1
OSCCON 0742 — COSC2 COSC1 COSC0 — NOSC2 NOSC1 NOSC0 CLKLOCK IOLOCK LOCK — CF POSCEN SOSCEN OSWEN Note 2
CLKDIV 0744 ROI DOZE2 DOZE1 DOZE0 DOZEN RCDIV2 RCDIV1 RCDIV0 — — — — — — — — 0100
OSCTUN 0748 — — — — — — — — — — TUN5 TUN4 TUN3 TUN2 TUN1 TUN0 0000
REFOCON 074E ROEN — ROSSLP ROSEL RODIV3 RODIV2 RODIV1 RODIV0 — — — — — — — — 0000
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1: The Reset value of the RCON register is dependent on the type of Reset event. See Section 6.0 “Resets” for more information.
2: The Reset value of the OSCCON register is dependent on both the type of Reset event and the device configuration. See Section 8.0 “Oscillator Configuration” for more information.
NVMCON 0760 WR WREN WRERR — — — — — — ERASE — — NVMOP3 NVMOP2 NVMOP1 NVMOP0 0000(1)
NVMKEY 0766 — — — — — — — — NVMKEY Register<7:0> 0000
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1: Reset value shown is for POR only. Value on other Reset states is dependent on the state of memory write or erase operations at the time of Reset.
2010 Microchip Technology Inc.
PMD1 0770 T5MD T4MD T3MD T2MD T1MD — — — I2C1MD U2MD U1MD SPI2MD SPI1MD — — ADC1MD 0000
PMD2 0772 — — — IC5MD IC4MD IC3MD IC2MD IC1MD — — — OC5MD OC4MD OC3MD OC2MD OC1MD 0000
PMD3 0774 — — — — — CMPMD RTCCMD PMPMD CRCMD — — — — — I2C2MD — 0000
PMD4 0776 — — — — — — — — — — — — REFOMD CTMUMD LVDMD — 0000
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
PIC24FJ64GA104 FAMILY
4.2.5 SOFTWARE STACK 4.3 Interfacing Program and Data
In addition to its use as a working register, the W15 Memory Spaces
register in PIC24F devices is also used as a Software The PIC24F architecture uses a 24-bit wide program
Stack Pointer. The pointer always points to the first space and a 16-bit wide data space. The architecture is
available free word and grows from lower to higher also a modified Harvard scheme, meaning that data
addresses. It predecrements for stack pops and can also be present in the program space. To use this
post-increments for stack pushes, as shown in data successfully, it must be accessed in a way that
Figure 4-4. Note that for a PC push during any CALL preserves the alignment of information in both spaces.
instruction, the MSB of the PC is zero-extended before
the push, ensuring that the MSB is always clear. Aside from normal execution, the PIC24F architecture
provides two methods by which program space can be
Note: A PC push during exception processing accessed during operation:
will concatenate the SRL register to the
• Using table instructions to access individual bytes
MSB of the PC prior to the push.
or words anywhere in the program space
The Stack Pointer Limit Value (SPLIM) register, associ- • Remapping a portion of the program space into
ated with the Stack Pointer, sets an upper address the data space (program space visibility)
boundary for the stack. SPLIM is uninitialized at Reset.
As is the case for the Stack Pointer, SPLIM<0> is Table instructions allow an application to read or write
forced to ‘0’ because all stack operations must be to small areas of the program memory. This makes the
word-aligned. Whenever an EA is generated using method ideal for accessing data tables that need to be
W15 as a source or destination pointer, the resulting updated from time to time. It also allows access to all
address is compared with the value in SPLIM. If the bytes of the program word. The remapping method
contents of the Stack Pointer (W15) and the SPLIM allows an application to access a large block of data on
register are equal, and a push operation is performed, a read-only basis, which is ideal for look-ups from a
a stack error trap will not occur. The stack error trap will large table of static data; it can only access the least
occur on a subsequent push operation. Thus, for significant word of the program word.
example, if it is desirable to cause a stack error trap
4.3.1 ADDRESSING PROGRAM SPACE
when the stack grows beyond address 2000h in RAM,
initialize the SPLIM with the value, 1FFEh. Since the address ranges for the data and program
spaces are 16 and 24 bits, respectively, a method is
Similarly, a Stack Pointer underflow (stack error) trap is
needed to create a 23-bit or 24-bit program address
generated when the Stack Pointer address is found to
from 16-bit data registers. The solution depends on the
be less than 0800h. This prevents the stack from
interface method to be used.
interfering with the Special Function Register (SFR)
space. For table operations, the 8-bit Table Memory Page
Address (TBLPAG) register is used to define a 32K word
A write to the SPLIM register should not be immediately
region within the program space. This is concatenated
followed by an indirect read operation using W15.
with a 16-bit EA to arrive at a full 24-bit program space
address. In this format, the Most Significant bit of
FIGURE 4-4: CALL STACK FRAME TBLPAG is used to determine if the operation occurs in
0000h the user memory (TBLPAG<7> = 0) or the configuration
15 0
memory (TBLPAG<7> = 1).
For remapping operations, the 8-bit Program Space
Visibility Page Address (PSVPAG) register is used to
Stack Grows Towards
Higher Address
23 Bits
EA 1/0
8 Bits 16 Bits
24 Bits
Select
1 EA 0
Program Space Visibility(1)
(Remapping)
0 PSVPAG
8 Bits 15 Bits
23 Bits
Note 1: The LSb of program space addresses is always fixed as ‘0’ in order to maintain word alignment of
data in the program and data spaces.
2: Table operations are not required to be word-aligned. Table read operations are permitted in the
configuration memory space.
‘Phantom’ Byte
TBLRDH.B (Wn<0> = 0)
TBLRDL.B (Wn<0> = 1)
TBLRDL.B (Wn<0> = 0)
TBLRDL.W
PSV Area
...while the lower
15 bits of the EA
specify an exact
FFFFh address within the
PSV area. This
corresponds exactly to
the same lower 15 bits
of the actual program
800000h
space address.
24 Bits
Using
Program 0 Program Counter 0
Counter
Working Reg EA
User/Configuration Byte
Space Select 24-Bit EA Select
R/SO-0, HC(1) R/W-0(1) R/W-0, HS(1) U-0 U-0 U-0 U-0 U-0
WR WREN WRERR — — — — —
bit 15 bit 8
Legend: SO = Settable Only bit HC = Hardware Clearable bit HS = Hardware Settable bit
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
#define NUM_INSTRUCTION_PER_ROW 64
unsigned int offset;
unsigned int i;
unsigned long progAddr = 0xXXXXXX; // Address of row to write
unsigned int progData[2*NUM_INSTRUCTION_PER_ROW]; // Buffer of data to write
MOV #LOW_WORD, W2 ;
MOV #HIGH_BYTE, W3 ;
TBLWTL W2, [W0] ; Write PM low word into program latch
TBLWTH W3, [W0++] ; Write PM high byte into program latch
RESET
Instruction
Glitch Filter
MCLR
WDT
Module
Sleep or Idle
Brown-out BOR
Reset
Trap Conflict
Illegal Opcode
Configuration Mismatch
Uninitialized W Register
Note 1: All of the Reset status bits may be set or cleared in software. Setting one of these bits in software does not
cause a device Reset.
2: If the FWDTEN Configuration bit is ‘1’ (unprogrammed), the WDT is always enabled, regardless of the
SWDTEN bit setting.
Note 1: All of the Reset status bits may be set or cleared in software. Setting one of these bits in software does not
cause a device Reset.
2: If the FWDTEN Configuration bit is ‘1’ (unprogrammed), the WDT is always enabled, regardless of the
SWDTEN bit setting.
Note: For detailed operating frequency and timing specifications, see Section 28.0 “Electrical Characteristics”.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: See Register 3-1 for the description of the remaining bit(s) that are not dedicated to interrupt control
functions.
2: The IPL bits are concatenated with the IPL3 bit (CORCON<3>) to form the CPU interrupt priority level.
The value in parentheses indicates the interrupt priority level if IPL3 = 1.
3: The IPL Status bits are read-only when NSTDIS (INTCON1<15>) = 1.
Note 1: See Register 3-2 for the description of the remaining bit(s) that are not dedicated to interrupt control
functions.
2: The IPL3 bit is concatenated with the IPL<2:0> bits (SR<7:5>) to form the CPU interrupt priority level.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: If an external interrupt is enabled, the interrupt input must also be configured to an available RPn or PRIx
pin. See Section 10.4 “Peripheral Pin Select (PPS)” for more information.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Primary Oscillator
REFOCON<15:8>
XT, HS, EC
OSCO
Reference Clock
Generator
XTPLL, HSPLL
OSCI ECPLL,FRCPLL
4 x PLL
REFO
8 MHz
Postscaler
4 MHz
FRC FRCDIV
Oscillator 8 MHz
(nominal)
Peripherals
CLKDIV<10:8> FRC
CLKO
LPRC LPRC
Postscaler
Secondary Oscillator
SOSC
SOSCO
CLKDIV<14:12>
SOSCEN
Enable
SOSCI Oscillator Clock Control Logic
Fail-Safe
Clock
Monitor
WDT, PWRT
Note 1: Reset values for these bits are determined by the FNOSC Configuration bits.
2: The state of the IOLOCK bit can only be changed once an unlocking sequence has been executed. In
addition, if the IOL1WAY Configuration bit is ‘1’, once the IOLOCK bit is set, it cannot be cleared.
3: Also resets to ‘0’ during any valid clock switch or whenever a non-PLL clock mode is selected.
Note 1: Reset values for these bits are determined by the FNOSC Configuration bits.
2: The state of the IOLOCK bit can only be changed once an unlocking sequence has been executed. In
addition, if the IOL1WAY Configuration bit is ‘1’, once the IOLOCK bit is set, it cannot be cleared.
3: Also resets to ‘0’ during any valid clock switch or whenever a non-PLL clock mode is selected.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: This bit is automatically cleared when the ROI bit is set and an interrupt occurs.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: Increments or decrements of TUN<5:0> may not change the FRC frequency in equal steps over the FRC
tuning range and may not be monotonic.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit C = Clearable bit U = Unimplemented, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
HC = Hardware Clearable bit HS = Hardware Settable bit HCS = Hardware Clearable/Settable bit
Note 1: These bits are reset only in the case of a POR event outside of Deep Sleep mode.
2: Reset value is ‘0’ for initial power-on POR only and ‘1’ for Deep Sleep POR.
3: This is a status bit only; a DSBOR event will NOT cause a wake-up from Deep Sleep.
Note 1: This bit can only be set while the device is in Deep Sleep mode.
2: This bit can be set outside of Deep Sleep.
PIO Module 1
Output Data
Read TRIS 0
WR TRIS CK
TRIS Latch
D Q
WR LAT +
CK
WR PORT
Data Latch
Read LAT
Input Data
Read PORT
10.2 Configuring Analog Port Pins TABLE 10-1: INPUT VOLTAGE TOLERANCE
The AD1PCFGL and TRIS registers control the opera- Tolerated
Port or Pin Description
tion of the A/D port pins. Setting a port pin as an analog Input
input also requires that the corresponding TRIS bit be
PORTA<4:0> VDD Only VDD input levels
set. If the TRIS bit is cleared (output), the digital output
PORTB<15:12> tolerated.
level (VOH or VOL) will be converted.
When reading the PORT register, all pins configured as PORTB<4:0>
analog input channels will read as cleared (a low level). PORTC<3:0>(1)
Pins configured as digital inputs will not convert an PORTA<10:7>(1) 5.5V Tolerates input levels
analog input. Analog levels on any pin that is defined as PORTB<11:7> above VDD, useful for
a digital input (including the ANx pins) may cause the most standard logic.
PORTB<6:5>
input buffer to consume current that exceeds the
device specifications. PORTC<9:4>(1)
Note 1: Not available on 28-pin devices.
10.2.1 I/O PORT WRITE/READ TIMING
One instruction cycle is required between a port
direction change or port write operation and a read
operation of the same port. Typically, this instruction
would be a NOP (Example 10-1).
;lock registers
mov #OSCCON, w1;
mov #0x46, w2;
mov #0x57, w3;
mov.b w2, [w1];
mov.b w3, [w1];
bset OSCCON, #6;
pop w3;
pop w2;
pop w1;
//lock registers
__builtin_write_OSCCONL(OSCCON | 0x40);
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: This register is unimplemented in 28-pin devices; all bits read as ‘0’.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: This register is unimplemented in 28-pin devices; all bits read as ‘0’.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: This register is unimplemented in 28-pin devices; all bits read as ‘0’.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: This register is unimplemented in 28-pin devices; all bits read as ‘0’.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: This register is unimplemented in 28-pin devices; all bits read as ‘0’.
TCKPS<1:0>
SOSCO/ TON 2
1x
T1CK
Gate Prescaler
SOSCEN Sync 01 1, 8, 64, 256
SOSCI
TCY 00
TGATE
TGATE TCS
1 Q D
Set T1IF
0 Q CK
0
Reset
TMR1
1 Sync
Comparator TSYNC
Equal
PR1
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: Changing the value of TxCON while the timer is running (TON = 1) causes the timer prescale counter to
reset and is not recommended.
TCKPS<1:0>
T2CK TON 2
1x
(T4CK)
Gate Prescaler
Sync 01 1, 8, 64, 256
TCY 00
TGATE TGATE(2)
TCS(2)
1 Q D
Set T3IF (T5IF)
Q CK
0
PR3 PR2
(PR5) (PR4)
MSB LSB
TMR3 TMR2
Sync
Reset (TMR5) (TMR4)
16
(1)
Read TMR2 (TMR4)
Write TMR2 (TMR4)(1)
16
TMR3HLD 16
(TMR5HLD)
Data Bus<15:0>
Note 1: The 32-Bit Timer Configuration bit, T32, must be set for 32-bit timer/counter operation. All control bits are
respective to the T2CON and T4CON registers.
2: The timer clock input must be assigned to an available RPn pin before use. Please see Section 10.4 “Peripheral
Pin Select (PPS)” for more information.
3: The ADC event trigger is available only on Timer 2/3 in 32-bit mode and Timer 3 in 16-bit mode.
TCKPS<1:0>
TON 2
T2CK 1x
(T4CK)
Gate Prescaler
Sync 01 1, 8, 64, 256
TGATE 00
TCY TCS(1)
1 Q D TGATE(1)
Set T2IF (T4IF) Q CK
0
Reset
TMR2 (TMR4) Sync
Comparator
Equal
PR2 (PR4)
Note 1: The timer clock input must be assigned to an available RPn pin before use. Please see Section 10.4 “Peripheral
Pin Select (PPS)” for more information.
TCKPS<1:0>
T3CK TON 2
Sync 1x
(T5CK)
Prescaler
01 1, 8, 64, 256
TGATE 00
TCY TCS(1)
1 Q D TGATE(1)
Set T3IF (T5IF) Q CK
0
Reset
TMR3 (TMR5)
PR3 (PR5)
Note 1: The timer clock input must be assigned to an available RPn pin before use. Please see Section 10.4 “Peripheral
Pin Select (PPS)” for more information.
2: The ADC event trigger is available only on Timer3.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: In 32-bit mode, the T3CON or T5CON control bits do not affect 32-bit timer operation.
2: If TCS = 1, RPINRx (TxCK) must be configured to an available RPn pin. For more information, see
Section 10.4 “Peripheral Pin Select (PPS)”.
3: Changing the value of TxCON while the timer is running (TON = 1) causes the timer prescale counter to
reset and is not recommended.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: When 32-bit operation is enabled (T2CON<3> or T4CON<3> = 1), these bits have no effect on Timery
operation; all timer functions are set through T2CON and T4CON.
2: If TCS = 1, RPINRx (TxCK) must be configured to an available RPn pin. See Section 10.4 “Peripheral
Pin Select (PPS)” for more information.
3: Changing the value of TyCON while the timer is running (TON = 1) causes the timer prescale counter to
reset and is not recommended.
ICTSEL<2:0>
Clock Increment 16
IC Clock Select ICxTMR 4-Level FIFO Buffer
Sources 16
Trigger and
Sync Logic 16
Reset
Trigger and ICxBUF
Sync Sources
SYNCSEL<4:0>
Trigger
ICOV, ICBNE System Bus
Note 1: The ICx inputs must be assigned to an available RPn pin before use. Please see Section 10.4 “Peripheral
Pin Select (PPS)” for more information.
U-0 R/W-0 R/W-0 R-0, HCS R-0, HCS R/W-0 R/W-0 R/W-0
— ICI1 ICI0 ICOV ICBNE ICM2(1) ICM1(1) ICM0(1)
bit 7 bit 0
Note 1: The ICx input must also be configured to an available RPn pin. For more information, see Section 10.4
“Peripheral Pin Select (PPS)”.
Note 1: Use these inputs as trigger sources only and never as sync sources.
DCBx
OCMx
OCxCON1 OCINV
OCTRIS
OCTSELx
OCxCON2 FLTOUT
SYNCSELx
FLTTRIEN
TRIGSTAT
FLTMD
TRIGMODE
ENFLTx
OCTRIG OCxR OCFLTx
OCx Interrupt
Note 1: The OCx outputs must be assigned to an available RPn pin before use. Please see Section 10.4 “Peripheral
Pin Select (PPS)” for more information.
OCxCON1
OCMx
OCxCON2 OCINV
OCTSELx OCTRIS
SYNCSELx OCxR and DCB<1:0> FLTOUT
TRIGSTAT FLTTRIEN
TRIGMODE FLTMD
OCTRIG Rollover/Reset ENFLTx
OCFLTx
OCxR and DCB<1:0> Buffers DCB<1:0>
OCx Pin(1)
Comparator Match
Clock Increment
OC Clock Event
Select
Sources
OC Output Timing
OCxTMR
Rollover and Fault Logic
Reset
Comparator OCFA/OCFB/CxOUT
Match Event Match
Trigger and Event
Trigger and
Sync Sources Sync Logic
OCxRS Buffer
Rollover/Reset
OCxRS
OCx Interrupt
Reset
Note 1: The OCx outputs must be assigned to an available RPn pin before use. Please see Section 10.4 “Peripheral Pin
Select (PPS)” for more information.
Note 1: Based on FCY = FOSC/2; Doze mode and PLL are disabled.
Note 1: Based on TCY = 2 * TOSC; Doze mode and PLL are disabled.
TABLE 14-1: EXAMPLE PWM FREQUENCIES AND RESOLUTIONS AT 4 MIPS (FCY = 4 MHz)(1)
PWM Frequency 7.6 Hz 61 Hz 122 Hz 977 Hz 3.9 kHz 31.3 kHz 125 kHz
Prescaler Ratio 8 1 1 1 1 1 1
Period Value FFFFh FFFFh 7FFFh 0FFFh 03FFh 007Fh 001Fh
Resolution (bits) 16 16 15 12 10 7 5
Note 1: Based on FCY = FOSC/2; Doze mode and PLL are disabled.
TABLE 14-2: EXAMPLE PWM FREQUENCIES AND RESOLUTIONS AT 16 MIPS (FCY = 16 MHz)(1)
PWM Frequency 30.5 Hz 244 Hz 488 Hz 3.9 kHz 15.6 kHz 125 kHz 500 kHz
Prescaler Ratio 8 1 1 1 1 1 1
Period Value FFFFh FFFFh 7FFFh 0FFFh 03FFh 007Fh 001Fh
Resolution (bits) 16 16 15 12 10 7 5
Note 1: Based on FCY = FOSC/2; Doze mode and PLL are disabled.
R/W-0 R/W-0, HCS R/W-0, HCS R/W-0, HCS R/W-0 R/W-0 R/W-0 R/W-0
ENFLT0 OCFLT2 OCFLT1 OCFLT0 TRIGMODE OCM2(1) OCM1(1) OCM0(1)
bit 7 bit 0
Note 1: The OCx output must also be configured to an available RPn pin. For more information, see Section 10.4
“Peripheral Pin Select (PPS)”.
2: The comparator module used for Fault input varies with the OCx module. OC1 and OC2 use Comparator 1;
OC3 and OC4 use Comparator 2; OC5 uses Comparator 3.
Note 1: The OCx output must also be configured to an available RPn pin. For more information, see Section 10.4
“Peripheral Pin Select (PPS)”.
2: The comparator module used for Fault input varies with the OCx module. OC1 and OC2 use Comparator 1;
OC3 and OC4 use Comparator 2; OC5 uses Comparator 3.
Note 1: Do not use an OC module as its own trigger source, either by selecting this mode or another equivalent
SYNCSEL setting.
2: Use these inputs as trigger sources only and never as sync sources.
3: These bits affect the rising edge when OCINV = 1. The bits have no effect when the
OCM bits (OCxCON1<1:0>) = 001.
Note 1: Do not use an OC module as its own trigger source, either by selecting this mode or another equivalent
SYNCSEL setting.
2: Use these inputs as trigger sources only and never as sync sources.
3: These bits affect the rising edge when OCINV = 1. The bits have no effect when the
OCM bits (OCxCON1<1:0>) = 001.
Transfer Transfer
SPIxBUF
16
Internal Data Bus
Transfer Transfer
SPIxBUF
16
Internal Data Bus
Note 1: If SPIEN = 1, these functions must be assigned to available RPn pins before use. See Section 10.4
“Peripheral Pin Select (PPS)” for more information.
Note 1: If SPIEN = 1, these functions must be assigned to available RPn pins before use. See Section 10.4
“Peripheral Pin Select (PPS)” for more information.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: If DISSCK = 0, SCKx must be configured to an available RPn pin. See Section 10.4 “Peripheral Pin
Select (PPS)” for more information.
2: If DISSDO = 0, SDOx must be configured to an available RPn pin. See Section 10.4 “Peripheral Pin
Select (PPS)” for more information.
3: The CKE bit is not used in the Framed SPI modes. The user should program this bit to ‘0’ for the Framed
SPI modes (FRMEN = 1).
4: If SSEN = 1, SSx must be configured to an available RPn pin. See Section 10.4 “Peripheral Pin Select
(PPS)” for more information.
Note 1: If DISSCK = 0, SCKx must be configured to an available RPn pin. See Section 10.4 “Peripheral Pin
Select (PPS)” for more information.
2: If DISSDO = 0, SDOx must be configured to an available RPn pin. See Section 10.4 “Peripheral Pin
Select (PPS)” for more information.
3: The CKE bit is not used in the Framed SPI modes. The user should program this bit to ‘0’ for the Framed
SPI modes (FRMEN = 1).
4: If SSEN = 1, SSx must be configured to an available RPn pin. See Section 10.4 “Peripheral Pin Select
(PPS)” for more information.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
SDOx SDIx
Serial Clock
SCKx SCKx SPIx Buffer
SPIx Buffer
(SPIxBUF)(2) (SPIxBUF)(2)
SSx(1)
PROCESSOR 1 (SPI Enhanced Buffer Master) PROCESSOR 2 (SPI Enhanced Buffer Slave)
SDOx SDIx
SSx SSx(1)
PIC24F PROCESSOR 2
(SPI Master, Frame Master)
SDOx SDIx
SDIx SDOx
Serial Clock
SCKx SCKx
SSx SSx
Frame Sync
Pulse
PIC24F PROCESSOR 2
SPI Master, Frame Slave)
SDOx SDIx
SDIx SDOx
Serial Clock
SCKx SCKx
SSx SSx
Frame Sync
Pulse
PIC24F PROCESSOR 2
(SPI Slave, Frame Master)
SDOx SDIx
SDIx SDOx
Serial Clock
SCKx SCKx
SSx SSx
Frame Sync.
Pulse
PIC24F PROCESSOR 2
(SPI Slave, Frame Slave)
SDOx SDIx
SDIx SDOx
Serial Clock
SCKx SCKx
SSx SSx
Frame Sync
Pulse
Note 1: Based on FCY = FOSC/2, Doze mode and PLL are disabled.
Internal
Data Bus
I2CxRCV
Read
Shift
SCLx Clock
I2CxRSR
LSB
I2CxMSK
Write Read
I2CxADD
Read
Read
Collision Write
Detect
I2CxCON
Acknowledge
Generation Read
Clock
Stretching
Write
I2CxTRN
LSB
Read
Shift Clock
Reload
Control
Write
Read
TCY/2
R/C-0, HS R/C-0, HS R-0, HSC R/C-0, HSC R/C-0, HSC R-0, HSC R-0, HSC R-0, HSC
IWCOL I2COV D/A P S R/W RBF TBF
bit 7 bit 0
Legend: C = Clearable bit HS = Hardware Settable bit HSC = Hardware Settable/Clearable bit
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
IrDA®
Note: The UART inputs and outputs must all be assigned to available RPn pins before use. Please see
Section 10.4 “Peripheral Pin Select (PPS)” for more information.
Note 1: Based on FCY = FOSC/2, Doze mode and PLL are disabled.
Note 1: If UARTEN = 1, the peripheral inputs and outputs must be configured to an available RPn pin. See
Section 10.4 “Peripheral Pin Select (PPS)” for more information.
2: This feature is only available for the 16x BRG mode (BRGH = 0).
Note 1: If UARTEN = 1, the peripheral inputs and outputs must be configured to an available RPn pin. See
Section 10.4 “Peripheral Pin Select (PPS)” for more information.
2: This feature is only available for the 16x BRG mode (BRGH = 0).
Note 1: Value of bit only affects the transmit properties of the module when the IrDA encoder is enabled (IREN = 1).
2: If UARTEN = 1, the peripheral inputs and outputs must be configured to an available RPn pin. See
Section 10.4 “Peripheral Pin Select (PPS)” for more information.
Note 1: Value of bit only affects the transmit properties of the module when the IrDA encoder is enabled (IREN = 1).
2: If UARTEN = 1, the peripheral inputs and outputs must be configured to an available RPn pin. See
Section 10.4 “Peripheral Pin Select (PPS)” for more information.
PMA<1>
PMALH
PMCS1
PMBE
PMRD FIFO
PMRD/PMWR Microcontroller LCD
Buffer
PMWR
PMENB
PMD<7:0>
PMA<7:0>
PMA<15:8>
8-Bit Data
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: WAITB and WAITE bits are ignored whenever WAITM<3:0> = 0000.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: To enable the actual RTCC output, the RTCOE (RCFGCAL<10>) bit needs to be set.
Address Bus
Master PIC24F Slave
Data Bus
PMD<7:0> PMD<7:0> Control Lines
PMCS1 PMCS1
PMRD PMRD
PMWR PMWR
Address Bus
Data Bus
Control Lines
PIC24F PMA<10:0>
PMD<7:0>
PMCS1
PIC24F PMA<10:8>
PMD<7:0>
PMA<7:0>
PMCS1
PMALL
Address Bus
Multiplexed
PMRD Data and
Address Bus
PMWR Control Lines
FIGURE 18-6: MASTER MODE, FULLY MULTIPLEXED ADDRESSING (SEPARATE READ AND
WRITE STROBES, SINGLE CHIP SELECT)
PMD<7:0>
PIC24F PMA<7:0>
PMA<15:8>
PMCS1
PMALL
PMALH
Multiplexed
PMRD Data and
Address Bus
PMWR Control Lines
FIGURE 18-10: PARALLEL EEPROM EXAMPLE (UP TO 11-BIT ADDRESS, 8-BIT DATA)
PMD<7:0> D<7:0>
PMCS1 CE
Address Bus
PMRD OE
Data Bus
PMWR WR
Control Lines
FIGURE 18-11: PARALLEL EEPROM EXAMPLE (UP TO 11-BIT ADDRESS, 16-BIT DATA)
PMD<7:0> D<7:0>
PMBE A0
PMCS1 CE
Address Bus
PMRD OE
Data Bus
PMWR WR
Control Lines
ALMTHDY
Alarm Registers with Masks ALRMVAL ALWDHR
ALMINSEC
01
RTCC
RTCC Interrupt Logic Interrupt
Alarm Pulse
00
RTCC
Pin
10
Clock Source
RTCOE
R/W-0 U-0 R/W-0 R-0, HSC R-0, HSC R/W-0 R/W-0 R/W-0
(2)
RTCEN — RTCWREN RTCSYNC HALFSEC(3) RTCOE RTCPTR1 RTCPTR0
bit 15 bit 8
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: To enable the actual RTCC output, the RTCOE (RCFGCAL<10>) bit needs to be set.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC
YRTEN3 YRTEN2 YRTEN1 YRTEN0 YRONE3 YRONE2 YRONE1 YRONE0
bit 7 bit 0
U-0, HSC U-0, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC
— — DAYTEN1 DAYTEN0 DAYONE3 DAYONE2 DAYONE1 DAYONE0
bit 7 bit 0
U-0, HSC U-0, HSC U-0, HSC U-0, HSC U-0, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC
— — — — — WDAY2 WDAY1 WDAY0
bit 15 bit 8
U-0, HSC U-0, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC
— — HRTEN1 HRTEN0 HRONE3 HRONE2 HRONE1 HRONE0
bit 7 bit 0
U-0, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC
— MINTEN2 MINTEN1 MINTEN0 MINONE3 MINONE2 MINONE1 MINONE0
bit 15 bit 8
U-0, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC R/W-x, HSC
— SECTEN2 SECTEN1 SECTEN0 SECONE3 SECONE2 SECONE1 SECONE0
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
CRCDATH CRCDATL
CRCISEL
0 1 LENDIAN
CRCWDATH CRCWDATL
CRCWDATH CRCWDATL
Read/Write Bus
Shift Buffer
Data Bit 0 Bit 1 Bit 2 Bit n(2)
Note 1: Each XOR stage of the shift engine is programmable. See text for details.
2: Polynomial length n is determined by ([PLEN<3:0>] + 1)
R-0, HCS R-1, HCS R/W-0 R/W-0, HC R/W-0 U-0 U-0 U-0
CRCFUL CRCMPT CRCISEL CRCGO LENDIAN — — —
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
VREF+ VR-
VREF-
Comparator
VINH
VR- VR+
AN0 S/H DAC
VINL
AN1
AN2
10-Bit SAR Conversion Logic
VINH
AN3
AN4
MUX A
Data Formatting
AN5
AN6
VINL ADC1BUF0:
AN7
ADC1BUFF
AN8
AD1CON1
AN9
AD1CON2
AN10 AD1CON3
AD1CHS0
AN11
VINH AD1PCFGL
MUX B
AN12 AD1PCFGH
VDDCORE AD1CSSL
VINL AD1CSSH
VBG/2
VBG
Sample Control
Control Logic
Conversion Control
Input MUX Control
Pin Config Control
R/W-0 R/W-0 R/W-0 U-0 U-0 R/W-0 R/W-0, HCS R/C-0, HCS
SSRC2 SSRC1 SSRC0 — — ASAM SAMP DONE
bit 7 bit 0
Note 1: Values of ADC1BUFx registers will not retain their values once the ADON bit is cleared. Read out the
conversion values from the buffer before disabling the module.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 15 CH0NB: Channel 0 Negative Input Select for MUX B Multiplexer Setting bit
1 = Channel 0 negative input is AN1
0 = Channel 0 negative input is VR-
bit 14-13 Unimplemented: Read as ‘0’
bit 12-8 CH0SB<4:0>: Channel 0 Positive Input Select for MUX B Multiplexer Setting bits(1,2)
11111 = Channel 0 positive input is reserved for CTMU use only(3)
1xxxx = Unimplemented; do not use.
01111 = Channel 0 positive input is internal band gap reference (VBG)
01110 = Channel 0 positive input is VBG/2
01101 = Channel 0 positive input is voltage regulator output (VDDCORE)
01100 = Channel 0 positive input is AN12
01011 = Channel 0 positive input is AN11
01010 = Channel 0 positive input is AN10
01001 = Channel 0 positive input is AN9
01000 = Channel 0 positive input is AN8
00111 = Channel 0 positive input is AN7
00110 = Channel 0 positive input is AN6
00101 = Channel 0 positive input is AN5
00100 = Channel 0 positive input is AN4
00011 = Channel 0 positive input is AN3
00010 = Channel 0 positive input is AN2
00001 = Channel 0 positive input is AN1
00000 = Channel 0 positive input is AN0
bit 7 CH0NA: Channel 0 Negative Input Select for MUX A Multiplexer Setting bit
1 = Channel 0 negative input is AN1
0 = Channel 0 negative input is VR-
bit 6-5 Unimplemented: Read as ‘0’
bit 4-0 CH0SA<4:0>: Channel 0 Positive Input Select for MUX A Multiplexer Setting bits
Implemented combinations are identical to those for CH0SB<4:0> (above).
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: Analog channels, AN6, AN7, AN8 and AN12, are unavailable on 28-pin devices; leave these corresponding
bits set.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: Analog channels, AN6, AN7, AN8 and AN12, are unavailable on 28-pin devices; leave these corresponding
bits cleared.
TAD
ADCS = –1
TCY
Note 1: Based on TCY = 2 * TOSC, Doze mode and PLL are disabled.
VDD
RIC 250 Sampling RSS 5 k(Typical)
Switch
VT = 0.6V
Rs ANx RSS
CHOLD
VA CPIN ILEAKAGE = ADC capacitance
6-11 pF VT = 0.6V 500 nA = 4.4 pF (Typical)
(Typical)
VSS
Note: CPIN value depends on the device package and is not tested. The effect of CPIN is negligible if Rs 5 k.
1023*(VR+ – VR-)
512*(VR+ – VR-)
(VINH – VINL)
VR+ – VR-
VR+
VR-
0
1024
1024
1024
Voltage Level
VR- +
VR- +
VR- +
EVPOL<1:0>
CCH<1:0>
CREF
Trigger/Interrupt CEVT
CPOL Logic COE
VIN-
VIN+ C1
CXINB
Input C1OUT
COUT Pin
CXINC Select
Logic
CXIND
EVPOL<1:0>
CVREF-
Trigger/Interrupt CEVT
CPOL Logic COE
VIN-
VIN+ C2
C2OUT
COUT Pin
EVPOL<1:0>
CXINA
Trigger/Interrupt CEVT
CVREF+
CPOL Logic COE
VIN-
VIN+ C3
C3OUT
COUT Pin
COE
VIN-
VIN+ Cx
Off (Read as ‘0’) CxOUT
Pin
Comparator CxINB > CxINA Compare Comparator CxINC > CxINA Compare
CEN = 1, CREF = 0, CCH<1:0> = 00 CEN = 1, CREF = 0, CCH<1:0> = 01
COE COE
VIN- VIN-
CXINB CXINC
VIN+ Cx VIN+ Cx
CXINA CxOUT CXINA CxOUT
Pin Pin
Comparator CxIND > CxINA Compare Comparator CVREF- > CxINA Compare
CEN = 1, CREF = 0, CCH<1:0> = 10 CEN = 1, CREF = 0, CCH<1:0> = 11
COE COE
VIN- VIN-
CXIND CVREF-
VIN+ Cx VIN+ Cx
CXINA CxOUT CXINA CxOUT
Pin Pin
Comparator CxINB > CVREF+ Compare Comparator CxINC > CVREF+ Compare
CEN = 1, CREF = 1, CCH<1:0> = 00 CEN = 1, CREF = 1, CCH<1:0> = 01
COE COE
VIN- VIN-
CXINB CXINC
VIN+ Cx VIN+ Cx
CVREF+ CxOUT CVREF+ CxOUT
Pin Pin
Comparator CxIND > CVREF+ Compare Comparator CVREF- > CVREF+ Compare
CEN = 1, CREF = 1, CCH<1:0> = 10 CEN = 1, CREF = 1, CCH<1:0> = 11
COE COE
VIN- VIN-
CXIND CVREF-
VIN+ Cx VIN+ Cx
CVREF+ CxOUT CVREF+ CxOUT
Pin Pin
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
CVRSS = 1
VREF+
AVDD
CVRSS = 0 8R
CVR<3:0>
CVREFP
CVREN R
R VREF+ 1
R CVREF+
0
R
16-to-1 MUX
16 Steps
CVREF
R
R
CVROE
R
CVREFM<1:0>
CVRR 8R
CVRSS = 1 VREF+ 11
VREF-
VBG/6 10
CVREF-
CVRSS = 0 VBG 01
AVSS VBG/2 00
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
PIC24F Device
Timer1
CTMU
EDG1 Current Source
EDG2
Output Pulse
A/D Converter
ANx
ANY
CAPP RPR
CTMU
CTEDG1 EDG1
Current Source
CTEDG2 EDG2
Output Pulse
A/D Converter
ANx
CAD
RPR
CTMU
CTEDG1 EDG1 CTPLS
Current Source
Comparator
C2INB
C2
CDELAY
CVREF
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: If TGEN = 1, the peripheral inputs and outputs must be configured to an available RPn pin. For more
information, see Section 10.4 “Peripheral Pin Select (PPS)”.
Note 1: If TGEN = 1, the peripheral inputs and outputs must be configured to an available RPn pin. For more
information, see Section 10.4 “Peripheral Pin Select (PPS)”.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: The JTAGEN bit can only be modified using In-Circuit Serial Programming™ (ICSP™). It cannot be
modified while connected through the JTAG interface.
Note 1: The JTAGEN bit can only be modified using In-Circuit Serial Programming™ (ICSP™). It cannot be
modified while connected through the JTAG interface.
Legend:
R = Readable bit PO = Program Once bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed ‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit PO = Program Once bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed ‘1’ = Bit is set ‘0’ = Bit is cleared
Note 1: Digital functions on the SOSCI and SOSCO pins are only available when configured in Digital I/O mode
(‘00’).
Legend:
R = Readable bit PO = Program Once bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed ‘1’ = Bit is set ‘0’ = Bit is cleared
R R R R R R R R
FAMID7 FAMID6 FAMID5 FAMID4 FAMID3 FAMID2 FAMID1 FAMID0
bit 15 bit 8
R R R R R R R R
DEV7 DEV6 DEV5 DEV4 DEV3 DEV2 DEV1 DEV0
bit 7 bit 0
U U U U U U U U
— — — — — — — —
bit 15 bit 8
U U U U R R R R
— — — — REV3 REV2 REV1 REV0
bit 7 bit 0
FWPSA WDTPS<3:0>
Transition to
New Clock Source
Exit Sleep or
Idle Mode
CLRWDT Instr.
PWRSAV Instr.
NOTICE: Stresses above those listed under “Absolute Maximum Ratings” may cause permanent damage to the
device. This is a stress rating only and functional operation of the device at those or any other conditions above those
indicated in the operation listings of this specification is not implied. Exposure to maximum rating conditions for
extended periods may affect device reliability.
3.00V
2.75V 2.75V
Voltage (VDDCORE)(1)
2.35V 2.35V
2.00V
16 MHz 32 MHz
Frequency
For frequencies between 16 MHz and 32 MHz, FMAX = (45.7 MHz/V) * (VDDCORE – 2V) + 16 MHz.
Note 1: When the voltage regulator is disabled, VDD and VDDCORE must be maintained so that
VDDCOREVDD3.6V.
3.00V
2.75V 2.75V
(VDDCORE)(1)
2.00V
Voltage
16 MHz 24 MHz
Frequency
For frequencies between 16 MHz and 24 MHz, FMAX = (22.9 MHz/V) * (VDDCORE – 2V) + 16 MHz.
Note 1: When the voltage regulator is disabled, VDD and VDDCORE must be maintained so that
VDDCOREVDD3.6V.
Load Condition 1 – for all pins except OSCO Load Condition 2 – for OSCO
VDD/2
RL Pin CL
VSS
CL
Pin RL = 464
CL = 50 pF for all pins except OSCO
VSS
15 pF for OSCO output
Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3
OSCI
OS20
OS30 OS30 OS31 OS31
OS25
CLKO
OS40 OS41
I/O Pin
(Input)
DI35
DI40
TABLE 28-21: RESET, POWER-UP TIMER AND BROWN-OUT RESET TIMING REQUIREMENTS
Standard Operating Conditions: 2.0V to 3.6V
(unless otherwise stated)
AC CHARACTERISTICS
Operating temperature -40°C TA +85°C for Industrial
-40°C TA +125°C for Extended
Param
Symbol Characteristic Min. Typ(1) Max. Units Conditions
No.
SY10 TmcL MCLR Pulse Width (low) 2 — — s
SY11 TPWRT Power-up Timer Period — 64 — ms
SY12 TPOR Power-on Reset Delay — 2 — s
SY13 TIOZ I/O High-Impedance from MCLR — — 100 ns
Low or Watchdog Timer Reset
SY25 TBOR Brown-out Reset Pulse Width 1 — — s VDD VBOR
TRST Internal State Reset Time — 50 — s
TDSWU Wake-up from Deep Sleep Time — 200 — s Based on full discharge of
10 F capacitor on VCAP.
Includes TPOR and TRST.
TPM — 10 — s Sleep wake-up with PMSLP = 0
— 190 — s and WUTSEL<1:0> = 11
Note 1: Data in “Typ” column is at 3.3V, 25°C unless otherwise stated.
24FJ32GA
XXXXXXXX
102/ML e3
XXXXXXXX
1010017
YYWWNNN
Example
28-Lead SOIC (.300”)
PIC24FJ32GA102/SO e3
XXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXX 1010017
XXXXXXXXXXXXXXXXXXXX
YYWWNNN
Example
28-Lead SPDIP
PIC24FJ32GA102
XXXXXXXXXXXXXXXXX -I/SP e3
XXXXXXXXXXXXXXXXX 1010017
YYWWNNN
XXXXXXXXXXXX PIC24FJ32GA
XXXXXXXXXXXX 102-I/SS e3
YYWWNNN 1010017
XXXXXXXXXX 24FJ32GA
XXXXXXXXXX 104-I/ML e3
XXXXXXXXXX 1010017
YYWWNNN
XXXXXXXXXX 24FJ32GA
XXXXXXXXXX 104-I/PT e3
XXXXXXXXXX 1010017
YYWWNNN
!"
#
$ %&'' ()
)
$
* 2%
& %!
%
*
") '
%
*
$%%
"%
%%
133)))&
&3
*
D D2
EXPOSED
PAD
E
b
E2
2 2
1 1 K
N N
NOTE 1 L
TOP VIEW BOTTOM VIEW
A3 A1
4% 55,,
&
5&% 6 67 8
6!&(
$ 6 9
%
:./0
7
;
% 9
%"$$ .
0%%*
+ ,2
7
<"% , :/0
,#
""<"% , +:. +
7
5
% :/0
,#
""5
% +:. +
0%%<"% ( + + +.
0%%5
% 5 . ..
0%% % ,#
"" = > >
*
!"
#$
%!
&'(!%&! %(
%
")%%
%
"
*
) !%
"
+ &
"%
,-.
/01 / &
%
#%!
))%!%%
,21
$
&
'! !)%!%%
'$$&%
!
) 0 ./
D
N
E
E1
NOTE 1
1 2 3
e
b
h
α
h
φ c
A A2
L
A1 L1 β
4% 55,,
&
5&% 6 67 8
6!&(
$ 6 9
%
/0
7
;
% > > :.
"
"*
*
. > >
%"$$? > +
7
<"% , +/0
"
"*
<"% , ./0
7
5
% /0
0&$
@
%A . > .
2%5
% 5 >
2%
% 5 ,2
2%
I B > 9B
5
"*
9 > ++
5
"<"% ( + > .
"$%
D .B > .B
"$%
/%%& E .B > .B
*
!"
#$
%!
&'(!%&! %(
%
")%%
%
"
?$%0%
%
+ &
","%!"
&"$
%! "$
%! %
#
".&&
"
&
"%
,-.
/01 / &
%
#%!
))%!%%
,21
$
&
'! !)%!%%
'$$&%
!
) 0 ./
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
+))
0 /)) +
1%% !+
0/
"
* 2%
& %!
%
*
") '
%
*
$%%
"%
%%
133)))&
&3
*
N
NOTE 1
E1
1 2 3
A A2
L c
A1 b1
b e eB
4% 60;,
&
5&% 6 67 8
6!&(
$ 6 9
%
/0
%
%
> >
"
"*
*
+. .
/
%
%
. > >
!"
%!"
<"% , + ++.
"
"*
<"% , 9. .
7
5
% +. +:.
%
%
5 + .
5
"*
9 .
4
) 0 /
22
!"
* 2%
& %!
%
*
") '
%
*
$%%
"%
%%
133)))&
&3
*
D D2
EXPOSED
PAD
E2
b
2 2
1 1
N N K
NOTE 1 L
A3 A1
4% 55,,
&
5&% 6 67 8
6!&(
$ 6
%
:./0
7
;
% 9
%"$$ .
0%%*
+ ,2
7
<"% , 9/0
,#
""<"% , :+ :. :9
7
5
% 9/0
,#
""5
% :+ :. :9
0%%<"% ( . + +9
0%%5
% 5 + .
0%% % ,#
"" = > >
*
!"
#$
%!
&'(!%&! %(
%
")%%
%
"
*
) !%
"
+ &
"%
,-.
/01 / &
%
#%!
))%!%%
,21
$
&
'! !)%!%%
'$$&%
!
) 0 +/
22
!"
* 2%
& %!
%
*
") '
%
*
$%%
"%
%%
133)))&
&3
*
22
3$)
4
3 5%5%5 &%% !3
"
* 2%
& %!
%
*
") '
%
*
$%%
"%
%%
133)))&
&3
*
D
D1
E
e
E1
N
b
NOTE 1 1 2 3
NOTE 2
A α
c φ
β A1 A2
L L1
4% 55,,
&
5&% 6 67 8
6!&(
$5
" 6
5
"%
9/0
7
;
% > >
"
"*
*
. .
%"$$ . > .
2%5
% 5 . : .
2%
% 5 ,2
2%
I B +.B B
7
<"% , /0
7
5
% /0
"
"*
<"% , /0
"
"*
5
% /0
5
"*
>
5
"<"% ( + + .
"$%
D B B +B
"$%
/%%& E B B +B
*
!"
#$
%!
&'(!%&! %(
%
")%%
%
"
0&$
%
%D E
&
+ &
","%!"
&"$
%! "$
%! %
#
".&&
"
&
"%
,-.
/01 / &
%
#%!
))%!%%
,21
$
&
'! !)%!%%
'$$&%
!
) 0 :/
22
3$)
4
3 5%5%5 &%% !3
"
* 2%
& %!
%
*
") '
%
*
$%%
"%
%%
133)))&
&3
*
+$6) + ,
) ++ '&1% !++,
"
* 2%
& %!
%
*
") '
%
*
$%%
"%
%%
133)))&
&3
*
D
N
E
E1
1 2
b
NOTE 1
e
c
A A2
φ
A1
L1 L
4% 55,,
&
5&% 6 67 8
6!&(
$ 6 9
%
:./0
7
;
% > >
"
"*
*
:. . 9.
%"$$ . > >
7
<"% , 9 9
"
"*
<"% , . .+ .:
7
5
% .
2%5
% 5 .. . .
2%
% 5 .,2
5
"*
> .
2%
I B B 9B
5
"<"% ( > +9
*
!"
#$
%!
&'(!%&! %(
%
")%%
%
"
&
","%!"
&"$
%! "$
%! %
#
"&&
"
+ &
"%
,-.
/01 / &
%
#%!
))%!%%
,21
$
&
'! !)%!%%
'$$&%
!
) 0 +/
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
B C
Block Diagrams C Compilers
10-Bit High-Speed A/D Converter............................. 220 MPLAB C18.............................................................. 252
Charge Time Measurement Unit. See CTMU.
16-Bit Asynchronous Timer3 and Timer5 ................. 147
16-Bit Synchronous Timer2 and Timer4 ................... 147 Code Examples
16-Bit Timer1 Module................................................ 143 Basic Sequence for Clock Switching ........................ 107
Configuring UART1 Input and Output
32-Bit Timer2/3 and Timer4/5 ................................... 146
8-Bit Multiplexed Address and Data Functions (PPS), ‘C’ ......................................... 128
Application Example ......................................... 200 Configuring UART1 Input and Output
Functions (PPS), Assembly.............................. 128
Accessing Program Memory Using
Table Instructions .............................................. 49 Erasing a Program Memory Block, ‘C’........................ 55
Addressable PSP Example....................................... 198 Erasing a Program Memory Block, Assembly ............ 54
I/O Port Write/Read .................................................. 122
Addressing for Table Registers................................... 51
CALL Stack Frame...................................................... 47 Initiating a Programming Sequence, ‘C’ ..................... 56
Initiating a Programming Sequence, Assembly.......... 56
Comparator Voltage Reference ................................ 233
Loading the Write Buffers, ‘C’..................................... 56
CPU Programmer’s Model .......................................... 27
CRC Module ............................................................. 213 Loading the Write Buffers, Assembly ......................... 55
CRC Shift Engine...................................................... 213 PWRSAV Instruction Syntax .................................... 111
Setting the RTCWREN Bit ........................................ 202
CTMU Connections and Internal Configuration
for Capacitance Measurement.......................... 235 Single-Word Flash Programming, ‘C’ ......................... 57
CTMU Typical Connections and Internal Single-Word Flash Programming, Assembly.............. 57
Code Protection ................................................................ 248
Configuration for Pulse Delay Generation ........ 236
Code Segment.......................................................... 249
CTMU Typical Connections and Internal
Code Segment Protection
Configuration for Time Measurement ............... 236
Configuration Options....................................... 249
Data Access From Program Space Address
Configuration Register.............................................. 249
Generation .......................................................... 48
General Segment ..................................................... 248
I2C Module ................................................................ 176
Comparator Voltage Reference ........................................ 233
Individual Comparator Configurations....................... 230
Input Capture ............................................................ 151 Configuring ............................................................... 233
Configuration Bits ............................................................. 239
LCD Control Example, Byte Mode ............................ 200
Legacy PSP Example ............................................... 198 Core Features....................................................................... 9
Master Mode, Demultiplexed Addressing ................. 198 CPU
Arithmetic Logic Unit (ALU) ........................................ 29
Master Mode, Fully Multiplexed Addressing ............. 199
Master Mode, Partially Multiplexed Addressing ........ 199 Control Registers........................................................ 28
Multiplexed Addressing Application Example ........... 199 Core Registers............................................................ 27
Programmer’s Model .................................................. 25
On-Chip Regulator Connections ............................... 246
Output Compare (16-Bit Mode)................................. 156
Parallel EEPROM Example, 16-Bit Data .................. 200
Parallel EEPROM Example, 8-Bit Data .................... 200
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________ FAX: (______) _________ - _________
Application (optional):
Would you like a reply? Y N
Questions:
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this document easy to follow? If not, why?
4. What additions to the document do you think would enhance the structure and subject?
5. What deletions from the document could be made without affecting the overall usefulness?
07/15/10