PIC24HJ128GP502
PIC24HJ128GP502
PIC24HJ128GP502
PIC24HJ64GPX02/X04 and
PIC24HJ128GPX02/X04
16-bit Microcontrollers
(up to 128 KB Flash and 8K SRAM) with Advanced Analog
Packages
Type SPDIP SOIC QFN-S QFN TQFP
Pin Count 28 28 28 44 44
I/O Pins 21 21 21 35 35
Contact Lead/Pitch .100'' 1.27 0.65 0.65 0.80
Dimensions 1.365x.285x.135'' 17.9x7.50x2.05 6x6x0.9 8x8x0.9 10x10x1
Note: All dimensions are in millimeters (mm) unless specified.
PIC24HJ32GP302/304,
PIC24HJ64GPX02/X04 AND
PIC24HJ128GPX02/X04 PRODUCT
FAMILIES
The device names, pin counts, memory sizes and
peripheral availability of each device are listed below.
The following pages show their pinout diagrams.
(2 Channels/Voltage Regulator)
Program Flash Memory
10-bit/12-bit ADC
CRC Generator
RAM (Kbyte)(1)
Remappable Pins
Output Compare
(Address Lines)
Standard PWM
Input Capture
16-bit Timer(2)
(Channels)
Packages
I/O Pins
(Kbyte)
RTCC
I2C™
ECAN™
Pins
Device
UART
SPI
Pin Diagrams
28-Pin SPDIP, SOIC
Pins are up to 5V tolerant
MCLR 1 28 AVDD
AN0/VREF+/CN2/RA0 2 27 AVSS
AN1/VREF-/CN3/RA1 3 26 AN9/RP15(1)/CN11/PMCS1/RB15
PGED1/AN2/C2IN-/RP0(1)/CN4/RB0 4 25 AN10/RTCC/RP14(1)/CN12/PMWR/RB14
PGEC1/ AN3/C2IN+/RP1(1)/CN5/RB1 AN11/RP13(1)/CN13/PMRD/RB13
PIC24HJ128GP502
PIC24HJ128GP202
PIC24HJ64GP502
PIC24HJ64GP202
PIC24HJ32GP302
5 24
(1)
AN4/C1IN-/RP2 /CN6/RB2 6 23 AN12/RP12(1)/CN14/PMD0/RB12
AN5/C1IN+/RP3(1)/CN7/RB3 7 22 PGEC2/TMS/RP11(1)/CN15/PMD1/RB11
VSS 8 21 PGED2/TDI/RP10(1)/CN16/PMD2/RB10
OSC1/CLKI/CN30/RA2 9 20 VCAP(3)
OSC2/CLKO/CN29/PMA0/RA3 10 19 VSS
SOSCI/RP4(1)/CN1/PMBE/RB4 11 18 TDO/SDA1/RP9(1)/CN21/PMD3/RB9
SOSCO/T1CK/CN0/PMA1/RA4 12 17 TCK/SCL1/RP8(1)/CN22/PMD4/RB8
VDD 13 16 INT0/RP7(1)/CN23/PMD5/RB7
PGED3/ASDA1/RP5(1)/CN27/PMD7/RB5 14 15 PGEC3/ASCL1/RP6(1)/CN24/PMD6/RB6
AN10/RTCC/RP14/CN12/PMWR/RB14
AN9/RP15/CN11/PMCS1/RB15
AN0/VREF+/CN2/RA0
AN1/VREF-/CN3/RA1
MCLR
AVDD
AVSS
22
28
26
27
23
24
25
PGED1/AN2/C2IN-/RP0(1)/CN4/RB0 1 21 AN11/RP13(1)/CN13/PMRD/RB13
PGEC1/AN3/C2IN+/RP1(1)/CN5/RB1 2 PIC24HJ32GP302 20 AN12/RP12(1)/CN14/PMD0/RB12
AN4/C1IN-/RP2(1)/CN6/RB2 3 PIC24HJ64GP202 19 PGEC2/TMS/RP11(1)/CN15/PMD1/RB11
AN5/C1IN+/RP3(1)/CN7/RB3 4 PIC24HJ64GP502 18 PGED2/TDI/RP10(1)/CN16/PMD2/RB10
VSS 5 PIC24HJ128GP202 VCAP(3)
17
PIC24HJ128GP502
OSC1/CLKI/CN30/RA2 6 16 VSS
OSC2/CLKO/CN29/PMA0/RA3 7 15 TDO/SDA1/RP9(1)/CN21/PMD3/RB9
14
10
13
12
11
9
8 SOSCI/RP4(1)/CN1/PMBE/RB4
SOSCO/T1CK/CN0/PMA1/RA4
PGED3/ASDA1/RP5(1)/CN27/PMD7/RB5
PGEC3//ASCL1/RP6(1)/CN24/PMD6/RB6
INT0/RP7(1)/CN23/PMD5/RB7
TCK/SCL1/RP8(1)/CN22/PMD4/RB8
VDD
Note 1: The RPx pins can be used by any remappable peripheral. See Table 1 in this section for the list of available peripherals.
2: The metal plane at the bottom of the device is not connected to any pins and is recommended to be connected to VSS externally.
3: Refer to Section 2.3 “CPU Logic Filter Capacitor Connection (VCAP)” for proper connection to this pin.
AN10/RTCC/RP14(1)/CN12/PMWR/RB14
PGEC1/AN3/C2IN+/RP1(1)/CN5/RB1
PGED1/AN2/C2IN-/RP0(1)/CN4/RB0
AN9/RP15(1)/CN11/PMCS1/RB15
AN0/VREF+/CN2/RA0
AN1/VREF-/CN3/RA1
TMS/PMA10/RA10
TCK/PMA7/RA7
MCLR
AVDD
AVSS
AN4/C1IN-/RP2(1)/CN6/RB2 11 AN11/RP13(1)/CN13/PMRD/RB13
21
20
22
19
18
17
16
15
14
13
12
23
(1)
AN5/C1IN+/RP3 /CN7/RB3 24 10 AN12/RP12(1)/CN14/PMD0/RB12
AN6/RP16(1)/CN8/RC0 25 9 PGEC2/RP11(1)/CN15/PMD1/RB11
AN7/RP17(1)/CN9/RC1 26 8 PGED2/RP10(1)/CN16/PMD2/RB10
(1)
PIC24HJ32GP304
AN8/CVREF/RP18 /PMA2/CN10/RC2 27 PIC24HJ64GP204 7 VCAP(3)
VDD 28 PIC24HJ64GP504 6 VSS
VSS 29 PIC24HJ128GP204 5 RP25(1)/CN19/PMA6/RC9
OSC1/CLKI/CN30/RA2 30 PIC24HJ128GP504 4 RP24(1)/CN20/PMA5/RC8
OSC2/CLKO/CN29/RA3 31 3 RP23(1)/CN17/PMA0/RC7
TDO/PMA8/RA8 32 2 RP22(1)/CN18/PMA1/RC6
SOSCI/RP4(1)/CN1/RB4 33 1 SDA1/RP9(1)/CN21/PMD3/RB9
41
34
35
36
37
38
39
40
42
43
44
SOSCO/T1CK/CN0/RA4
RP19(1)/CN28/PMBE/RC3
RP20(1)/CN25/PMA4/RC4
RP21(1)/CN26/PMA3/RC5
PGED3/ASDA1/RP5 /CN27/PMD7/RB5
PGEC3/ASCL1/RP6(1)/CN24/PMD6/RB6
INT0/RP7(1)/CN23/PMD5/RB7
SCL1/RP8(1)/CN22/PMD4/RB8
TDI/PMA9/RA9
VSS
VDD
(1)
Note 1: The RPx pins can be used by any remappable peripheral. See Table 1 in this section for the list of available peripherals.
2: The metal plane at the bottom of the device is not connected to any pins and is recommended to be connected to VSS externally.
3: Refer to Section 2.3 “CPU Logic Filter Capacitor Connection (VCAP)” for proper connection to this pin.
AN10/RTCC/RP14(1)/CN12/PMWR/RB14
PGEC1/AN3/C2IN+/RP1(1)/CN5/RB1
PGED1/AN2/C2IN-/RP0(1)/CN4/RB0
AN9/RP15(1)/CN11/PMCS1/RB15
AN0/VREF+/CN2/RA0
AN1/VREF-/CN3/RA1
TMS/PMA10/RA10
TCK/PMA7/RA7
MCLR
AVDD
AVSS
22
21
20
19
18
17
16
15
14
13
12
AN4/C1IN-/RP2(1)/CN6/RB2 23 11 AN11/RP13(1)/CN13/PMRD/RB13
AN5/C1IN+/RP3(1)/CN7/RB3 24 10 AN12/RP12(1)/CN14/PMD0/RB12
AN6/RP16(1)/CN8/RC0 25 9 PGEC2/RP11(1)/CN15/PMD1/RB11
AN7/RP17(1)/CN9/RC1 26 PIC24HJ32GP304 8 PGED2/EMCD2/RP10(1)/CN16/PMD2/RB10
AN8/CVREF/RP18(1)/PMA2/CN10/RC2 27 PIC24HJ64GP204 7 VCAP(2)
VDD 28 PIC24HJ64GP504 6 VSS
VSS 29 PIC24HJ128GP204 5 RP25(1)/CN19/PMA6/RC9
OSC1/CLKI/CN30/RA2 30 PIC24HJ128GP504 4 RP24(1)/CN20/PMA5/RC8
OSC2/CLKO/CN29/RA3 31 3 RP23(1)/CN17/PMA0/RC7
TDO/PMA8/RA8 32 2 RP22(1)/CN18/PMA1/RC6
SOSCI/RP4(1)/CN1/RB4 33 1 SDA1/RP9(1)/CN21/PMD3/RB9
34
35
36
37
39
40
41
42
43
44
38
PGEC3/ASCL1/RP6(1)/CN24/PMD6/RB6
TDI/PMA9/RA9
RP19(1)/CN28/PMBE/RC3
PGED3/ASDA1/RP5 /CN27/PMD7/RB5
INT0/RP7(1)/CN23/PMD5/RB7
SCL1/RP8(1)/CN22/PMD4/RB8
SOSCO/T1CK/CN0/RA4
RP20 /CN25/PMA4/RC4
RP21(1)/CN26/PMA3/RC5
VSS
VDD
(1)
(1)
Note 1: The RPx pins can be used by any remappable peripheral. See Table 1 in this section for the list of available peripherals.
2: Refer to Section 2.3 “CPU Logic Filter Capacitor Connection (VCAP)” for proper connection to this pin.
Table of Contents
PIC24HJ32GP302/304, PIC24HJ64GPX02/X04 and PIC24HJ128GPX02/X04 Product Families ........................................................ 2
1.0 Device Overview .......................................................................................................................................................................... 9
2.0 Guidelines for Getting Started with 16-bit Microcontrollers ........................................................................................................ 13
3.0 CPU............................................................................................................................................................................................ 17
4.0 Memory Organization ................................................................................................................................................................. 25
5.0 Flash Program Memory .............................................................................................................................................................. 53
6.0 Resets ....................................................................................................................................................................................... 59
7.0 Interrupt Controller ..................................................................................................................................................................... 69
8.0 Direct Memory Access (DMA) .................................................................................................................................................. 107
9.0 Oscillator Configuration ............................................................................................................................................................ 119
10.0 Power-Saving Features............................................................................................................................................................ 129
11.0 I/O Ports ................................................................................................................................................................................... 135
12.0 Timer1 ...................................................................................................................................................................................... 161
13.0 Timer2/3 And TImer4/5 Feature .............................................................................................................................................. 165
14.0 Input Capture............................................................................................................................................................................ 171
15.0 Output Compare....................................................................................................................................................................... 175
16.0 Serial Peripheral Interface (SPI)............................................................................................................................................... 179
17.0 Inter-Integrated Circuit™ (I2C™) .............................................................................................................................................. 185
18.0 Universal Asynchronous Receiver Transmitter (UART) ........................................................................................................... 193
19.0 Enhanced CAN (ECAN™) Module ........................................................................................................................................... 199
20.0 10-bit/12-bit Analog-to-Digital Converter (ADC1) ..................................................................................................................... 227
21.0 Comparator Module.................................................................................................................................................................. 241
22.0 Real-Time Clock and Calendar (RTCC) .................................................................................................................................. 247
23.0 Programmable Cyclic Redundancy Check (CRC) Generator .................................................................................................. 259
24.0 Parallel Master Port (PMP)....................................................................................................................................................... 265
25.0 Special Features ...................................................................................................................................................................... 273
26.0 Instruction Set Summary .......................................................................................................................................................... 283
27.0 Development Support............................................................................................................................................................... 291
28.0 Electrical Characteristics .......................................................................................................................................................... 295
29.0 High Temperature Electrical Characteristics ............................................................................................................................ 345
32.0 DC and AC Device Characteristics Graphs.............................................................................................................................. 357
33.0 Packaging Information.............................................................................................................................................................. 361
Appendix A: Revision History............................................................................................................................................................. 371
The Microchip Web Site ..................................................................................................................................................................... 385
Customer Change Notification Service .............................................................................................................................................. 385
Customer Support .............................................................................................................................................................................. 385
Reader Response .............................................................................................................................................................................. 386
Product Identification System............................................................................................................................................................. 387
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.
Referenced Sources
This device data sheet is based on the following
individual chapters of the “dsPIC33F/PIC24H Family
Reference Manual”. These documents should be
considered as the general reference for the operation
of a particular module or device feature.
Note 1: To access the documents listed below,
browse to the documentation section of
the PIC24HJ64GP204 product page of
the Microchip web site
(www.microchip.com) or select a family
reference manual section from the
following list.
In addition to parameters, features, and
other documentation, the resulting page
provides links to the related family
reference manual sections.
16
8 16 16
Data Latch
23 DMA
RAM PORTB
PCU PCH PCL X RAM
23
Program Counter
Stack Loop Address
Control Control Latch
Logic Logic
16
23
16
DMA
PORTC
Controller
Address Latch Address Generator Units
Program Memory
EA MUX Remappable
Pins
Data Latch ROM Latch
24
16 16
Literal Data
Instruction
Decode and
Control Instruction Reg
16
Control Signals
to Various Blocks 17 x 17 Multiplier
16 x 16
OSC2/CLKO Timing Power-up W Register Array
OSC1/CLKI Generation Timer Divide Support
16
Oscillator
FRC/LPRC Start-up Timer
Oscillators
Power-on
Reset
Precision
16-bit ALU
Band Gap Watchdog
Reference Timer
16
Brown-out
Voltage Reset
Regulator
Note: Not all pins or features are implemented on all device pinout configurations. See “Pin Diagrams” for the specific pins and features
present on each device.
FIGURE 2-1: RECOMMENDED The placement of this capacitor should be close to the
MINIMUM CONNECTION VCAP. It is recommended that the trace length not
exceed one-quarter inch (6 mm). Refer to Section 25.2
0.1 µF “On-Chip Voltage Regulator” for details.
10 µF Ceramic
VDD
Tantalum
2.4 Master Clear (MCLR) Pin
VDD
VSS
VCAP
R
R1 The MCLR pin provides for two specific device
MCLR functions:
• Device Reset
C
• Device programming and debugging
PIC24H
During device programming and debugging, the
VSS VDD
resistance and capacitance that can be added to the
pin must be considered. Device programmers and
VDD VSS
0.1 µF 0.1 µF debuggers drive the MCLR pin. Consequently,
AVDD
AVSS
VDD
Ceramic
VSS
Ceramic specific voltage levels (VIH and VIL) and fast signal
transitions must not be adversely affected. Therefore,
0.1 µF 0.1 µF specific values of R and C will need to be adjusted
Ceramic Ceramic based on the application and PCB requirements.
L1(1)
For example, as shown in Figure 2-2, it is
Note 1: As an option, instead of a hard-wired connection, an recommended that the capacitor C, be isolated from
inductor (L1) can be substituted between VDD and the MCLR pin during programming and debugging
AVDD to improve ADC noise rejection. The inductor operations.
impedance should be less than 1Ω and the inductor
capacity greater than 10 mA. Place the components shown in Figure 2-2 within
Where: one-quarter inch (6 mm) from the MCLR pin.
f = F CNV
-------------
- (i.e., ADC conversion rate/2) FIGURE 2-2: EXAMPLE OF MCLR PIN
2
CONNECTIONS
1 -
f = ----------------------
( 2π LC ) VDD
1 2
L = ⎛ ---------------------⎞
⎝ ( 2πf C )⎠ R(1)
R1(2)
MCLR
2.2.1 TANK CAPACITORS
JP PIC24H
On boards with power traces running longer than six
inches in length, it is suggested to use a tank capacitor C
for integrated circuits including MCUs to supply a local
power source. The value of the tank capacitor should
be determined based on the trace resistance that Note 1: R ≤ 10 kΩ is recommended. A suggested
connects the power supply source to the device, and starting value is 10 kΩ. Ensure that the MCLR
the maximum current drawn by the device in the pin VIH and VIL specifications are met.
application. In other words, select the tank capacitor so 2: R1 ≤ 470Ω will limit any current flowing into
that it meets the acceptable voltage sag at the device. MCLR from the external capacitor C, in the
Typical values range from 4.7 µF to 47 µF. event of MCLR pin breakdown, due to
Electrostatic Discharge (ESD) or Electrical
2.3 CPU Logic Filter Capacitor Overstress (EOS). Ensure that the MCLR pin
VIH and VIL specifications are met.
Connection (VCAP)
A low-ESR (< 5 Ohms) capacitor is required on the
VCAP pin, which is used to stabilize the voltage
regulator output voltage. The VCAP pin must not be
connected to VDD, and must have a capacitor between
4.7 µF and 10 µF, preferably surface mount connected
within one-eights inch of the VCAP pin connected to
ground. The type can be ceramic or tantalum. Refer to
Section 28.0 “Electrical Characteristics” for
additional information.
19
20
16 16 16
8
Data Latch
23 DMA
PCU PCH PCL X RAM 16
23 RAM
Program Counter
Stack Loop Address
Control Control Latch
Logic Logic
23
16 DMA
Program Memory
EA MUX
Instruction
Decode and
Control Instruction Reg
16
16-bit ALU
16
To Peripheral Modules
D15 D0
W0/WREG
PUSH.S Shadow
W1
Legend
W2
W3
W4
W5
W6
W7
Working Registers
W8
W9
W10
W11
W12
W13
W14/Frame Pointer
W15/Stack Pointer
PC22 PC0
0 Program Counter
7 0
TBLPAG Data Table Page Address
7 0
PSVPAG Program Space Visibility Page Address
15 0
RCOUNT REPEAT Loop Counter
15 0
CORCON Core Configuration Register
SRH SRL
Legend:
C = Clear only bit R = Readable bit U = Unimplemented bit, read as ‘0’
S = Set only bit W = Writable bit -n = Value at POR
‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: The IPL<2:0> bits are concatenated with the IPL<3> bit (CORCON<3>) to form the CPU Interrupt Priority
Level. The value in parentheses indicates the IPL if IPL<3> = 1. User interrupts are disabled when
IPL<3> = 1.
2: The IPL<2:0> Status bits are read only when the NSTDIS bit (INTCON1<15>) = 1.
Note 1: The IPL3 bit is concatenated with the IPL<2:0> bits (SR<7:5>) to form the CPU interrupt priority level.
NOTES:
User Program
Flash Memory 0x0057FE
(22016 instructions) 0x005800
User Program
Flash Memory
(44032 instructions)
0x00ABFE
0x00AC00
Unimplemented
(Read ‘0’s) Unimplemented 0x0157FE
(Read ‘0’s) 0x015800
Unimplemented
(Read ‘0’s)
0x7FFFFE
0x800000
0xF7FFFE
Device Configuration Device Configuration Device Configuration 0xF80000
Registers Registers Registers 0xF80017
0xF80018
0xFEFFFE
DEVID (2) DEVID (2) DEVID (2) 0xFF0000
0xFF0002
Reserved Reserved Reserved
0xFFFFFE
Note: Memory areas are not shown to scale.
4.2 Data Address Space All word accesses must be aligned to an even address.
Misaligned word data fetches are not supported, so
The PIC24HJ32GP302/304, PIC24HJ64GPX02/X04 care must be taken when mixing byte and word
and PIC24HJ128GPX02/X04 CPU has a separate operations, or translating from 8-bit MCU code. If a
16-bit wide data memory space. The data space is misaligned read or write is attempted, an address error
accessed using separate Address Generation Units trap is generated. If the error occurred on a read, the
(AGUs) for read and write operations. The data instruction underway is completed. If the error occurred
memory maps are shown in Figure 4-3 and Figure 4-4. on a write, the instruction is executed but the write does
All Effective Addresses (EAs) in the data memory space not occur. In either case, a trap is then executed,
are 16 bits wide and point to bytes within the data space. allowing the system and/or user application to examine
This arrangement gives a data space address range of the machine state prior to execution of the address
64 Kbytes or 32K words. The lower half of the data Fault.
memory space (that is, when EA<15> = 0) is used for All byte loads into any W register are loaded into the
implemented memory addresses, while the upper half Least Significant Byte. The Most Significant Byte is not
(EA<15> = 1) is reserved for the Program Space modified.
Visibility area (see Section 4.6.3 “Reading Data from
Program Memory Using Program Space Visibility”). A sign-extend instruction (SE) is provided to allow user
applications to translate 8-bit signed data to 16-bit
PIC24HJ32GP302/304, PIC24HJ64GPX02/X04 and signed values. Alternatively, for 16-bit unsigned data,
PIC24HJ128GPX02/X04 devices implement up to user applications can clear the MSB of any W register
8 Kbytes of data memory. Should an EA point to a by executing a zero-extend (ZE) instruction on the
location outside of this area, an all-zero word or byte is appropriate address.
returned.
4.2.3 SFR SPACE
4.2.1 DATA SPACE WIDTH
The first 2 Kbytes of the Near Data Space, from 0x0000
The data memory space is organized in byte to 0x07FF, is primarily occupied by Special Function
addressable, 16-bit wide blocks. Data is aligned in data Registers (SFRs). These are used by the
memory and registers as 16-bit words, but all data PIC24HJ32GP302/304, PIC24HJ64GPX02/X04 and
space EAs resolve to bytes. The Least Significant PIC24HJ128GPX02/X04 core and peripheral modules
Bytes (LSBs) of each word have even addresses, while for controlling the operation of the device.
the Most Significant Bytes (MSBs) have odd
addresses. SFRs are distributed among the modules that they
control, and are generally grouped together by module.
4.2.2 DATA MEMORY ORGANIZATION Much of the SFR space contains unused addresses;
AND ALIGNMENT these are read as ‘0’.
To maintain backward compatibility with PIC® MCU Note: The actual set of peripheral features and
devices and improve data space memory usage interrupts varies by the device. Refer to
efficiency, the PIC24HJ32GP302/304, the corresponding device tables and
PIC24HJ64GPX02/X04 and PIC24HJ128GPX02/X04 pinout diagrams for device-specific
instruction set supports both word and byte operations. information.
As a consequence of byte accessibility, all effective
address calculations are internally scaled to step 4.2.4 NEAR DATA SPACE
through word-aligned memory. For example, the core The 8 Kbyte area between 0x0000 and 0x1FFF is
recognizes that Post-Modified Register Indirect referred to as the near data space. Locations in this
Addressing mode [Ws++] results in a value of Ws + 1 space are directly addressable via a 13-bit absolute
for byte operations and Ws + 2 for word operations. address field within all memory direct instructions.
A data byte read, reads the complete word that Additionally, the whole data space is addressable using
contains the byte, using the LSB of any EA to MOV instructions, which support Memory Direct
determine which byte to select. The selected byte is Addressing mode with a 16-bit address field, or by
placed onto the LSB of the data path. That is, data using Indirect Addressing mode using a working
memory and registers are organized as two parallel register as an address pointer.
byte-wide entities with shared (word) address decode
but separate write lines. Data byte writes only write to
the corresponding side of the array or register that
matches the byte address.
4.2.5 DMA RAM When the CPU and the DMA controller attempt to
concurrently write to the same DMA RAM location, the
The PIC24HJ32GP302/304 devices contain 1 Kbytes
hardware ensures that the CPU is given precedence in
of dual ported DMA RAM located at the end of X data
accessing the DMA RAM location. Therefore, the DMA
space. The PIC24HJ64GPX02/X04 and
RAM provides a reliable means of transferring DMA
PIC24HJ128GPX02/X04 devices contain 2 Kbytes of
data without ever having to stall the CPU.
dual ported DMA RAM located at the end of X data
space, and is a part of X data space. Memory Note: DMA RAM can be used for general
locations in the DMA RAM space are accessible purpose data storage if the DMA function
simultaneously by the CPU and the DMA controller is not required in an application.
module. DMA RAM is utilized by the DMA controller to
store data to be transferred to various peripherals
using DMA, as well as data transferred from various
peripherals using DMA. The DMA RAM can be
accessed by the DMA controller without having to
steal cycles from the CPU.
FIGURE 4-3: DATA MEMORY MAP FOR PIC24HJ32GP302/304 DEVICES WITH 4 KB RAM
MSb LSb
Address 16 bits Address
MSb LSb
0x0000 0x0000
2 Kbyte SFR Space
SFR Space 0x07FF 0x07FE
0x0801 0x0800
6 Kbyte
X Data RAM (X) Near
Data
4 Kbyte Space
SRAM Space
0x13FF 0x13FE
0x1401 0x1400
DMA RAM
0x17FF 0x17FE
0x1801 0x1800
0x8001 0x8000
Optionally X Data
Mapped
Unimplemented (X)
into Program
Memory
0xFFFF 0xFFFE
8 Kbyte
X Data RAM (X) Near
Data
8 Kbyte Space
SRAM Space 0x1FFF 0x1FFE
0x2001 0x2000
DMA RAM
0x27FF 0x27FE
0x2801 0x2800
0x8001 0x8000
X Data
Optionally Unimplemented (X)
Mapped
into Program
Memory
0xFFFF 0xFFFE
TABLE 4-2: CHANGE NOTIFICATION REGISTER MAP FOR PIC24HJ128GP202/502, PIC24HJ64GP202/502 AND PIC24HJ32GP302
SFR SFR All
Name 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
Addr Resets
CNEN1 0060 CN15IE CN14IE CN13IE CN12IE CN11IE —- — — CN7IE CN6IE CN5IE CN4IE CN3IE CN2IE CN1IE CN0IE 0000
TABLE 4-3: CHANGE NOTIFICATION REGISTER MAP FOR PIC24HJ128GP204/504, PIC24HJ64GP204/504 AND PIC24HJ32GP304
SFR SFR All
Name 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
Addr Resets
CNEN1 0060 CN15IE CN14IE CN13IE CN12IE CN11IE CN10IE CN9IE CN8IE CN7IE CN6IE CN5IE CN4IE CN3IE CN2IE CN1IE CN0IE 0000
CNEN2 0062 — CN30IE CN29IE CN28IE CN27IE CN26IE CN25IE CN24IE CN23IE CN22IE CN21IE CN20IE CN19IE CN18IE CN17IE CN16IE 0000
CNPU1 0068 CN15PUE CN14PUE CN13PUE CN12PUE CN11PUE CN10PUE CN9PUE CN8PUE CN7PUE CN6PUE CN5PUE CN4PUE CN3PUE CN2PUE CN1PUE CN0PUE 0000
CNPU2 006A — CN30PUE CN29PUE CN28PUE CN27PUE CN26PUE CN25PUE CN24PUE CN23PUE CN22PUE CN21PUE CN20PUE CN19PUE CN18PUE CN17PUE CN16PUE 0000
Legend: x = unknown value on Reset, — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
DS70293G-page 31
DS70293G-page 32
INTCON1 0080 NSTDIS — — — — — — — — DIV0ERR DMACERR MATHERR ADDRERR STKERR OSCFAIL — 0000
INTCON2 0082 ALTIVT DISI — — — — — — — — — — — INT2EP INT1EP INT0EP 0000
IFS0 0084 — DMA1IF AD1IF U1TXIF U1RXIF SPI1IF SPI1EIF T3IF T2IF OC2IF IC2IF DMA0IF T1IF OC1IF IC1IF INT0IF 0000
IFS1 0086 U2TXIF U2RXIF INT2IF T5IF T4IF OC4IF OC3IF DMA2IF IC8IF IC7IF — INT1IF CNIF CMIF MI2C1IF SI2C1IF 0000
IFS2 0088 — DMA4IF PMPIF — — — — — — — — DMA3IF C1IF(1) C1RXIF(1) SPI2IF SPI2EIF 0000
IFS3 008A — RTCIF DMA5IF — — — — — — — — — — — — — 0000
IFS4 008C — — — — — — — — — C1TXIF(1) DMA7IF DMA6IF CRCIF U2EIF U1EIF — 0000
IEC0 0094 — DMA1IE AD1IE U1TXIE U1RXIE SPI1IE SPI1EIE T3IE T2IE OC2IE IC2IE DMA0IE T1IE OC1IE IC1IE INT0IE 0000
IEC1 0096 U2TXIE U2RXIE INT2IE T5IE T4IE OC4IE OC3IE DMA2IE IC8IE IC7IE — INT1IE CNIE CMIE MI2C1IE SI2C1IE 0000
IEC2 0098 — DMA4IE PMPIE — — — — — — — — DMA3IE C1IE(1) C1RXIE(1) SPI2IE SPI2EIE 0000
IEC3 009A — RTCIE DMA5IE — — — — — — — — — — — — — 0000
IEC4 009C — — — — — — — — — C1TXIE(1) DMA7IE DMA6IE CRCIE U2EIE U1EIE — 0000
IPC0 00A4 — T1IP<2:0> — OC1IP<2:0> — IC1IP<2:0> — INT0IP<2:0> 4444
IPC1 00A6 — T2IP<2:0> — OC2IP<2:0> — IC2IP<2:0> — DMA0IP<2:0> 4444
IPC2 00A8 — U1RXIP<2:0> — SPI1IP<2:0> — SPI1EIP<2:0> — T3IP<2:0> 4444
IPC3 00AA — — — — — DMA1IP<2:0> — AD1IP<2:0> — U1TXIP<2:0> 0444
IPC4 00AC — CNIP<2:0> — CMIP<2:0> — MI2C1IP<2:0> — SI2C1IP<2:0> 4444
IPC5 00AE — IC8IP<2:0> — IC7IP<2:0> — — — — — INT1IP<2:0> 4404
IPC6 00B0 — T4IP<2:0> — OC4IP<2:0> — OC3IP<2:0> — DMA2IP<2:0> 4444
IPC7 00B2 — U2TXIP<2:0> — U2RXIP<2:0> — INT2IP<2:0> — T5IP<2:0> 4444
IPC8 00B4 — C1IP<2:0>(1) — C1RXIP<2:0>(1) — SPI2IP<2:0> — SPI2EIP<2:0> 4444
IPC9 00B6 — — — — — — — — — — — — — DMA3IP<2:0> 0004
IPC11 00BA — — — — — DMA4IP<2:0> — PMPIP<2:0> — — — — 0440
IPC15 00C2 — — — — — RTCIP<2:0> — DMA5IP<2:0> — — — — 0440
© 2007-2012 Microchip Technology Inc.
Legend: x = unknown value on Reset, — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
DS70293G-page 34
Legend: x = unknown value on Reset, — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
U1MODE 0220 UARTEN — USIDL IREN RTSMD — UEN1 UEN0 WAKE LPBACK ABAUD URXINV BRGH PDSEL<1:0> STSEL 0000
U1STA 0222 UTXISEL1 UTXINV UTXISEL0 — UTXBRK UTXEN UTXBF TRMT URXISEL<1:0> ADDEN RIDLE PERR FERR OERR URXDA 0110
U1TXREG 0224 — — — — — — — UTX8 UART Transmit Register xxxx
U1RXREG 0226 — — — — — — — URX8 UART Received Register 0000
U1BRG 0228 Baud Rate Generator Prescaler 0000
Legend: x = unknown value on Reset, — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
© 2007-2012 Microchip Technology Inc.
U2MODE 0230 UARTEN — USIDL IREN RTSMD — UEN1 UEN0 WAKE LPBACK ABAUD URXINV BRGH PDSEL<1:0> STSEL 0000
TABLE 4-14: ADC1 REGISTER MAP FOR PIC24HJ64GP204/504, PIC24HJ128GP204/504 AND PIC24HJ32GP304
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
DMA0CON 0380 CHEN SIZE DIR HALF NULLW — — — — — AMODE<1:0> — — MODE<1:0> 0000
DMA5CON 03BC CHEN SIZE DIR HALF NULLW — — — — — AMODE<1:0> — — MODE<1:0> 0000
DMA5REQ 03BE FORCE — — — — — — — — IRQSEL<6:0> 0000
DMA5STA 03C0 STA<15:0> 0000
DMA5STB 03C2 STB<15:0> 0000
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
TABLE 4-15: DMA REGISTER MAP (CONTINUED)
DS70293G-page 38
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
TABLE 4-17: ECAN1 REGISTER MAP WHEN C1CTRL1.WIN = 0 (FOR PIC24HJ128GP502/504 AND PIC24HJ64GP502/504)
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
xxxx
C1RXF6EID 045A EID<15:8> EID<7:0> xxxx
C1RXF7SID 045C SID<10:3> SID<2:0> — EXIDE — EID<17:16> xxxx
C1RXF7EID 045E EID<15:8> EID<7:0> xxxx
C1RXF8SID 0460 SID<10:3> SID<2:0> — EXIDE — EID<17:16> xxxx
C1RXF8EID 0462 EID<15:8> EID<7:0> xxxx
C1RXF9SID 0464 SID<10:3> SID<2:0> — EXIDE — EID<17:16> xxxx
C1RXF9EID 0466 EID<15:8> EID<7:0> xxxx
C1RXF10SID 0468 SID<10:3> SID<2:0> — EXIDE — EID<17:16> xxxx
C1RXF10EID 046A EID<15:8> EID<7:0> xxxx
Legend: x = unknown value on Reset, — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
TABLE 4-18: ECAN1 REGISTER MAP WHEN C1CTRL1.WIN = 1 (FOR PIC24HJ128GP502/504 AND PIC24HJ64GP502/504) (CONTINUED)
© 2007-2012 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
Legend: x = unknown value on Reset, — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1: This register is present for PIC24HJ128GP502/504 and PIC24HJ64GP502/504 devices only.
DS70293G-page 42
TABLE 4-21: PERIPHERAL PIN SELECT OUTPUT REGISTER MAP FOR PIC24HJ128GP204/504, PIC24HJ64GP204/504 AND
PIC24HJ32GP304
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
RPOR0 06C0 — — — RP1R<4:0> — — — RP0R<4:0> 0000
RPOR1 06C2 — — — RP3R<4:0> — — — RP2R<4:0> 0000
RPOR2 06C4 — — — RP5R<4:0> — — — RP4R<4:0> 0000
RPOR3 06C6 — — — RP7R<4:0> — — — RP6R<4:0> 0000
RPOR4 06C8 — — — RP9R<4:0> — — — RP8R<4:0> 0000
RPOR5 06CA — — — RP11R<4:0> — — — RP10R<4:0> 0000
RPOR6 06CC — — — RP13R<4:0> — — — RP12R<4:0> 0000
RPOR7 06CE — — — RP15R<4:0> — — — RP14R<4:0> 0000
RPOR8 06D0 — — — RP17R<4:0> — — — RP16R<4:0> 0000
RPOR9 06D2 — — — RP19R<4:0> — — — RP18R<4:0> 0000
© 2007-2012 Microchip Technology Inc.
TABLE 4-22: PARALLEL MASTER/SLAVE PORT REGISTER MAP FOR PIC24HPIC24HJ128GP202/502, PIC24HJ64GP202/502 AND
PIC24HJ32GP302
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
TABLE 4-23: PARALLEL MASTER/SLAVE PORT REGISTER MAP FOR PIC24HJ128GP204/504, PIC24HJ64GP204/504 AND PIC24HJ32GP304
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 ADRMUX<1:0> PTBEEN PTWREN PTRDEN CSF1 CSF0 ALP — CS1P BEP WRSP RDSP 0000
PMMODE 0602 BUSY IRQM<1:0> INCM<1:0> MODE16 MODE<1:0> WAITB<1:0> WAITM<3:0> WAITE<1:0> 0000
PMADDR ADDR15 CS1 ADDR<13:0> 0000
0604
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
PMPDIN2 060A Parallel Port Data In Register 2 (Buffers 2 and 3) 0000
PMAEN 060C — PTEN14 — — — PTEN<10:0> 0000
PMSTAT 060E IBF IBOV — — IB3F IB2F IB1F IB0F OBE OBUF — — OB3E OB2E OB1E OB0E 008F
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
DS70293G-page 43
DS70293G-page 44
CMCON 0630 CMIDL — C2EVT C1EVT C2EN C1EN C2OUTEN C1OUTEN C2OUT C1OUT C2INV C1INV C2NEG C2POS C1NEG C1POS 0000
CVRCON 0632 — — — — — — — — CVREN CVROE CVRR CVRSS CVR<3:0> 0000
Legend: — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
TABLE 4-27: PORTA REGISTER MAP FOR PIC24HJ128GP202/502, PIC24HJ64GP202/502 AND PIC24HJ32GP302
© 2007-2012 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
TABLE 4-28: PORTA REGISTER MAP FOR PIC24HJ128GP204/504, PIC24HJ64GP204/504 AND PIC24HJ32GP304
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
TRISA 02C0 — — — — — TRISA10 TRISA9 TRISA8 TRISA7 — — TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 079F
TRISB 02C8 TRISB15 TRISB14 TRISB13 TRISB12 TRISB11 TRISB10 TRISB9 TRISB8 TRISB7 TRISB6 TRISB5 TRISB4 TRISB3 TRISB2 TRISB1 TRISB0 FFFF
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 — — — — ODCB11 ODCB10 ODCB9 ODCB8 ODCB7 ODCB6 ODCB5 — — — — — 0000
Legend: x = unknown value on Reset, — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
TABLE 4-30: PORTC REGISTER MAP FOR PIC24HJ128GP204/504, PIC24HJ64GP204/504 AND PIC24HJ32GP304
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
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 — — — — — — ODCC9 ODCC8 ODCC7 ODCC6 ODCC5 ODCC4 ODCC3 — — — 0000
Legend: x = unknown value on Reset, — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
RCON 0740 TRAPR IOPUWR — — — — CM VREGS EXTR SWR SWDTEN WDTO SLEEP IDLE BOR POR xxxx(1)
OSCCON 0742 — COSC<2:0> — NOSC<2:0> CLKLOCK IOLOCK LOCK — CF — LPOSCEN OSWEN 0300(2)
CLKDIV 0744 ROI DOZE<2:0> DOZEN FRCDIV<2:0> PLLPOST<1:0> — PLLPRE<4:0> 3040
DS70293G-page 45
PMD1 0770 T5MD T4MD T3MD T2MD T1MD — — — I2C1MD U2MD U1MD SPI2MD SPI1MD — C1MD AD1MD 0000
PMD2 0772 IC8MD IC7MD — — — — IC2MD IC1MD — — — — OC4MD OC3MD OC2MD OC1MD 0000
PMD3 0774 — — — — — CMPMD RTCCMD PMPMD CRCMD — — — — — — — 0000
Legend: x = unknown value on Reset, — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
© 2007-2012 Microchip Technology Inc.
PIC24HJ32GP302/304, PIC24HJ64GPX02/X04 AND PIC24HJ128GPX02/X04
0x0000
Operand 2 can be a W register, fetched from data
15 0
memory, or a 5-bit literal. The result location can be
either a W register or a data memory location. The fol-
lowing addressing modes are supported by MCU
Stack Grows Toward
instructions:
Higher Address
• Register Direct
PC<15:0> W15 (before CALL) • Register Indirect
000000000 PC<22:16>
• Register Indirect Post-Modified
<Free Word> W15 (after CALL)
• Register Indirect Pre-Modified
POP : [--W15] • 5-bit or 10-bit Literal
PUSH : [W15++]
Note: Not all instructions support all the
addressing modes given above.
Individual instructions can support
different subsets of these addressing
modes.
23 bits
EA 1/0
8 bits 16 bits
24 bits
Select
1 EA 0
Program Space Visibility(1)
0 PSVPAG
(Remapping)
8 bits 15 bits
23 bits
Note 1: The Least Significant bit (LSb) of program space addresses is always fixed as ‘0’ 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.
4.6.2 DATA ACCESS FROM PROGRAM - In Byte mode, either the upper or lower byte
MEMORY USING TABLE of the lower program word is mapped to the
INSTRUCTIONS lower byte of a data address. The upper byte
is selected when Byte Select is ‘1’; the lower
The TBLRDL and TBLWTL instructions offer a direct byte is selected when it is ‘0’.
method of reading or writing the lower word of any
• TBLRDH (Table Read High):
address within the program space without going
through data space. The TBLRDH and TBLWTH - In Word mode, this instruction maps the entire
instructions are the only method to read or write the upper word of a program address (P<23:16>)
upper 8 bits of a program space word as data. to a data address. The ‘phantom’ byte
(D<15:8>), is always ‘0’.
The PC is incremented by two for each successive
- In Byte mode, this instruction maps the upper
24-bit program word. This allows program memory
or lower byte of the program word to D<7:0>
addresses to directly map to data space addresses.
of the data address, in the TBLRDL instruc-
Program memory can thus be regarded as two 16-bit
tion. The data is always ‘0’ when the upper
wide word address spaces, residing side by side, each
‘phantom’ byte is selected (Byte Select = 1).
with the same address range. TBLRDL and TBLWTL
access the space that contains the least significant Similarly, two table instructions, TBLWTH and TBLWTL,
data word. TBLRDH and TBLWTH access the space that are used to write individual bytes or words to a pro-
contains the upper data byte. gram space address. The details of their operation are
explained in Section 5.0 “Flash Program Memory”.
Two table instructions are provided to move byte or
word-sized (16-bit) data to and from program space. For all table operations, the area of program memory
Both function as either byte or word operations. space to be accessed is determined by the Table Page
register (TBLPAG). TBLPAG covers the entire program
• TBLRDL (Table Read Low):
memory space of the device, including user application
- In Word mode, this instruction maps the and configuration spaces. When TBLPAG<7> = 0, the
lower word of the program space table page is located in the user memory space. When
location (P<15:0>) to a data address TBLPAG<7> = 1, the page is located in configuration
(D<15:0>). space.
Program Space
TBLPAG
02
23 15 0
0x000000 23 16 8 0
00000000
00000000
0x020000 00000000
0x030000 00000000
‘Phantom’ Byte
TBLRDH.B (Wn<0> = 0)
TBLRDL.B (Wn<0> = 1)
TBLRDL.B (Wn<0> = 0)
TBLRDL.W
4.6.3 READING DATA FROM PROGRAM 24-bit program word are used to contain the data. The
MEMORY USING PROGRAM SPACE upper 8 bits of any program space location used as
VISIBILITY data should be programmed with ‘1111 1111’ or
‘0000 0000’ to force a NOP. This prevents possible
The upper 32 Kbytes of data space may optionally be issues should the area of code ever be accidentally
mapped into any 16K word page of the program space. executed.
This option provides transparent access to stored
constant data from the data space without the need to Note: PSV access is temporarily disabled during
use special instructions, such as TBLRDL/TBLRDH. table reads/writes.
Program space access through the data space occurs For operations that use PSV and are executed outside
if the MSb of the data space EA is ‘1’ and program a REPEAT loop, the MOV and MOV.D instructions
space visibility is enabled by setting the PSV bit in the require one instruction cycle in addition to the specified
Core Control register (CORCON<2>). The location of execution time. All other instructions require two
the program memory space to be mapped into the data instruction cycles in addition to the specified execution
space is determined by the Program Space Visibility time.
Page register (PSVPAG). This 8-bit register defines
For operations that use PSV, and are executed inside
any one of 256 possible pages of 16K words in
a REPEAT loop, these instances require two instruction
program space. In effect, PSVPAG functions as the
cycles in addition to the specified execution time of the
upper 8 bits of the program memory address, with the
instruction:
15 bits of the EA functioning as the lower bits. By
incrementing the PC by 2 for each program memory • Execution in the first iteration
word, the lower 15 bits of data space addresses directly • Execution in the last iteration
map to the lower 15 bits in the corresponding program • Execution prior to exiting the loop due to an
space addresses. interrupt
Data reads to this area add a cycle to the instruction • Execution upon re-entering the loop after an
being executed, since two program memory fetches interrupt is serviced
are required. Any other iteration of the REPEAT loop allows the
Although each data space address 0x8000 and higher instruction using PSV to access data, to execute in a
maps directly into a corresponding program memory single cycle.
address (see Figure 4-8), only the lower 16 bits of the
PSV Area
...while the lower 15 bits
of the EA specify an
exact address within
0xFFFF the PSV area. This
corresponds exactly to
the same lower 15 bits
of the actual program
space address.
0x800000
ICSP allows the PIC24HJ32GP302/304, The TBLRDH and TBLWTH instructions are used to read
PIC24HJ64GPX02/X04 and PIC24HJ128GPX02/X04 or write to bits <23:16> of program memory. TBLRDH
devices to be serially programmed while in the end and TBLWTH can also access program memory in Word
application circuit. This is done with two lines for or Byte mode.
programming clock and programming data (one of the
alternate programming pin pairs: PGEC1/PGED1,
24 bits
Using
0 Program Counter 0
Program Counter
Working Reg EA
Using
1/0 TBLPAG Reg
Table Instruction
8 bits 16 bits
User/Configuration Byte
Space Select 24-bit EA Select
If ERASE = 0:
1111 = No operation
1110 = Reserved
1101 = No operation
1100 = No operation
1011 = Reserved
0011 = Memory word program operation
0010 = No operation
0001 = Memory row program operation
0000 = Program a single Configuration register byte
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
5.6.1 PROGRAMMING ALGORITHM FOR 4. Write the first 64 instructions from data RAM into
FLASH PROGRAM MEMORY the program memory buffers (see Example 5-2).
Programmers can program one row of program Flash 5. Write the program block to Flash memory:
memory at a time. To do this, it is necessary to erase a) Set the NVMOP bits to ‘0001’ to configure
the 8-row erase page that contains the desired row. for row programming. Clear the ERASE bit
The general process is: and set the WREN bit.
1. Read eight rows of program memory b) Write 0x55 to NVMKEY.
(512 instructions) and store in data RAM. c) Write 0xAA to NVMKEY.
2. Update the program data in RAM with the d) Set the WR bit. The programming cycle
desired new data. begins and the CPU stalls for the duration of
3. Erase the block (see Example 5-1): the write cycle. When the write to Flash mem-
ory is done, the WR bit is cleared
a) Set the NVMOP bits (NVMCON<3:0>) to
automatically.
‘0010’ to configure for block erase. Set the
ERASE (NVMCON<6>) and WREN 6. Repeat steps 4 and 5, using the next available
(NVMCON<14>) bits. 64 instructions from the block in data RAM by
incrementing the value in TBLPAG, until all
b) Write the starting address of the page to be
512 instructions are written back to Flash memory.
erased into the TBLPAG and W registers.
c) Write 0x55 to NVMKEY. For protection against accidental operations, the write
initiate sequence for NVMKEY must be used to allow
d) Write 0xAA to NVMKEY.
any erase or program operation to proceed. After the
e) Set the WR bit (NVMCON<15>). The erase programming command has been executed, the user
cycle begins and the CPU stalls for the dura- application must wait for the programming time until
tion of the erase cycle. When the erase is programming is complete. The two instructions
done, the WR bit is cleared automatically. following the start of the programming sequence
should be NOPs, as shown in Example 5-3.
Glitch Filter
MCLR
WDT
Module
Sleep or Idle
BOR
Internal
Regulator SYSRST
VDD
Illegal Opcode
Uninitialized W Register
Configuration Mismatch
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: All of the Reset status bits can 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 can 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.
6.3 System Reset A warm Reset is the result of all other reset sources,
including the RESET instruction. On warm Reset, the
The PIC24HJ32GP302/304, PIC24HJ64GPX02/X04 device will continue to operate from the current clock
and PIC24HJ128GPX02/X04 family of devices have source as indicated by the Current Oscillator Selection
two types of Reset: bits (COSC<2:0>) in the Oscillator Control register
• Cold Reset (OSCCON<14:12>).
• Warm Reset The device is kept in a Reset state until the system
A cold Reset is the result of a Power-on Reset (POR) power supplies have stabilized at appropriate levels
or a Brown-out Reset (BOR). On a cold Reset, the and the oscillator clock is ready. A description of the
FNOSC configuration bits in the FOSC device sequence in which this occurs and is shown in
configuration register selects the device clock source. Figure 6-2.
Vbor
VBOR
VPOR
VDD
TPOR
1
POR TBOR
2
BOR 3
TPWRT
SYSRST
4
Oscillator Clock
TOSCD TOST TLOCK
6
TFSCM
FSCM
5
Time
Note 1: POR: A POR circuit holds the device in Reset when the power supply is turned on. The POR circuit is active
until VDD crosses the VPOR threshold and the delay TPOR has elapsed.
2: BOR: The on-chip voltage regulator has a BOR circuit that keeps the device in Reset until VDD crosses the
VBOR threshold and the delay TBOR has elapsed. The delay TBOR ensures the voltage regulator output
becomes stable.
3: PWRT Timer: The programmable power-up timer continues to hold the processor in Reset for a specific
period of time (TPWRT) after a BOR. The delay TPWRT ensures that the system power supplies have stabilized
at the appropriate level for full-speed operation. After the delay TPWRT has elapsed, the SYSRST becomes
inactive, which in turn enables the selected oscillator to start generating clock cycles.
4: Oscillator Delay: The total delay for the clock to be ready for various clock source selections are given in
Table 6-1. Refer to Section 9.0 “Oscillator Configuration” for more information.
5: When the oscillator clock is ready, the processor begins execution from location 0x000000. The user
application programs a GOTO instruction at the reset address, which redirects program execution to the
appropriate start-up routine.
6: The Fail-Safe Clock Monitor (FSCM), if enabled, begins to monitor the system clock when the system clock
is ready and the delay TFSCM elapsed.
VBOR
TBOR + TPWRT
SYSRST
VDD
VBOR
TBOR + TPWRT
SYSRST
VDD
VBOR
TBOR + TPWRT
SYSRST
6.5 External Reset (EXTR) The Software Reset (Instruction) Flag bit (SWR) in the
Reset Control register (RCON<6>) is set to indicate
The external Reset is generated by driving the MCLR the software Reset.
pin low. The MCLR pin is a Schmitt trigger input with an
additional glitch filter. Reset pulses that are longer than
6.7 Watchdog Time-out Reset (WDTO)
the minimum pulse width will generate a Reset. Refer
to Section 28.0 “Electrical Characteristics” for Whenever a Watchdog time-out occurs, the device will
minimum pulse width specifications. The External asynchronously assert SYSRST. The clock source will
Reset (MCLR) Pin (EXTR) bit in the Reset Control remain unchanged. A WDT time-out during Sleep or
(RCON) register is set to indicate the MCLR Reset. Idle mode will wake-up the processor, but will not reset
the processor.
6.5.1 EXTERNAL SUPERVISORY CIRCUIT
The Watchdog Timer Time-out Flag bit (WDTO) in the
Many systems have external supervisory circuits that Reset Control register (RCON<4>) is set to indicate
generate reset signals to reset multiple devices in the the Watchdog Reset. Refer to Section 25.4
system. This external Reset signal can be directly con- “Watchdog Timer (WDT)” for more information on
nected to the MCLR pin to reset the device when the Watchdog Reset.
rest of system is Reset.
6.8 Trap Conflict Reset
6.5.2 INTERNAL SUPERVISORY CIRCUIT
If a lower-priority hard trap occurs while a higher-prior-
When using the internal power supervisory circuit to ity trap is being processed, a hard trap conflict Reset
reset the device, the external reset pin (MCLR) should occurs. The hard traps include exceptions of priority
be tied directly or resistively to VDD. In this case, the level 13 through level 15, inclusive. The address error
MCLR pin will not be used to generate a Reset. The (level 13) and oscillator error (level 14) traps fall into
external reset pin (MCLR) does not have an internal this category.
pull-up and must not be left unconnected.
The Trap Reset Flag bit (TRAPR) in the Reset Control
register (RCON<15>) is set to indicate the Trap Conflict
6.6 Software RESET Instruction (SWR)
Reset. Refer to Section 7.0 “Interrupt Controller” for
Whenever the RESET instruction is executed, the more information on trap conflict Resets.
device will assert SYSRST, placing the device in a
special Reset state. This Reset state will not re-
initialize the clock. The clock source in effect prior to the
RESET instruction will remain. SYSRST is released at
the next instruction cycle, and the reset vector fetch will
commence.
6.9 Configuration Mismatch Reset each program memory section to store the data values.
The upper 8 bits should be programmed with 3Fh,
To maintain the integrity of the peripheral pin select which is an illegal opcode value.
control registers, they are constantly monitored with
shadow registers in hardware. If an unexpected 6.10.2 UNINITIALIZED W REGISTER
change in any of the registers occur (such as cell dis- RESET
turbances caused by ESD or other external events), a
configuration mismatch Reset occurs. Any attempts to use the uninitialized W register as an
address pointer will Reset the device. The W register
The Configuration Mismatch Flag bit (CM) in the Reset
array (with the exception of W15) is cleared during all
Control register (RCON<9>) is set to indicate the
resets and is considered uninitialized until written to.
configuration mismatch Reset. Refer to Section 11.0
“I/O Ports” for more information on the configuration 6.10.3 SECURITY RESET
mismatch Reset.
If a Program Flow Change (PFC) or Vector Flow
Note: The configuration mismatch feature and Change (VFC) targets a restricted location in a
associated reset flag is not available on all protected segment (Boot and Secure Segment), that
devices. operation will cause a security Reset.
The PFC occurs when the Program Counter is
6.10 Illegal Condition Device Reset reloaded as a result of a Call, Jump, Computed Jump,
An illegal condition device Reset occurs due to the Return, Return from Subroutine, or other form of
following sources: branch instruction.
• Illegal Opcode Reset The VFC occurs when the Program Counter is
reloaded with an Interrupt or Trap vector.
• Uninitialized W Register Reset
• Security Reset Refer to Section 25.8 “Code Protection and
CodeGuard™ Security” for more information on
The Illegal Opcode or Uninitialized W Access Reset Security Reset.
Flag bit (IOPUWR) in the Reset Control register
(RCON<14>) is set to indicate the illegal condition
device Reset.
6.11 Using the RCON Status Bits
The user application can read the Reset Control regis-
6.10.1 ILLEGAL OPCODE RESET ter (RCON) after any device Reset to determine the
A device Reset is generated if the device attempts to cause of the reset.
execute an illegal opcode value that is fetched from Note: The status bits in the RCON register
program memory. should be cleared after they are read so
The illegal opcode Reset function can prevent the that the next RCON register value after a
device from executing program memory sections that device Reset will be meaningful.
are used to store constant data. To take advantage of
Table 6-3 provides a summary of the reset flag bit
the illegal opcode Reset, use only the lower 16 bits of
operation.
NOTES:
7.0 INTERRUPT CONTROLLER Interrupt vectors are prioritized in terms of their natural
priority. This priority is linked to their position in the
Note 1: This data sheet summarizes the features vector table. Lower addresses generally have a higher
of the PIC24HJ32GP302/304, natural priority. For example, the interrupt associated
PIC24HJ64GPX02/X04 and with vector 0 takes priority over interrupts at any other
PIC24HJ128GPX02/X04 families of vector address.
devices. It is not intended to be a compre- PIC24HJ32GP302/304, PIC24HJ64GPX02/X04 and
hensive reference source. To comple- PIC24HJ128GPX02/X04 devices implement up to 45
ment the information in this data sheet, unique interrupts and five nonmaskable traps. These
refer to Section 32. “Interrupts (Part III)” are summarized in Table 7-1.
(DS70214) of the”dsPIC33F/PIC24H
Family Reference Manual”, which is avail- 7.1.1 ALTERNATE INTERRUPT VECTOR
able from the Microchip web site TABLE
(www.microchip.com).
The Alternate Interrupt Vector Table (AIVT) is located
2: Some registers and associated bits after the IVT, as shown in Figure 7-1. Access to the
described in this section may not be AIVT is provided by the ALTIVT control bit
available on all devices. Refer to (INTCON2<15>). If the ALTIVT bit is set, all interrupt
Section 4.0 “Memory Organization” in and exception processes use the alternate vectors
this data sheet for device-specific register instead of the default vectors. The alternate vectors are
and bit information. organized in the same manner as the default vectors.
The PIC24HJ32GP302/304, PIC24HJ64GPX02/X04 The AIVT supports debugging by providing a means to
and PIC24HJ128GPX02/X04 interrupt controller switch between an application and a support
reduces the numerous peripheral interrupt request sig- environment without requiring the interrupt vectors to
nals to a single interrupt request signal to the be reprogrammed. This feature also enables switching
PIC24HJ32GP302/304, PIC24HJ64GPX02/X04 and between applications for evaluation of different
PIC24HJ128GPX02/X04 CPU. software algorithms at run time. If the AIVT is not
The interrupt controller has the following features: needed, the AIVT should be programmed with the
same addresses used in the IVT.
• Up to eight processor exceptions and software
traps
7.2 Reset Sequence
• Eight user-selectable priority levels
• Interrupt Vector Table (IVT) with up to 118 vectors A device Reset is not a true exception because the
interrupt controller is not involved in the Reset process.
• A unique vector for each interrupt or exception
The PIC24HJ32GP302/304, PIC24HJ64GPX02/X04
source
and PIC24HJ128GPX02/X04 device clears its
• Fixed priority within a specified user priority level registers in response to a Reset, which forces the PC
• Alternate Interrupt Vector Table (AIVT) for debug to zero. The microcontroller then begins program
support execution at location 0x000000. A GOTO instruction at
• Fixed interrupt entry and return latencies the Reset address can redirect program execution to
the appropriate start-up routine.
7.1 Interrupt Vector Table Note: Any unimplemented or unused vector
The Interrupt Vector Table (IVT), shown in Figure 7-1, locations in the IVT and AIVT should be
resides in program memory, starting at location programmed with the address of a default
000004h. The IVT contains 126 vectors consisting of interrupt handler routine that contains a
eight nonmaskable trap vectors plus up to 118 sources RESET instruction.
of interrupt. In general, each interrupt source has its
own vector. Each interrupt vector contains a 24 bit wide
address. The value programmed into each interrupt
vector location is the starting address of the associated
Interrupt Service Routine (ISR).
Note 1: See Table 7-1 for the list of implemented interrupt vectors.
Legend:
C = Clear only bit R = Readable bit U = Unimplemented bit, read as ‘0’
S = Set only bit W = Writable bit -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
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
8.0 DIRECT MEMORY ACCESS Direct Memory Access (DMA) is a very efficient
mechanism of copying data between peripheral SFRs
(DMA) (e.g., UART Receive register, Input Capture 1 buffer),
Note 1: This data sheet summarizes the features and buffers or variables stored in RAM, with minimal
of the PIC24HJ32GP302/304, CPU intervention. The DMA controller can
PIC24HJ64GPX02/X04 and automatically copy entire blocks of data without
PIC24HJ128GPX02/X04 families of requiring the user software to read or write the
devices. It is not intended to be a compre- peripheral Special Function Registers (SFRs) every
hensive reference source. To comple- time a peripheral interrupt occurs. The DMA controller
ment the information in this data sheet, uses a dedicated bus for data transfers and therefore,
refer to Section 38. “Direct Memory does not steal cycles from the code execution flow of
Access (DMA) (Part III)” (DS70215) of the CPU. To exploit the DMA capability, the
the “dsPIC33F/PIC24H Family Reference corresponding user buffers or variables must be
Manual”, which is available from the located in DMA RAM.
Microchip web site (www.microchip.com). The PIC24HJ32GP302/304, PIC24HJ64GPX02/X04
2: Some registers and associated bits and PIC24HJ128GPX02/X04 peripherals that can
described in this section may not be utilize DMA are listed in Table 8-1.
available on all devices. Refer to
Section 4.0 “Memory Organization” in
this data sheet for device-specific register
and bit information.
The DMA controller features eight identical data • Byte or word transfers
transfer channels. • Fixed priority channel arbitration
Each channel has its own set of control and status • Manual (software) or Automatic (peripheral DMA
registers. Each DMA channel can be configured to requests) transfer initiation
copy data either from buffers stored in dual port DMA • One-Shot or Auto-Repeat block transfer modes
RAM to peripheral SFRs, or from peripheral SFRs to • Ping-Pong mode (automatic switch between two
buffers in DMA RAM. DPSRAM start addresses after each block
The DMA controller supports the following features: transfer complete)
• DMA request for each channel can be selected
• Eight DMA channels
from any supported interrupt source
• Register Indirect with Post-increment Addressing
• Debug support features
mode
• Register Indirect without Post-increment For each DMA channel, a DMA interrupt request is
Addressing mode generated when a block transfer is complete.
Alternatively, an interrupt can be generated when half of
• Peripheral Indirect Addressing mode (peripheral
the block has been filled.
generates destination address)
• CPU interrupt after half or full block transfer
complete
FIGURE 8-1: TOP LEVEL SYSTEM ARCHITECTURE USING A DEDICATED TRANSACTION BUS
Peripheral Indirect Address
DMA Controller
DMA
Ready
Control
DMA
DMA
Note: CPU and DMA address buses are not shown for clarity.
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: The FORCE bit cannot be cleared by the user. The FORCE bit is cleared by hardware when the forced
DMA transfer is complete.
2: Refer to Table 7-1 for a complete listing of IRQ numbers for all interrupt sources.
REGISTER 8-3: DMAxSTA: DMA CHANNEL x RAM START ADDRESS REGISTER A(1)
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
STA<15:8>
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
bit 15-0 STA<15:0>: Primary DMA RAM Start Address bits (source or destination)
Note 1: A read of this address register returns the current contents of the DMA RAM Address register, not the con-
tents written to STA<15:0>. If the channel is enabled (i.e., active), writes to this register may result in
unpredictable behavior of the DMA channel and should be avoided.
REGISTER 8-4: DMAxSTB: DMA CHANNEL x RAM START ADDRESS REGISTER B(1)
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
STB<15:8>
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
bit 15-0 STB<15:0>: Secondary DMA RAM Start Address bits (source or destination)
Note 1: A read of this address register returns the current contents of the DMA RAM Address register, not the con-
tents written to STB<15:0>. If the channel is enabled (i.e., active), writes to this register may result in
unpredictable behavior of the DMA channel and should be avoided.
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 the channel is enabled (i.e., active), writes to this register may result in unpredictable behavior of the
DMA channel and should be avoided.
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 the channel is enabled (i.e., active), writes to this register may result in unpredictable behavior of the
DMA channel and should be avoided.
2: Number of DMA transfers = CNT<9:0> + 1.
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
bit 15-0 DSADR<15:0>: Most Recent DMA RAM Address Accessed by DMA Controller bits
NOTES:
DOZE
R(2) S3 XTPLL, HSPLL,
ECPLL, FRCPLL
S1 PLL(1) S1/S3
OSC2 FOSC(1)
POSCMD<1:0> FP(3)
÷ 2
FRC
FRCDIV
FRCDIVN
Oscillator S7 FOSC
FRCDIV<2:0> FRCDIV16
TUN<5:0> S6
÷ 16
FRC S0
LPRC LPRC
S5
Oscillator
Secondary Oscillator
SOSC
SOSCO S4
LPOSCEN
SOSCI Clock Fail Clock Switch Reset
S7 NOSC<2:0> FNOSC<2:0>
WDT, PWRT,
FSCM
Timer1
Note 1: See Figure 9-2 for PLL details.
2: If the Oscillator is used with XT or HS modes, an extended parallel resistor with the value of 1 MΩ must be connected.
3: The term FP refers to the clock source for all the peripherals, while FCY refers to the clock source for the CPU. Throughout this
document FCY and FP are used interchangeably, except in the case of Doze mode. FP and FCY will be different when Doze
mode is used in any ratio other than 1:1, which is the default.
9.1.3 PLL CONFIGURATION For a primary oscillator or FRC oscillator, output ‘FIN’,
the PLL output ‘FOSC’ is given by:
The primary oscillator and internal FRC oscillator can
optionally use an on-chip PLL to obtain higher speeds
of operation. The PLL provides significant flexibility in EQUATION 9-2: FOSC CALCULATION
selecting the device operating speed. A block diagram
M
of the PLL is shown in Figure 9-2. F OSC = F IN • ⎛ ---------------------⎞
⎝ N1 • N2⎠
The output of the primary oscillator or FRC, denoted as
‘FIN’, is divided down by a prescale factor (N1) of 2, 3,
... or 33 before being provided to the PLL’s Voltage For example, suppose a 10 MHz crystal is being used
Controlled Oscillator (VCO). The input to the VCO must with the selected oscillator mode of XT with PLL.
be selected in the range of 0.8 MHz to 8 MHz. The
• If PLLPRE<4:0> = 0, then N1 = 2. This yields a
prescale factor ‘N1’ is selected using the
VCO input of 10/2 = 5 MHz, which is within the
PLLPRE<4:0> bits (CLKDIV<4:0>).
acceptable range of 0.8-8 MHz.
The PLL Feedback Divisor, selected using the • If PLLDIV<8:0> = 0x1E, then M = 32. This yields a
PLLDIV<8:0> bits (PLLFBD<8:0>), provides a factor ‘M’, VCO output of 5 x 32 = 160 MHz, which is within
by which the input to the VCO is multiplied. This factor the 100-200 MHz ranged needed.
must be selected such that the resulting VCO output
• If PLLPOST<1:0> = 0, then N2 = 2. This provides
frequency is in the range of 100 MHz to 200 MHz.
a Fosc of 160/2 = 80 MHz. The resultant device
The VCO output is further divided by a postscale factor operating speed is 80/2 = 40 MIPS.
‘N2’. This factor is selected using the PLLPOST<1:0>
bits (CLKDIV<7:6>). ‘N2’ can be either 2, 4 or 8, and EQUATION 9-3: XT WITH PLL MODE
must be selected such that the PLL output frequency EXAMPLE
(FOSC) is in the range of 12.5 MHz to 80 MHz, which
generates device operating speeds of 6.25-40 MIPS.
10000000 • 32-⎞
F OSC = 1--- ⎛ -----------------------------------
F CY = -------------
2 2⎝ 2• 2 ⎠ = 40MIPS
PLLDIV
N1 N2
Divide by Divide by
2-33 M 2, 4, 8
Divide by
2-513
Legend: y = Value set from Configuration bits on POR C = Clear only 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
Note 1: Writes to this register require an unlock sequence. Refer to Section 39. “Oscillator (Part III)” (DS70308)
in the “dsPIC33F/PIC24H Family Reference Manual” (available from the Microchip web site) for details.
2: Direct clock switches between any primary oscillator mode with PLL and FRCPLL mode are not permitted.
This applies to clock switches in either direction. In these instances, the application must switch to FRC
mode as a transition clock source between the two PLL modes.
3: This register is reset only on a Power-on Reset (POR).
Note 1: Writes to this register require an unlock sequence. Refer to Section 39. “Oscillator (Part III)” (DS70308)
in the “dsPIC33F/PIC24H Family Reference Manual” (available from the Microchip web site) for details.
2: Direct clock switches between any primary oscillator mode with PLL and FRCPLL mode are not permitted.
This applies to clock switches in either direction. In these instances, the application must switch to FRC
mode as a transition clock source between the two PLL modes.
3: This register is reset only on a Power-on Reset (POR).
Note 1: This bit is cleared when the ROI bit is set and an interrupt occurs.
2: This register is reset only on a Power-on Reset (POR).
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: OSCTUN functionality has been provided to help customers compensate for temperature effects on the
FRC frequency over a wide range of temperatures. The tuning step size is an approximation and is neither
characterized nor tested.
2: This register is reset only on a Power-on Reset (POR).
10.2.2 IDLE MODE Doze mode is enabled by setting the DOZEN bit
(CLKDIV<11>). The ratio between peripheral and core
The following occur in Idle mode:
clock speed is determined by the DOZE<2:0> bits
• The CPU stops executing instructions. (CLKDIV<14:12>). There are eight possible
• The WDT is automatically cleared. configurations, from 1:1 to 1:128, with 1:1 being the
• The system clock source remains active. By default setting.
default, all peripheral modules continue to operate Programs can use Doze mode to selectively reduce
normally from the system clock source, but can power consumption in event-driven applications. This
also be selectively disabled (see Section 10.4 allows clock-sensitive functions, such as synchronous
“Peripheral Module Disable”). communications, to continue without interruption while
• If the WDT or FSCM is enabled, the LPRC also the CPU idles, waiting for something to invoke an
remains active. interrupt routine. An automatic return to full-speed CPU
The device wakes from Idle mode on any of these operation on interrupts can be enabled by setting the
events: ROI bit (CLKDIV<15>). By default, interrupt events
have no effect on Doze mode operation.
• Any interrupt that is individually enabled
For example, suppose the device is operating at
• Any device Reset
20 MIPS and the ECAN module has been configured
• A WDT time-out for 500 kbps based on this device operating speed. If
On wake-up from Idle mode, the clock is reapplied to the device is placed in Doze mode with a clock
the CPU and instruction execution will begin (2 to 4 frequency ratio of 1:4, the ECAN module continues to
cycles later), starting with the instruction following the communicate at the required bit rate of 500 kbps, but
PWRSAV instruction, or the first instruction in the ISR. the CPU now starts executing instructions at a
frequency of 5 MIPS.
10.2.3 INTERRUPTS COINCIDENT WITH
POWER SAVE INSTRUCTIONS 10.4 Peripheral Module Disable
Any interrupt that coincides with the execution of a The Peripheral Module Disable (PMD) registers
PWRSAV instruction is held off until entry into Sleep or provide a method to disable a peripheral module by
Idle mode has completed. The device then wakes up stopping all clock sources supplied to that module.
from Sleep or Idle mode. When a peripheral is disabled using the appropriate
PMD control bit, the peripheral is in a minimum power
10.3 Doze Mode consumption state. The control and status registers
associated with the peripheral are also disabled, so
The preferred strategies for reducing power
writes to those registers do not have effect and read
consumption are changing clock speed and invoking
values are invalid.
one of the power-saving modes. In some
circumstances, this cannot be practical. For example, it A peripheral module is enabled only if both the
may be necessary for an application to maintain associated bit in the PMD register is cleared and the
uninterrupted synchronous communication, even while peripheral is supported by the specific PIC MCU
it is doing nothing else. Reducing system clock speed variant. If the peripheral is present in the device, it is
can introduce communication errors, while using a enabled in the PMD register by default.
power-saving mode can stop communications
Note: If a PMD bit is set, the corresponding
completely.
module is disabled after a delay of one
Doze mode is a simple and effective alternative method instruction cycle. Similarly, if a PMD bit is
to reduce power consumption while the device is still cleared, the corresponding module is
executing code. In this mode, the system clock enabled after a delay of one instruction
continues to operate from the same source and at the cycle (assuming the module control regis-
same speed. Peripheral modules continue to be ters are already configured to enable
clocked at the same speed, while the CPU clock speed module operation).
is reduced. Synchronization between the two clock
domains is maintained, allowing the peripherals to
access the SFRs while the CPU executes code at a
slower rate.
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
11.0 I/O PORTS has ownership of the output data and control signals of
the I/O pin. The logic also prevents “loop through”, in
Note 1: This data sheet summarizes the features which a port’s digital output can drive the input of a
of the PIC24HJ32GP302/304, peripheral that shares the same pin. Figure 11-1 shows
PIC24HJ64GPX02/X04 and how ports are shared with other peripherals and the
PIC24HJ128GPX02/X04 families of associated I/O pin to which they are connected.
devices. It is not intended to be a compre-
When a peripheral is enabled and the peripheral is
hensive reference source. To comple-
actively driving an associated pin, the use of the pin as
ment the information in this data sheet,
a general purpose output pin is disabled. The I/O pin
refer to Section 10. “I/O Ports”
can be read, but the output driver for the parallel port bit
(DS70193) of the “dsPIC33F/PIC24H
is disabled. If a peripheral is enabled, but the peripheral
Family Reference Manual”, which is
is not actively driving a pin, that pin can be driven by a
available from the Microchip web site
port.
(www.microchip.com).
All port pins have three registers directly associated
2: Some registers and associated bits
with their operation as digital I/O. The data direction
described in this section may not be
register (TRISx) determines whether the pin is an input
available on all devices. Refer to
or an output. If the data direction bit is a ‘1’, then the pin
Section 4.0 “Memory Organization” in
is an input. All port pins are defined as inputs after a
this data sheet for device-specific register
Reset. Reads from the latch (LATx) read the latch.
and bit information.
Writes to the latch write the latch. Reads from the port
All of the device pins (except VDD, VSS, MCLR and (PORTx) read the port pins, while writes to the port pins
OSC1/CLKI) are shared among the peripherals and the write the latch.
parallel I/O ports. All I/O input ports feature Schmitt Any bit and its associated data and control registers
Trigger inputs for improved noise immunity. that are not valid for a particular device is disabled.
This means the corresponding LATx and TRISx
11.1 Parallel I/O (PIO) Ports registers and the port pin are read as zeros.
Generally a parallel I/O port that shares a pin with a When a pin is shared with another peripheral or
peripheral is subservient to the peripheral. The function that is defined as an input only, it is
peripheral’s output buffer data and control signals are nevertheless regarded as a dedicated port because
provided to a pair of multiplexers. The multiplexers there is no other competing source of outputs.
select whether the peripheral or the associated port
PIO Module 1
Output Data
Read TRIS 0
WR TRIS CK
TRIS Latch
D Q
WR LAT +
WR Port CK
Data Latch
Read LAT
Input Data
Read Port
25
RP 25
default
0
U1TX Output
3
U1RTS Output 4
RPn
Output Data
OC4 Output
21
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
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
FCY Prescaler 10
(/n)
Reset TGATE
TMR1
00
TCKPS<1:0>
0
SOSCO/
T1CK x1
Equal
Prescaler Sync 1 Comparator
(/n)
TGATE
TSYNC
TCKPS<1:0> TCS
SOSCI PR1
(1)
LPOSCEN
Note 1: Refer to Section 9.0 “Oscillator Configuration” for information on enabling the secondary oscillator.
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
NOTES:
13.0 TIMER2/3 AND TIMER4/5 • A Type B timer can be concatenated with a Type
C timer to form a 32-bit timer
FEATURE
• The external clock input (TxCK) is always
Note 1: This data sheet summarizes the features synchronized to the internal device clock and the
of the PIC24HJ32GP302/304, clock synchronization is performed after the
PIC24HJ64GPX02/X04 and prescaler
PIC24HJ128GPX02/X04 families of A block diagram of the Type B timer is shown in
devices. It is not intended to be a Figure 13-1.
comprehensive reference source. To
complement the information in this data Timer3 and Timer5 are Type C timers with the following
sheet, refer to Section 11. “Timers” specific features:
(DS70205) of the “dsPIC33F/PIC24H • A Type C timer can be concatenated with a Type
Family Reference Manual”, which is B timer to form a 32-bit timer
available from the Microchip web site
(www.microchip.com). • At least one Type C timer has the ability to trigger
an A/D conversion
2: Some registers and associated bits
• The external clock input (TxCK) is always
described in this section may not be
available on all devices. Refer to synchronized to the internal device clock and the
Section 4.0 “Memory Organization” in clock synchronization is performed before the
this data sheet for device-specific register prescaler
and bit information. A block diagram of the Type C timer is shown in
Figure 13-2.
Timer2 and Timer4 are Type B timers with the following
specific features:
FCY Prescaler 10 0
(/n)
Reset
00 TMRx
TCKPS<1:0> TGATE
Prescaler
Sync x1
(/n) Equal
TxCK Comparator
TCKPS<1:0> TGATE
TCS
PRx
Prescaler 10 0
FCY
(/n)
Reset
00 TMRx TGATE
TCKPS<1:0>
Prescaler
Sync x1
(/n) Equal ADC SOC Trigger
TxCK Comparator
TCKPS<1:0> TGATE
TCS
PRx
The Timer2/3 and Timer4/5 modules can operate in When configured for 32-bit operation, only the Type B
one of the following modes: Timer Control register (TxCON) bits are required for
• Timer mode setup and control. Type C timer control register bits are
ignored (except TSIDL bit).
• Gated Timer mode
• Synchronous Counter mode For interrupt control, the combined 32-bit timer uses
the interrupt enable, interrupt flag and interrupt priority
In Timer and Gated Timer modes, the input clock is control bits of the Type C timer. The interrupt control
derived from the internal instruction cycle clock (FCY). and status bits for the Type B timer are ignored during
In Synchronous Counter mode, the input clock is 32-bit timer operation.
derived from the external clock input at TxCK pin.
The Type B and Type C timers that can be combined to
The timer modes are determined by the following bits: form a 32-bit timer are listed in Table 13-2.
• TCS (TxCON<1>): Timer Clock Source Control bit
• TGATE (TxCON<6>): Timer Gate Control bit TABLE 13-2: 32-BIT TIMER
Timer control bit settings for different operating modes TYPE B Timer (lsw) TYPE C Timer (msw)
are given in the Table 13-1.
Timer2 Timer3
TABLE 13-1: TIMER MODE SETTINGS Timer4 Timer5
Mode TCS TGATE A block diagram representation of the 32-bit timer mod-
ule is shown in Figure 13-3. The 32-timer module can
Timer 0 0
operate in one of the following modes:
Gated timer 0 1 • Timer mode
Synchronous counter 1 x • Gated Timer mode
• Synchronous Counter mode
13.1 16-Bit Operation
To configure the features of Timer2/3 or Timer4/5 for
To configure any of the timers for individual 16-bit 32-bit operation:
operation: 1. Set the T32 control bit.
1. Clear the T32 bit corresponding to that timer. 2. Select the prescaler ratio for Timer2 or Timer4
2. Select the timer prescaler ratio using the using the TCKPS<1:0> bits.
TCKPS<1:0> bits. 3. Set the Clock and Gating modes using the
3. Set the Clock and Gating modes using the TCS corresponding TCS and TGATE bits.
and TGATE bits. 4. Load the timer period value. PR3 or PR5 con-
4. Load the timer period value into the PRx tains the most significant word of the value,
register. while PR2 or PR4 contains the least significant
5. If interrupts are required, set the interrupt enable word.
bit, TxIE. Use the priority bits, TxIP<2:0>, to set 5. If interrupts are required, set the interrupt enable
the interrupt priority. bits, T3IE or T5IE. Use the priority bits,
6. Set the TON bit. T3IP<2:0> or T5IP<2:0> to set the interrupt pri-
ority. While Timer2 or Timer4 controls the timer,
the interrupt appears as a Timer3 or Timer5
Note: Only Timer2 and Timer3 can trigger a
interrupt.
DMA data transfer.
6. Set the corresponding TON bit.
13.2 32-Bit Operation The timer value at any point is stored in the register
pair, TMR3:TMR2 or TMR5:TMR4, which always
A 32-bit timer module can be formed by combining a contains the most significant word of the count, while
Type B and a Type C 16-bit timer module. For 32-bit TMR2 or TMR4 contains the least significant word.
timer operation, the T32 control bit in the Type B Timer
Control register (TxCON<3>) must be set. The Type C
timer holds the most significant word (msw) and the
Type B timer holds the least significant word (lsw) for
32-bit operation.
Equal
Comparator TGATE
Prescaler 10
FCY
(/n) lsw msw
Reset ADC SOC trigger
00 TMRx TMRy
TCKPS<1:0>
Prescaler
Sync x1
(/n)
TxCK
TMRyHLD
TCKPS<1:0> TGATE
TCS
Note 1: ADC trigger is available only on TMR3:TMR2 and TMR5:TMR2 32-bit timers.
2: Timer x is a Type B Timer (x = 2 and 4).
3: Timer y is a Type C Timer (y = 3 and 5).
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: When 32-bit timer operation is enabled (T32 = 1) in the Timer Control register (TxCON<3>), the TSIDL bit
must be cleared to operate the 32-bit timer in Idle mode.
2: When the 32-bit timer operation is enabled (T32 = 1) in the Timer Control register (TxCON<3>), these bits
have no effect.
NOTES:
Note: An ‘x’ in a signal, register or bit name denotes the number of the capture channel.
NOTES:
15.0 OUTPUT COMPARE The Output Compare module can select either Timer2
or Timer3 for its time base. The module compares the
Note 1: This data sheet summarizes the features value of the timer with the value of one or two compare
of the PIC24HJ32GP302/304, registers depending on the operating mode selected.
PIC24HJ64GPX02/X04 and The state of the output pin changes when the timer
PIC24HJ128GPX02/X04 families of value matches the compare register value. The Output
devices. It is not intended to be a Compare module generates either a single output
comprehensive reference source. To pulse or a sequence of output pulses, by changing the
complement the information in this data state of the output pin on the compare match events.
sheet, refer to Section 13. “Output The Output Compare module can also generate
Compare” (DS70209) of the “dsPIC33F/ interrupts on compare match events.
PIC24H Family Reference Manual”,
The Output Compare module has multiple operating
which is available from the Microchip web
modes:
site (www.microchip.com).
• Active-Low One-Shot mode
2: Some registers and associated bits
described in this section may not be • Active-High One-Shot mode
available on all devices. Refer to • Toggle mode
Section 4.0 “Memory Organization” in • Delayed One-Shot mode
this data sheet for device-specific register • Continuous Pulse mode
and bit information.
• PWM mode without fault protection
• PWM mode with fault protection
OCxRS
OCxR Output S Q
OCx
Logic R
3
Output
OCM<2:0> Output Enable
Mode Select Enable Logic
Comparator
OCFA
0 1 OCTSEL 0 1
16 16
15.1 Output Compare Modes Note 1: Only OC1 and OC2 can trigger a DMA
Configure the Output Compare modes by setting the data transfer.
appropriate Output Compare Mode bits (OCM<2:0>) in 2: See Section 13. “Output Compare”
the Output Compare Control register (OCxCON<2:0>). (DS70209) in the “dsPIC33F/PIC24H
Table 15-1 lists the different bit settings for the Output Family Reference Manual” for OCxR and
Compare modes. Figure 15-2 illustrates the output OCxRS register restrictions.
compare operation for various modes. The user
application must disable the associated timer when
writing to the output compare control registers to avoid
malfunctions.
OCxRS
TMRy
OCxR
Toggle Mode
(OCM = 011)
Delayed One-Shot
(OCM = 100)
PWM Mode
(OCM = 110 or 111)
Transfer Transfer
SPIxRXB SPIxTXB
SPIxBUF
16
Internal Data Bus
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 CKE bit is not used in the Framed SPI modes. Program this bit to ‘0’ for the Framed SPI modes
(FRMEN = 1).
2: Do not set both Primary and Secondary prescalers to a value of 1:1.
3: This bit must be cleared when FRMEN = 1.
Note 1: The CKE bit is not used in the Framed SPI modes. Program this bit to ‘0’ for the Framed SPI modes
(FRMEN = 1).
2: Do not set both Primary and Secondary prescalers to a value of 1:1.
3: This bit must be cleared when FRMEN = 1.
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
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
Shift Clock Read
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:
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
18.0 UNIVERSAL ASYNCHRONOUS The primary features of the UART module are:
RECEIVER TRANSMITTER • Full-Duplex, 8- or 9-bit Data Transmission through
(UART) the UxTX and UxRX pins
• Even, Odd or No Parity Options (for 8-bit data)
Note 1: This data sheet summarizes the features • One or two stop bits
of the PIC24HJ32GP302/304, • Hardware flow control option with UxCTS and
PIC24HJ64GPX02/X04 and UxRTS pins
PIC24HJ128GPX02/X04 families of
• Fully integrated Baud Rate Generator with 16-bit
devices. It is not intended to be a
prescaler
comprehensive reference source. To
complement the information in this data • Baud rates ranging from 10 Mbps to 38 bps at 40
sheet, refer to Section 17. “UART” MIPS
(DS70188) of the “dsPIC33F/PIC24H • 4-deep First-In First-Out (FIFO) Transmit Data
Family Reference Manual”, which is buffer
available from the Microchip web site • 4-deep FIFO Receive Data buffer
(www.microchip.com). • Parity, framing and buffer overrun error detection
2: Some registers and associated bits • Support for 9-bit mode with Address Detect
described in this section may not be (9th bit = 1)
available on all devices. Refer to • Transmit and Receive interrupts
Section 4.0 “Memory Organization” in
• A separate interrupt for all UART error conditions
this data sheet for device-specific register
and bit information. • Loopback mode for diagnostic support
• Support for sync and break characters
The Universal Asynchronous Receiver Transmitter • Support for automatic baud rate detection
(UART) module is one of the serial I/O modules avail-
• IrDA® encoder and decoder logic
able in the PIC24HJ32GP302/304, PIC24HJ64GPX02/
X04 and PIC24HJ128GPX02/X04 device family. The • 16x baud clock output for IrDA® support
UART is a full-duplex asynchronous system that can A simplified block diagram of the UART module is
communicate with peripheral devices, such as per- shown in Figure 18-1. The UART module consists of
sonal computers, LIN 2.0, RS-232 and RS-485 inter- these key hardware elements:
faces. The module also supports a hardware flow • Baud Rate Generator
control option with the UxCTS and UxRTS pins and
• Asynchronous Transmitter
also includes an IrDA® encoder and decoder.
• Asynchronous Receiver
IrDA®
Note 1: Both UART1 and UART2 can trigger a DMA data transfer.
2: If DMA transfers are required, the UART TX/RX FIFO buffer must be set to a size of 1 byte/word
(i.e., UTXISEL<1:0> = 00 and URXISEL<1:0> = 00).
Note 1: Refer to Section 17. “UART” (DS70232) in the “dsPIC33F/PIC24H Family Reference Manual” for
information on enabling the UART module for receive or transmit operation.
2: This feature is only available for the 16x BRG mode (BRGH = 0).
Note 1: Refer to Section 17. “UART” (DS70232) in the “dsPIC33F/PIC24H Family Reference Manual” for
information on enabling the UART module for receive or transmit operation.
2: This feature is only available for the 16x BRG mode (BRGH = 0).
Note 1: Refer to Section 17. “UART” (DS70232) in the “dsPIC33F/PIC24H Family Reference Manual” for
information on enabling the UART module for transmit operation.
Note 1: Refer to Section 17. “UART” (DS70232) in the “dsPIC33F/PIC24H Family Reference Manual” for
information on enabling the UART module for transmit operation.
RxF15 Filter
RxF14 Filter
RxF13 Filter
RxF12 Filter
RxF11 Filter
DMA Controller
RxF10 Filter
RxF9 Filter
RxF8 Filter
Control
CPU
Configuration
Bus
Logic
CAN Protocol
Engine
Interrupts
C1Tx C1Rx
Legend: C = Writable bit, but only ‘0’ can be written to clear the bit r = Bit is Reserved
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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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
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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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: C = Writeable bit, but only ‘0’ can be written to clear the 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
Note: The buffers, SID, EID, DLC, Data Field and Receive Status registers are located in DMA RAM.
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: Only written by module for receive buffers, unused for transmit buffers.
AN0
AN12
S/H0
CHANNEL
SCAN +
CH0SB<4:0>
CH0SA<4:0> -
CH0 CSCNA
AN1
VREFL
CH0NA CH0NB
AN0 (1)
VREF+(1) AVDD VREF- AVSS
AN3 S/H1
+
CH123SA CH123SB -
CH1(2)
AN6
AN9 VCFG<2:0>
VREFL
VREFH VREFL
CH123NA CH123NB
SAR ADC ADC1BUF0
AN1
AN4
S/H2
+
CH123SA CH123SB -
CH2(2) AN7
AN10
VREFL
CH123NA CH123NB
AN2
AN5
S/H3
+
CH123SA CH123SB
-
CH3(2)
AN8
AN11
VREFL
CH123NA CH123NB
Alternate
Input Selection
Note 1:VREF+, VREF- inputs can be multiplexed with other analog inputs.
2: Channels 1, 2 and 3 are not applicable for the 12-bit mode of operation.
AN0
AN12
S/H0
CHANNEL
SCAN +
CH0SB<4:0>
CH0SA<4:0> -
CH0 CSCNA
AN1
VREFL
CH0NA CH0NB
AN0 (1)
VREF+(1) AVDD VREF- AVSS
AN3 S/H1
+
CH123SA CH123SB -
CH1(2)
AN9 VCFG<2:0>
VREFL
VREFH VREFL
CH123NA CH123NB
SAR ADC ADC1BUF0
AN1
AN4
S/H2
+
CH123SA CH123SB -
CH2(2)
AN10
VREFL
CH123NA CH123NB
AN2
AN5
S/H3
+
CH123SA CH123SB
-
CH3(2)
AN11
VREFL
CH123NA CH123NB
Alternate
Input Selection
Note 1:VREF+, VREF- inputs can be multiplexed with other analog inputs.
2: Channels 1, 2 and 3 are not applicable for the 12-bit mode of operation.
AD1CON3<15>
ADC Internal
RC Clock(2) 1
TAD
AD1CON3<7:0> 0
ADC Conversion
TCY Clock Multiplier
TOSC(1) X2
1, 2, 3, 4, 5,..., 64
Note 1: Refer to Figure 9-2 for the derivation of Fosc when the PLL is enabled. If the PLL is not used, Fosc is equal to
the clock source frequency. Tosc = 1/Fosc
2: See the ADC electrical characteristics for the exact RC clock value.
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
ADREF+ ADREF-
000 AVDD AVSS
001 External VREF+ AVSS
010 AVDD External VREF-
011 External VREF+ External VREF-
1xx AVDD Avss
bit 12-11 Unimplemented: Read as ‘0’
bit 10 CSCNA: Scan Input Selections for CH0+ during Sample A bit
1 = Scan inputs
0 = Do not scan inputs
bit 9-8 CHPS<1:0>: Selects Channels Utilized bits
When AD12B = 1, CHPS<1:0> is: U-0, Unimplemented, Read as ‘0’
1x = Converts CH0, CH1, CH2 and CH3
01 = Converts CH0 and CH1
00 = Converts CH0
bit 7 BUFS: Buffer Fill Status bit (only valid when BUFM = 1)
1 = ADC is currently filling buffer 0x8-0xF, user should access data in 0x0-0x7
0 = ADC is currently filling buffer 0x0-0x7, user should access data in 0x8-0xF
bit 6 Unimplemented: Read as ‘0’
bit 5-2 SMPI<3:0>: Selects Increment Rate for DMA Addresses bits or number of sample/conversion
operations per interrupt
1111 = Increments the DMA address or generates interrupt after completion of every 16th
sample/conversion operation
1110 = Increments the DMA address or generates interrupt after completion of every 15th
sample/conversion operation
•
•
•
0001 = Increments the DMA address after completion of every 2nd sample/conversion operation
0000 = Increments the DMA address after completion of every sample/conversion operation
bit 1 BUFM: Buffer Fill Mode Select bit
1 = Starts buffer filling at address 0x0 on first interrupt and 0x8 on next interrupt
0 = Always starts filling buffer at address 0x0
bit 0 ALTS: Alternate Input Sample Mode Select bit
1 = Uses channel input selects for Sample A on first sample and Sample B on next sample
0 = Always uses channel input selects for Sample A
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 bit setting is Reserved in PIC24HJ128GPX02, PIC24HJ64GPX02 and PIC24HJ32GPX02 (28-pin)
devices.
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: These bit settings (AN6, AN7 and AN8) are reserved on PIC24HJ128GPX02, PIC24HJ64GPX02 and
PIC24HJ32GPX02 (28-pin) devices.
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: On devices without 13 analog inputs, all AD1CSSL bits can be selected by user application. However,
inputs selected for scan without a corresponding input on device converts VREF-.
2: CSSx = ANx, where x = 0 through 12.
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: On devices without 13 analog inputs, all PCFG bits are R/W by user. However, PCFG bits are ignored on
ports without a corresponding input on device.
2: PCFGx = ANx, where x = 0 through 12.
3: PCFGX bits have no effect if ADC module is disabled by setting ADXMD bit in the PMDX register. In this
case, all port pins multiplexed with ANX will be in Digital mode.
NOTES:
21.0 COMPARATOR MODULE The Comparator module provides a set of dual input
comparators. The inputs to the comparator can be
Note 1: This data sheet summarizes the features configured to use any one of the four pin inputs
of the PIC24HJ32GP302/304, (C1IN+, C1IN-, C2IN+ and C2IN-) as well as the
PIC24HJ64GPX02/X04 and Comparator Voltage Reference Input (CVREF).
PIC24HJ128GPX02/X04 families of
Note: This peripheral contains output func-
devices. It is not intended to be a
tions that may need to be configured by
comprehensive reference source. To
the peripheral pin select feature. For
complement the information in this data
more information, see Section 11.6
sheet, refer to Section 34. “Compara-
“Peripheral Pin Select”.
tor” (DS70212) of the “dsPIC33F/
PIC24H Family Reference Manual”,
which is available from the Microchip web
site (www.microchip.com).
2: Some registers and associated bits
described in this section may not be
available on all devices. Refer to
Section 4.0 “Memory Organization” in
this data sheet for device-specific register
and bit information.
C1NEG CMCON<6>
C1EN
C1INV
C1IN+
VIN-
C1IN-
C1OUT(1)
C1POS C1
C1IN+
VIN+ C1OUTEN
CVREF
C2NEG CMCON<7>
C2EN
C2INV
C2IN+
VIN-
C2IN-
C2OUT(1)
C2POS
C2
C2IN+
VIN+ C2OUTEN
CVREF
Note 1: This peripheral’s outputs must be assigned to an available RPn pin before use. Refer to Section 11.6 “Peripheral
Pin Select” 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 C2OUTEN = 1, the C2OUT peripheral output must be configured to an available RPx pin. See
Section 11.6 “Peripheral Pin Select” for more information.
2: If C1OUTEN = 1, the C1OUT peripheral output must be configured to an available RPx pin. See
Section 11.6 “Peripheral Pin Select” for more information.
Note 1: If C2OUTEN = 1, the C2OUT peripheral output must be configured to an available RPx pin. See
Section 11.6 “Peripheral Pin Select” for more information.
2: If C1OUTEN = 1, the C1OUT peripheral output must be configured to an available RPx pin. See
Section 11.6 “Peripheral Pin Select” for more information.
21.3 Comparator Voltage Reference The comparator reference supply voltage can come
from either VDD and VSS, or the external VREF+ and
21.3.1 CONFIGURING THE COMPARATOR VREF-. The voltage source is selected by the CVRSS
VOLTAGE REFERENCE bit (CVRCON<4>).
The Voltage Reference module is controlled through The settling time of the comparator voltage reference
the CVRCON register (Register 21-2). The comparator must be considered when changing the CVREF
voltage reference provides two ranges of output output.
voltage, each with 16 distinct levels. The range to be
used is selected by the CVRR bit (CVRCON<5>). The
primary difference between the ranges is the size of the
steps selected by the CVREF Selection bits
(CVR3:CVR0), with one range offering finer resolution.
CVRSS = 1
VREF+ CVRSRC CVRCON<3:0>
CVR3
CVR2
CVR1
CVR0
AVDD 8R
CVRSS = 0
CVREN R CVREFIN
R
16 Steps 16-to-1 MUX
CVREF
R CVROE (CVRCON<6>)
R
R
CVRR 8R
CVRSS = 1
VREF-
AVSS
CVRSS = 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
22.0 REAL-TIME CLOCK AND Some of the key features of this module are:
CALENDAR (RTCC) • Time: hours, minutes and seconds
• 24-hour format (military time)
Note 1: This data sheet summarizes the features
of the PIC24HJ32GP302/304, • Calendar: weekday, date, month and year
PIC24HJ64GPX02/X04 and • Alarm configurable
PIC24HJ128GPX02/X04 families of
• Year range: 2000 to 2099
devices. It is not intended to be a compre-
hensive reference source. To comple- • Leap year correction
ment the information in this data sheet, • BCD format for compact firmware
refer to Section 37. “Real-Time Clock
and Calendar (RTCC)” (DS70301) of the • Optimized for low-power operation
“dsPIC33F/PIC24H Family Reference • User calibration with auto-adjust
Manual”, which is available from the • Calibration range: ±2.64 seconds error per month
Microchip web site (www.microchip.com).
• Requirements: External 32.768 kHz clock crystal
2: Some registers and associated bits
described in this section may not be • Alarm pulse or seconds clock output on RTCC pin
available on all devices. Refer to The RTCC module is intended for applications where
Section 4.0 “Memory Organization” in accurate time must be maintained for extended periods
this data sheet for device-specific register of time with minimum to no intervention from the CPU.
and bit information. The RTCC module is optimized for low-power usage to
provide extended battery lifetime while keeping track of
This chapter discusses the Real-Time Clock and time.
Calendar (RTCC) module, available on
PIC24HJ32GP302/304, PIC24HJ64GPX02/X04 and The RTCC module is a 100-year clock and calendar
PIC24HJ128GPX02/X04 devices, and its operation. with automatic leap year detection. The range of the
clock is from 00:00:00 (midnight) on January 1, 2000 to
23:59:59 on December 31, 2099.
The hours are available in 24-hour (military time)
format. The clock provides a granularity of one second
with half-second visibility to the user.
Repeat Counter
RTCC Interrupt
RTCC Interrupt Logic
Alarm Pulse
RTCC Pin
RTCOE
22.1 RTCC Module Registers By writing the ALRMVALH byte, the Alarm Pointer
value, ALRMPTR<1:0> bits, decrement by one until
The RTCC module registers are organized into three they reach ‘00’. Once they reach ‘00’, the ALRMMIN
categories: and ALRMSEC value will be accessible through
• RTCC Control Registers ALRMVALH and ALRMVALL until the pointer value is
• RTCC Value Registers manually changed.
• Alarm Value Registers
TABLE 22-2: ALRMVAL REGISTER
22.1.1 REGISTER MAPPING MAPPING
To limit the register interface, the RTCC Timer and ALRMPTR Alarm Value Register Window
Alarm Time registers are accessed through <1:0>
corresponding register pointers. The RTCC Value ALRMVAL<15:8> ALRMVAL<7:0>
register window (RTCVALH and RTCVALL) uses the 00 ALRMMIN ALRMSEC
RTCPTR bits (RCFGCAL<9:8>) to select the desired
01 ALRMWD ALRMHR
timer register pair (see Table 22-1).
10 ALRMMNTH ALRMDAY
By writing the RTCVALH byte, the RTCC Pointer value,
RTCPTR<1:0> bits, decrement by one until they reach 11 — —
‘00’. Once they reach ‘00’, the MINUTES and Considering that the 16-bit core does not distinguish
SECONDS value will be accessible through RTCVALH between 8-bit and 16-bit read operations, the user must
and RTCVALL until the pointer value is manually be aware that when reading either the ALRMVALH or
changed. ALRMVALL bytes will decrement the ALRMPTR<1:0>
value. The same applies to the RTCVALH or RTCVALL
TABLE 22-1: RTCVAL REGISTER MAPPING bytes with the RTCPTR<1:0> being decremented.
RTCPTR RTCC Value Register Window Note: This only applies to read operations and
<1:0> not write operations.
RTCVAL<15:8> RTCVAL<7:0>
00 MINUTES SECONDS 22.1.2 WRITE LOCK
01 WEEKDAY HOURS In order to perform a write to any of the RTCC Timer
10 MONTH DAY registers, the RTCWREN bit (RCFGCAL<13>) must be
set (refer to Example 22-1).
11 — YEAR
Note: To avoid accidental writes to the timer, it is
The Alarm Value register window (ALRMVALH and recommended that the RTCWREN bit
ALRMVALL) uses the ALRMPTR bits (RCFGCAL<13>) is kept clear at any
(ALCFGRPT<9:8>) to select the desired Alarm register other time. For the RTCWREN bit to be
pair (see Table 22-2). set, there is only 1 instruction cycle time
window allowed between the 55h/AA
sequence and the setting of RTCWREN;
therefore, it is recommended that code
follow the procedure in Example 22-1.
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 bit (RCFGCAL<10>) 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
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
REGISTER 22-5: RTCVAL (WHEN RTCPTR<1:0> = 10): MONTH AND DAY VALUE REGISTER(1)
U-0 U-0 U-0 R-x R-x R-x R-x R-x
— — — MTHTEN0 MTHONE<3:0>
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
REGISTER 22-6: RTCVAL (WHEN RTCPTR<1:0> = 01): WKDYHR: WEEKDAY AND HOURS VALUE
REGISTER(1)
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
REGISTER 22-7: RTCVAL (WHEN RTCPTR<1:0> = 00): MINUTES AND SECONDS VALUE
REGISTER
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
REGISTER 22-8: ALRMVAL (WHEN ALRMPTR<1:0> = 10): ALARM MONTH AND DAY VALUE
REGISTER(1)
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
REGISTER 22-9: ALRMVAL (WHEN ALRMPTR<1:0> = 01): ALARM WEEKDAY AND HOURS
VALUE REGISTER(1)
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
REGISTER 22-10: ALRMVAL (WHEN ALRMPTR<1:0> = 00): ALARM MINUTES AND SECONDS
VALUE REGISTER
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
NOTES:
PLEN<3:0>
0 1 2 15
XOR
D Q D Q D Q D Q D Q
SDOx
BIT 0 BIT 4 BIT 5 BIT 12 BIT 15
23.2 User Interface To empty words already written into a FIFO, the
CRCGO bit must be set to ‘1’ and the CRC shifter
23.2.1 DATA INTERFACE allowed to run until the CRCMPT bit is set.
To start serial shifting, a ‘1’ must be written to the Also, to get the correct CRC reading, it is necessary to
CRCGO bit. wait for the CRCMPT bit to go high before reading the
CRCWDAT register.
The module incorporates a FIFO that is 8 deep when
PLEN (PLEN<3:0>) > 7, and 16 deep, otherwise. The If a word is written when the CRCFUL bit is set, the
data for which the CRC is to be calculated must first be VWORD Pointer will roll over to 0. The hardware will
written into the FIFO. The smallest data element that then behave like the FIFO is empty. However, the
can be written into the FIFO is one byte. For example, condition to generate an interrupt will not be met;
if PLEN = 5, then the size of the data is PLEN + 1 = 6. therefore, no interrupt will be generated (See
The data must be written as follows: Section 23.2.2 “Interrupt Operation”).
data[5:0] = crc_input[5:0] At least one instruction cycle must pass after a write to
CRCWDAT before a read of the VWORD bits is done.
data[7:6] = ‘bxx
Once data is written into the CRCWDAT MSb (as 23.2.2 INTERRUPT OPERATION
defined by PLEN), the value of VWORD
When the VWORD<4:0> bits make a transition from a
(VWORD<4:0>) increments by one. The serial shifter
value of ‘1’ to ‘0’, an interrupt will be generated.
starts shifting data into the CRC engine when
CRCGO = 1 and VWORD > 0. When the MSb is
shifted out, VWORD decrements by one. The serial 23.3 Operation in Power-Saving Modes
shifter continues shifting until the VWORD reaches 0.
Therefore, for a given value of PLEN, it will take 23.3.1 SLEEP MODE
(PLEN + 1) * VWORD number of clock cycles to If Sleep mode is entered while the module is operating,
complete the CRC calculations. the module will be suspended in its current state until
When VWORD reaches 8 (or 16), the CRCFUL bit will clock execution resumes.
be set. When VWORD reaches 0, the CRCMPT bit will
23.3.2 IDLE MODE
be set.
To continue full module operation in Idle mode, the
To continually feed data into the CRC engine, the
CSIDL bit must be cleared prior to entry into the mode.
recommended mode of operation is to initially “prime”
the FIFO with a sufficient number of words so no If CSIDL = 1, the module will behave the same way as
interrupt is generated before the next word can be it does in Sleep mode; pending interrupt events will be
written. Once that is done, start the CRC by setting the passed on, even though the module clocks are not
CRCGO bit to ‘1’. From that point onward, the available.
VWORD<4:0> bits should be polled. If they read less
than 8 or 16, another word can be written into the FIFO.
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
NOTES:
24.0 PARALLEL MASTER PORT devices and microcontrollers. Because the interface
to parallel peripherals varies significantly, the PMP is
(PMP)
highly configurable.
Note 1: This data sheet summarizes the features Key features of the PMP module include:
of the PIC24HJ32GP302/304,
• Fully Multiplexed Address/Data Mode
PIC24HJ64GPX02/X04 and
PIC24HJ128GPX02/X04 families of • Demultiplexed or Partially Multiplexed Address/
devices. It is not intended to be a compre- Data Mode:
hensive reference source. To comple- - Up to 11 address lines with single Chip Select
ment the information in this data sheet, - Up to 12 address lines without Chip Select
refer to Section 35. “Parallel Master • Single Chip Select Line
Port (PMP)” (DS70299) of the • Programmable Strobe Options:
“dsPIC33F/PIC24H Family Reference
- Individual Read and Write Strobes or;
Manual”, which is available from the
Microchip web site (www.microchip.com). - Read/Write Strobe with Enable Strobe
• Address Auto-Increment/Auto-Decrement
2: Some registers and associated bits
described in this section may not be • Programmable Address/Data Multiplexing
available on all devices. Refer to • Programmable Polarity on Control Signals
Section 4.0 “Memory Organization” in • Legacy Parallel Slave Port Support
this data sheet for device-specific register • Enhanced Parallel Slave Support:
and bit information.
- Address Support
The Parallel Master Port (PMP) module is a parallel - 4-Byte Deep Auto-Incrementing Buffer
8-bit I/O module, specifically designed to communi- • Programmable Wait States
cate with a wide variety of parallel devices, such as • Selectable Input Voltage Levels
communication peripherals, LCDs, external memory
PMA<10:2>(1)
PMA<14>
PMCS1
PMBE
PMRD
PMRD/PMWR
PMWR
PMENB
FIFO
Microcontroller LCD
Buffer
PMD<7:0>
PMA<7:0>
PMA<10: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
Note 1: These bits have no effect when their corresponding pins are used as address lines.
Note 1: These bits have no effect when their corresponding pins are used as address lines.
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 WAITM3:WAITM0 = 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 bit (RCFGCAL<10>) needs to be set.
3.3V
PIC24H
VDD
VCAP
CEFC
10 µF VSS
Tantalum
Sleep/Idle
WDTPRE WDTPOST<3:0>
SWDTEN WDT
FWDTEN Wake-up
RS RS 1
Prescaler Postscaler
LPRC Clock (divide by N1) (divide by N2) WDT
0 Reset
CLRWDT Instruction
CONFIG BITS BSS<2:0> = x11 0K BSS<2:0> = x10 1K BSS<2:0> = x01 4K BSS<2:0> = x00 8K
0x000000h 0x000000h 0x000000h 0x000000h
VS = 256 IW 0x0001FEh VS = 256 IW 0x0001FEh VS = 256 IW 0x0001FEh VS = 256 IW 0x0001FEh
0x000200h 0x000200h 0x000200h 0x000200h
BS = 768 IW BS = 3840 IW BS = 7936 IW
NOTES:
27.7 MPLAB SIM Software Simulator 27.9 MPLAB ICD 3 In-Circuit Debugger
The MPLAB SIM Software Simulator allows code
System
development in a PC-hosted environment by simulat- MPLAB ICD 3 In-Circuit Debugger System is Micro-
ing the PIC MCUs and dsPIC® DSCs on an instruction chip's most cost effective high-speed hardware
level. On any given instruction, the data areas can be debugger/programmer for Microchip Flash Digital Sig-
examined or modified and stimuli can be applied from nal Controller (DSC) and microcontroller (MCU)
a comprehensive stimulus controller. Registers can be devices. It debugs and programs PIC® Flash microcon-
logged to files for further run-time analysis. The trace trollers and dsPIC® DSCs with the powerful, yet easy-
buffer and logic analyzer display extend the power of to-use graphical user interface of MPLAB Integrated
the simulator to record and track program execution, Development Environment (IDE).
actions on I/O, most peripherals and internal registers.
The MPLAB ICD 3 In-Circuit Debugger probe is con-
The MPLAB SIM Software Simulator fully supports nected to the design engineer's PC using a high-speed
symbolic debugging using the MPLAB C Compilers, USB 2.0 interface and is connected to the target with a
and the MPASM and MPLAB Assemblers. The soft- connector compatible with the MPLAB ICD 2 or MPLAB
ware simulator offers the flexibility to develop and REAL ICE systems (RJ-11). MPLAB ICD 3 supports all
debug code outside of the hardware laboratory envi- MPLAB ICD 2 headers.
ronment, making it an excellent, economical software
development tool. 27.10 PICkit 3 In-Circuit Debugger/
Programmer and
27.8 MPLAB REAL ICE In-Circuit
PICkit 3 Debug Express
Emulator System
The MPLAB PICkit 3 allows debugging and
MPLAB REAL ICE In-Circuit Emulator System is programming of PIC® and dsPIC® Flash
Microchip’s next generation high-speed emulator for microcontrollers at a most affordable price point using
Microchip Flash DSC and MCU devices. It debugs and the powerful graphical user interface of the MPLAB
programs PIC® Flash MCUs and dsPIC® Flash DSCs Integrated Development Environment (IDE). The
with the easy-to-use, powerful graphical user interface of MPLAB PICkit 3 is connected to the design engineer's
the MPLAB Integrated Development Environment (IDE), PC using a full speed USB interface and can be
included with each kit. connected to the target via an Microchip debug (RJ-11)
The emulator is connected to the design engineer’s PC connector (compatible with MPLAB ICD 3 and MPLAB
using a high-speed USB 2.0 interface and is connected REAL ICE). The connector uses two device I/O pins
to the target with either a connector compatible with in- and the reset line to implement in-circuit debugging and
circuit debugger systems (RJ11) or with the new high- In-Circuit Serial Programming™.
speed, noise tolerant, Low-Voltage Differential Signal The PICkit 3 Debug Express include the PICkit 3, demo
(LVDS) interconnection (CAT5). board and microcontroller, hookup cables and CDROM
The emulator is field upgradable through future firmware with user’s guide, lessons, tutorial, compiler and
downloads in MPLAB IDE. In upcoming releases of MPLAB IDE software.
MPLAB IDE, new devices will be supported, and new
features will be added. MPLAB REAL ICE offers
significant advantages over competitive emulators
including low-cost, full-speed emulation, run-time
variable watches, trace analysis, complex breakpoints, a
ruggedized probe interface and long (up to three meters)
interconnection cables.
Note 1: Stresses above those listed under “Absolute Maximum Ratings” can 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 can affect device reliability.
2: Maximum allowable current is a function of device maximum power dissipation (see Table 28-2).
3: Exceptions are CLKOUT, which is able to sink/source 25 mA, and the VREF+, VREF-, SCLx, SDAx, PGECx
and PGEDx pins, which are able to sink/source 12 mA.
4: See the “Pin Diagrams” section for 5V tolerant pins.
28.1 DC Characteristics
Load Condition 1 – for all pins except OSC2 Load Condition 2 – for OSC2
VDD/2
RL Pin CL
VSS
CL
Pin RL = 464Ω
CL = 50 pF for all pins except OSC2
VSS 15 pF for OSC2 output
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
OS20
OS30 OS30 OS31 OS31
OS25
CLKO
OS41 OS40
For example: Fosc = 32 MHz, DCLK = 3%, SPI bit rate clock, (i.e., SCK) is 2 MHz.
D CLK 3% 3%
SPI SCK Jitter = ------------------------------ = ---------- = -------- = 0.75%
16 4
⎛ 32 MHz-⎞
-------------------
⎝ 2 MHz ⎠
I/O Pin
(Input)
DI35
DI40
FIGURE 28-4: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER AND POWER-UP
TIMER TIMING CHARACTERISTICS
VDD SY12
MCLR
Internal SY10
POR
SY11
PWRT
Time-out
SY30
OSC
Time-out
Internal
Reset
Watchdog
Timer
Reset
SY20
SY13
SY13
I/O Pins
SY35
FSCM
Delay Note: Refer to Figure 28-1 for load conditions.
TABLE 28-21: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER, POWER-UP TIMER
TIMING REQUIREMENTS
Standard Operating Conditions: 3.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(1) Min Typ(2) Max Units Conditions
No.
TxCK
Tx10 Tx11
Tx15 Tx20
OS60
TMRx
ICx
IC10 IC11
IC15
OCx
(Output Compare
or PWM Mode) OC11 OC10
OC20
OCFA
OC15
FIGURE 28-9: SPIx MASTER MODE (HALF-DUPLEX, TRANSMIT ONLY CKE = 0) TIMING
CHARACTERISTICS
SCKx
(CKP = 0)
SCKx
(CKP = 1)
FIGURE 28-10: SPIx MASTER MODE (HALF-DUPLEX, TRANSMIT ONLY CKE = 1) TIMING
CHARACTERISTICS
SP36
SCKx
(CKP = 0)
SCKx
(CKP = 1)
SP30, SP31
TABLE 28-29: SPIx MASTER MODE (HALF-DUPLEX, TRANSMIT ONLY) TIMING REQUIREMENTS
Standard Operating Conditions: 3.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(1) Min Typ(2) Max Units Conditions
No.
SP10 TscP Maximum SCK Frequency — — 15 MHz See Note 3
SP20 TscF SCKx Output Fall Time — — — ns See parameter DO32
and Note 4
SP21 TscR SCKx Output Rise Time — — — ns See parameter DO31
and Note 4
SP30 TdoF SDOx Data Output Fall Time — — — ns See parameter DO32
and Note 4
SP31 TdoR SDOx Data Output Rise Time — — — ns See parameter DO31
and Note 4
SP35 TscH2doV, SDOx Data Output Valid after — 6 20 ns —
TscL2doV SCKx Edge
SP36 TdiV2scH, SDOx Data Output Setup to 30 — — ns —
TdiV2scL First SCKx Edge
Note 1: These parameters are characterized, but are not tested in manufacturing.
2: Data in “Typ” column is at 3.3V, 25°C unless otherwise stated.
3: The minimum clock period for SCKx is 66.7 ns. Therefore, the clock generated in Master mode must not
violate this specification.
4: Assumes 50 pF load on all SPIx pins.
FIGURE 28-11: SPIx MASTER MODE (FULL-DUPLEX, CKE = 1, CKP = X, SMP = 1) TIMING
CHARACTERISTICS
SP36
SCKx
(CKP = 0)
SCKx
(CKP = 1)
SP41
TABLE 28-30: SPIx MASTER MODE (FULL-DUPLEX, CKE = 1, CKP = x, SMP = 1) TIMING
REQUIREMENTS
Standard Operating Conditions: 3.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(1) Min Typ(2) Max Units Conditions
No.
SP10 TscP Maximum SCK Frequency — — 9 MHz See Note 3
SP20 TscF SCKx Output Fall Time — — — ns See parameter DO32
and Note 4
SP21 TscR SCKx Output Rise Time — — — ns See parameter DO31
and Note 4
SP30 TdoF SDOx Data Output Fall Time — — — ns See parameter DO32
and Note 4
SP31 TdoR SDOx Data Output Rise Time — — — ns See parameter DO31
and Note 4
SP35 TscH2doV, SDOx Data Output Valid after — 6 20 ns —
TscL2doV SCKx Edge
SP36 TdoV2sc, SDOx Data Output Setup to 30 — — ns —
TdoV2scL First SCKx Edge
SP40 TdiV2scH, Setup Time of SDIx Data 30 — — ns —
TdiV2scL Input to SCKx Edge
SP41 TscH2diL, Hold Time of SDIx Data Input 30 — — ns —
TscL2diL to SCKx Edge
Note 1: These parameters are characterized, but are not tested in manufacturing.
2: Data in “Typ” column is at 3.3V, 25°C unless otherwise stated.
3: The minimum clock period for SCKx is 111 ns. The clock generated in Master mode must not violate this
specification.
4: Assumes 50 pF load on all SPIx pins.
FIGURE 28-12: SPIx MASTER MODE (FULL-DUPLEX, CKE = 0, CKP = X, SMP = 1) TIMING
CHARACTERISTICS
SCKx
(CKP = 0)
SCKx
(CKP = 1)
SP40 SP41
TABLE 28-31: SPIx MASTER MODE (FULL-DUPLEX, CKE = 0, CKP = x, SMP = 1) TIMING
REQUIREMENTS
Standard Operating Conditions: 3.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(1) Min Typ(2) Max Units Conditions
No.
SP10 TscP Maximum SCK Frequency — — 9 MHz -40ºC to +125ºC and
see Note 3
SP20 TscF SCKx Output Fall Time — — — ns See parameter DO32
and Note 4
SP21 TscR SCKx Output Rise Time — — — ns See parameter DO31
and Note 4
SP30 TdoF SDOx Data Output Fall Time — — — ns See parameter DO32
and Note 4
SP31 TdoR SDOx Data Output Rise Time — — — ns See parameter DO31
and Note 4
SP35 TscH2doV, SDOx Data Output Valid after — 6 20 ns —
TscL2doV SCKx Edge
SP36 TdoV2scH, SDOx Data Output Setup to 30 — — ns —
TdoV2scL First SCKx Edge
SP40 TdiV2scH, Setup Time of SDIx Data 30 — — ns —
TdiV2scL Input to SCKx Edge
SP41 TscH2diL, Hold Time of SDIx Data Input 30 — — ns —
TscL2diL to SCKx Edge
Note 1: These parameters are characterized, but are not tested in manufacturing.
2: Data in “Typ” column is at 3.3V, 25°C unless otherwise stated.
3: The minimum clock period for SCKx is 111 ns. The clock generated in Master mode must not violate this
specification.
4: Assumes 50 pF load on all SPIx pins.
FIGURE 28-13: SPIx SLAVE MODE (FULL-DUPLEX, CKE = 1, CKP = 0, SMP = 0) TIMING
CHARACTERISTICS
SP60
SSx
SP50 SP52
SCKx
(CKP = 0)
SCKx
(CKP = 1)
SP35
SP72 SP73
SP30,SP31 SP51
SDI
SDIx
MSb In Bit 14 - - - -1 LSb In
SP41
SP40
TABLE 28-32: SPIx SLAVE MODE (FULL-DUPLEX, CKE = 1, CKP = 0, SMP = 0) TIMING
REQUIREMENTS
Standard Operating Conditions: 3.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(1) Min Typ(2) Max Units Conditions
No.
SP70 TscP Maximum SCK Input Frequency — — 15 MHz See Note 3
SP72 TscF SCKx Input Fall Time — — — ns See parameter DO32
and Note 4
SP73 TscR SCKx Input Rise Time — — — ns See parameter DO31
and Note 4
SP30 TdoF SDOx Data Output Fall Time — — — ns See parameter DO32
and Note 4
SP31 TdoR SDOx Data Output Rise Time — — — ns See parameter DO31
and Note 4
SP35 TscH2doV, SDOx Data Output Valid after — 6 20 ns —
TscL2doV SCKx Edge
SP36 TdoV2scH, SDOx Data Output Setup to 30 — — ns —
TdoV2scL First SCKx Edge
SP40 TdiV2scH, Setup Time of SDIx Data Input 30 — — ns —
TdiV2scL to SCKx Edge
SP41 TscH2diL, Hold Time of SDIx Data Input 30 — — ns —
TscL2diL to SCKx Edge
SP50 TssL2scH, SSx ↓ to SCKx ↑ or SCKx Input 120 — — ns —
TssL2scL
SP51 TssH2doZ SSx ↑ to SDOx Output 10 — 50 ns —
High-Impedance(4)
SP52 TscH2ssH SSx after SCKx Edge 1.5 TCY + 40 — — ns See Note 4
TscL2ssH
SP60 TssL2doV SDOx Data Output Valid after — — 50 ns —
SSx Edge
Note 1: These parameters are characterized, but are not tested in manufacturing.
2: Data in “Typ” column is at 3.3V, 25°C unless otherwise stated.
3: The minimum clock period for SCKx is 66.7 ns. Therefore, the SCK clock generated by the Master must
not violate this specification.
4: Assumes 50 pF load on all SPIx pins.
FIGURE 28-14: SPIx SLAVE MODE (FULL-DUPLEX, CKE = 1, CKP = 1, SMP = 0) TIMING
CHARACTERISTICS
SP60
SSx
SP50 SP52
SCKx
(CKP = 0)
SCKx
(CKP = 1)
SP35
SP72 SP73
SP52
SP30,SP31 SP51
SDI
SDIx
MSb In Bit 14 - - - -1 LSb In
SP41
SP40
TABLE 28-33: SPIx SLAVE MODE (FULL-DUPLEX, CKE = 1, CKP = 1, SMP = 0) TIMING
REQUIREMENTS
Standard Operating Conditions: 3.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(1) Min Typ(2) Max Units Conditions
No.
SP70 TscP Maximum SCK Input Frequency — — 11 MHz See Note 3
SP72 TscF SCKx Input Fall Time — — — ns See parameter DO32
and Note 4
SP73 TscR SCKx Input Rise Time — — — ns See parameter DO31
and Note 4
SP30 TdoF SDOx Data Output Fall Time — — — ns See parameter DO32
and Note 4
SP31 TdoR SDOx Data Output Rise Time — — — ns See parameter DO31
and Note 4
SP35 TscH2doV, SDOx Data Output Valid after — 6 20 ns —
TscL2doV SCKx Edge
SP36 TdoV2scH, SDOx Data Output Setup to 30 — — ns —
TdoV2scL First SCKx Edge
SP40 TdiV2scH, Setup Time of SDIx Data Input 30 — — ns —
TdiV2scL to SCKx Edge
SP41 TscH2diL, Hold Time of SDIx Data Input 30 — — ns —
TscL2diL to SCKx Edge
SP50 TssL2scH, SSx ↓ to SCKx ↑ or SCKx Input 120 — — ns —
TssL2scL
SP51 TssH2doZ SSx ↑ to SDOx Output 10 — 50 ns —
High-Impedance(4)
SP52 TscH2ssH SSx after SCKx Edge 1.5 TCY + 40 — — ns See Note 4
TscL2ssH
SP60 TssL2doV SDOx Data Output Valid after — — 50 ns —
SSx Edge
Note 1: These parameters are characterized, but are not tested in manufacturing.
2: Data in “Typ” column is at 3.3V, 25°C unless otherwise stated.
3: The minimum clock period for SCKx is 91 ns. Therefore, the SCK clock generated by the Master must not
violate this specification.
4: Assumes 50 pF load on all SPIx pins.
FIGURE 28-15: SPIx SLAVE MODE (FULL-DUPLEX CKE = 0, CKP = 1, SMP = 0) TIMING
CHARACTERISTICS
SSX
SP50 SP52
SCKX
(CKP = 0)
SCKX
(CKP = 1)
SP72 SP73
SP35
SP30,SP31 SP51
SP41
SP40
TABLE 28-34: SPIx SLAVE MODE (FULL-DUPLEX, CKE = 0, CKP = 1, SMP = 0) TIMING
REQUIREMENTS
Standard Operating Conditions: 3.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(1) Min Typ(2) Max Units Conditions
No.
SP70 TscP Maximum SCK Input Frequency — — 15 MHz See Note 3
SP72 TscF SCKx Input Fall Time — — — ns See parameter DO32
and Note 4
SP73 TscR SCKx Input Rise Time — — — ns See parameter DO31
and Note 4
SP30 TdoF SDOx Data Output Fall Time — — — ns See parameter DO32
and Note 4
SP31 TdoR SDOx Data Output Rise Time — — — ns See parameter DO31
and Note 4
SP35 TscH2doV, SDOx Data Output Valid after — 6 20 ns —
TscL2doV SCKx Edge
SP36 TdoV2scH, SDOx Data Output Setup to 30 — — ns —
TdoV2scL First SCKx Edge
SP40 TdiV2scH, Setup Time of SDIx Data Input 30 — — ns —
TdiV2scL to SCKx Edge
SP41 TscH2diL, Hold Time of SDIx Data Input 30 — — ns —
TscL2diL to SCKx Edge
SP50 TssL2scH, SSx ↓ to SCKx ↑ or SCKx Input 120 — — ns —
TssL2scL
SP51 TssH2doZ SSx ↑ to SDOx Output 10 — 50 ns —
High-Impedance(4)
SP52 TscH2ssH SSx after SCKx Edge 1.5 TCY + 40 — — ns See Note 4
TscL2ssH
Note 1: These parameters are characterized, but are not tested in manufacturing.
2: Data in “Typ” column is at 3.3V, 25°C unless otherwise stated.
3: The minimum clock period for SCKx is 66.7 ns. Therefore, the SCK clock generated by the Master must
not violate this specification.
4: Assumes 50 pF load on all SPIx pins.
FIGURE 28-16: SPIx SLAVE MODE (FULL-DUPLEX, CKE = 0, CKP = 0, SMP = 0) TIMING
CHARACTERISTICS
SSX
SP50 SP52
SCKX
(CKP = 0)
SCKX
(CKP = 1)
SP72 SP73
SP35
SP30,SP31 SP51
SP41
SP40
TABLE 28-35: SPIx SLAVE MODE (FULL-DUPLEX, CKE = 0, CKP = 0, SMP = 0) TIMING
REQUIREMENTS
Standard Operating Conditions: 3.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(1) Min Typ(2) Max Units Conditions
No.
SP70 TscP Maximum SCK Input Frequency — — 11 MHz See Note 3
SP72 TscF SCKx Input Fall Time — — — ns See parameter DO32
and Note 4
SP73 TscR SCKx Input Rise Time — — — ns See parameter DO31
and Note 4
SP30 TdoF SDOx Data Output Fall Time — — — ns See parameter DO32
and Note 4
SP31 TdoR SDOx Data Output Rise Time — — — ns See parameter DO31
and Note 4
SP35 TscH2doV, SDOx Data Output Valid after — 6 20 ns —
TscL2doV SCKx Edge
SP36 TdoV2scH, SDOx Data Output Setup to 30 — — ns —
TdoV2scL First SCKx Edge
SP40 TdiV2scH, Setup Time of SDIx Data Input 30 — — ns —
TdiV2scL to SCKx Edge
SP41 TscH2diL, Hold Time of SDIx Data Input 30 — — ns —
TscL2diL to SCKx Edge
SP50 TssL2scH, SSx ↓ to SCKx ↑ or SCKx Input 120 — — ns —
TssL2scL
SP51 TssH2doZ SSx ↑ to SDOx Output 10 — 50 ns —
High-Impedance(4)
SP52 TscH2ssH SSx after SCKx Edge 1.5 TCY + 40 — — ns See Note 4
TscL2ssH
Note 1: These parameters are characterized, but are not tested in manufacturing.
2: Data in “Typ” column is at 3.3V, 25°C unless otherwise stated.
3: The minimum clock period for SCKx is 91 ns. Therefore, the SCK clock generated by the Master must not
violate this specification.
4: Assumes 50 pF load on all SPIx pins.
FIGURE 28-17: I2Cx BUS START/STOP BITS TIMING CHARACTERISTICS (MASTER MODE)
SCLx
IM31 IM34
IM30 IM33
SDAx
Start Stop
Condition Condition
SDAx
Out
FIGURE 28-19: I2Cx BUS START/STOP BITS TIMING CHARACTERISTICS (SLAVE MODE)
SCLx
IS31 IS34
IS30 IS33
SDAx
Start Stop
Condition Condition
SDAx
Out
CA10 CA11
CiRx Pin
(input)
CA20
ADCLK
Instruction
Execution Set SAMP Clear SAMP
SAMP
AD61
AD60
TSAMP AD55
DONE
AD1IF
1 2 3 4 5 6 7 8 9
AD50
ADCLK
Instruction
Execution Set SAMP Clear SAMP
SAMP
AD61
AD60
DONE
AD1IF
1 2 3 4 5 6 7 8 5 6 7 8
FIGURE 28-24: ADC CONVERSION (10-BIT MODE) TIMING CHARACTERISTICS (CHPS<1:0> = 01,
SIMSAM = 0, ASAM = 1, SSRC<2:0> = 111, SAMC<4:0> = 00001)
AD50
ADCLK
Instruction
Set ADON
Execution
SAMP
TSAMP AD55 AD55 TSAMP AD55
AD1IF
DONE
1 2 3 4 5 6 7 3 4 5 6 8
CS
RD
WR
PS4
PMD<7:0>
PS3 PS1
PS2
P1 P2 P3 P4 P1 P2 P3 P4 P1 P2
System
Clock
PMA<13:8> Address
PMALL/PMALH PM1
PMCS1
P1 P2 P3 P4 P1 P2 P3 P4 P1 P2
System
Clock
PMA<13:8> Address
PM12
PMRD PM13
PMWR PM11
PMALL/PMALH
PMCS1 PM16
Note 1: Stresses above those listed under “Absolute Maximum Ratings” can 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 can affect device reliability.
2: Maximum allowable current is a function of device maximum power dissipation (see Table 29-2).
3: Unlike devices at 125°C and below, the specifications in this section also apply to the CLKOUT, VREF+,
VREF-, SCLx, SDAx, PGCx and PGDx pins.
4: AEC-Q100 reliability testing for devices intended to operate at 150°C is 1,000 hours. Any design in which
the total operating time from 125°C to 150°C will be greater than 1,000 hours is not warranted without prior
written approval from Microchip Technology Inc.
5: Refer to the “Pin Diagrams” section for 5V tolerant pins.
Load Condition 1 – for all pins except OSC2 Load Condition 2 – for OSC2
VDD/2
RL Pin CL
VSS
CL
Pin RL = 464Ω
CL = 50 pF for all pins except OSC2
VSS 15 pF for OSC2 output
Param
Symbol Characteristic Min Typ Max Units Conditions
No.
HOS53 DCLK CLKO Stability (Jitter)(1) -5 0.5 5 % Measured over 100 ms
period
Note 1: These parameters are characterized, but are not tested in manufacturing.
Param
Symbol Characteristic(1) Min Typ Max Units Conditions
No.
HSP35 TscH2doV, SDOx Data Output Valid after — 10 25 ns —
TscL2doV SCKx Edge
HSP40 TdiV2scH, Setup Time of SDIx Data Input 28 — — ns —
TdiV2scL to SCKx Edge
HSP41 TscH2diL, Hold Time of SDIx Data Input 35 — — ns —
TscL2diL to SCKx Edge
Note 1: These parameters are characterized but not tested in manufacturing.
Param
Symbol Characteristic(1) Min Typ Max Units Conditions
No.
HSP35 TscH2doV, SDOx Data Output Valid after — 10 25 ns —
TscL2doV SCKx Edge
HSP36 TdoV2sc, SDOx Data Output Setup to 35 — — ns —
TdoV2scL First SCKx Edge
HSP40 TdiV2scH, Setup Time of SDIx Data Input 28 — — ns —
TdiV2scL to SCKx Edge
HSP41 TscH2diL, Hold Time of SDIx Data Input 35 — — ns —
TscL2diL to SCKx Edge
Note 1: These parameters are characterized but not tested in manufacturing.
Param
Symbol Characteristic(1) Min Typ Max Units Conditions
No.
HSP35 TscH2doV, SDOx Data Output Valid after — — 35 ns —
TscL2doV SCKx Edge
HSP40 TdiV2scH, Setup Time of SDIx Data Input 25 — — ns —
TdiV2scL to SCKx Edge
HSP41 TscH2diL, Hold Time of SDIx Data Input to 25 — — ns —
TscL2diL SCKx Edge
HSP51 TssH2doZ SSx ↑ to SDOx Output 15 — 55 ns See Note 2
High-Impedance
Note 1: These parameters are characterized but not tested in manufacturing.
2: Assumes 50 pF load on all SPIx pins.
Param
Symbol Characteristic(1) Min Typ Max Units Conditions
No.
HSP35 TscH2doV, SDOx Data Output Valid after — — 35 ns —
TscL2doV SCKx Edge
HSP40 TdiV2scH, Setup Time of SDIx Data Input 25 — — ns —
TdiV2scL to SCKx Edge
HSP41 TscH2diL, Hold Time of SDIx Data Input 25 — — ns —
TscL2diL to SCKx Edge
HSP51 TssH2doZ SSx ↑ to SDOX Output 15 — 55 ns See Note 2
High-Impedance
HSP60 TssL2doV SDOx Data Output Valid after — — 55 ns —
SSx Edge
Note 1: These parameters are characterized but not tested in manufacturing.
2: Assumes 50 pF load on all SPIx pins.
Param
Symbol Characteristic Min Typ Max Units Conditions
No.
Reference Inputs
HAD08 IREF Current Drain — 250 600 μA ADC operating, See Note 1
— — 50 μA ADC off, See Note 1
Note 1: These parameters are not characterized or tested in manufacturing.
2: These parameters are characterized, but are not tested in manufacturing.
Param
Symbol Characteristic Min Typ Max Units Conditions
No.
ADC Accuracy (12-bit Mode) – Measurements with External VREF+/VREF-(1)
HAD20a Nr Resolution(3) 12 data bits bits —
HAD21a INL Integral Nonlinearity -2 — +2 LSb VINL = AVSS = VREFL = 0V,
AVDD = VREFH = 3.6V
HAD22a DNL Differential Nonlinearity > -1 — <1 LSb VINL = AVSS = VREFL = 0V,
AVDD = VREFH = 3.6V
HAD23a GERR Gain Error -2 — 10 LSb VINL = AVSS = VREFL = 0V,
AVDD = VREFH = 3.6V
HAD24a EOFF Offset Error -3 — 5 LSb VINL = AVSS = VREFL = 0V,
AVDD = VREFH = 3.6V
ADC Accuracy (12-bit Mode) – Measurements with Internal VREF+/VREF-(1)
HAD20a Nr Resolution(3) 12 data bits bits —
HAD21a INL Integral Nonlinearity -2 — +2 LSb VINL = AVSS = 0V, AVDD = 3.6V
HAD22a DNL Differential Nonlinearity > -1 — <1 LSb VINL = AVSS = 0V, AVDD = 3.6V
HAD23a GERR Gain Error 2 — 20 LSb VINL = AVSS = 0V, AVDD = 3.6V
HAD24a EOFF Offset Error 2 — 10 LSb VINL = AVSS = 0V, AVDD = 3.6V
Dynamic Performance (12-bit Mode)(2)
HAD33a FNYQ Input Signal Bandwidth — — 200 kHz —
Note 1: These parameters are characterized, but are tested at 20 ksps only.
2: These parameters are characterized by similarity, but are not tested in manufacturing.
3: Injection currents > | 0 | can affect the ADC results by approximately 4-6 counts.
Param
Symbol Characteristic Min Typ Max Units Conditions
No.
Param
Symbol Characteristic Min Typ Max Units Conditions
No.
Clock Parameters
(1)
HAD50 TAD ADC Clock Period 147 — — ns —
Conversion Rate
HAD56 FCNV Throughput Rate(1) — — 400 Ksps —
Note 1: These parameters are characterized but not tested in manufacturing.
Param
Symbol Characteristic Min Typ Max Units Conditions
No.
Clock Parameters
HAD50 TAD ADC Clock Period(1) 104 — — ns —
Conversion Rate
HAD56 FCNV Throughput Rate(1) — — 800 Ksps —
Note 1: These parameters are characterized but not tested in manufacturing.
NOTES:
Note: The graphs provided following this note are a statistical summary based on a limited number of samples and are provided for design guidance purposes only.
The performance characteristics listed herein are not tested or guaranteed. In some graphs, the data presented may be outside the specified operating range
(e.g., outside specified power supply range) and therefore, outside the warranted range.
IOH (A)
-0.008 -0.020
-0.006 -0.015
-0.004 -0.010
-0.002 -0.005
0.000 0.000
0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 0.00 1.00 2.00 3.00 4.00
VOH (V) VOH (V)
FIGURE 32-2: VOH – 4x DRIVER PINS FIGURE 32-4: VOH – 16x DRIVER PINS
-0.030 -0.080
3.6V
-0.070 3.6V
-0.025
3.3V -0.060 3.3V
-0.020 -0.050
3V 3V
IOH (A)
IOH (A)
-0.015 -0.040
-0.030
-0.010
-0.020
DS70293G-page 357
-0.005 -0.010
0.000 0.000
0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 0.00 1.00 2.00 3.00 4.00
IOL (A)
IOL (A)
0.010 0.030
0.008
0.020
0.006
0.004 0.010
0.002
0.000 0.000
0.00 1.00 2.00 3.00 4.00 0.00 1.00 2.00 3.00 4.00
VOL (V) VOL (V)
FIGURE 32-6: VOL – 4x DRIVER PINS FIGURE 32-8: VOL – 16x DRIVER PINS
0.040 0.120
IOL (A)
IOL (A)
0.020 0.060
0.015
0.040
0.010
0.020
0.005
0.000 0.000
0.00 1.00 2.00 3.00 4.00 0.00 1.00 2.00 3.00 4.00
VOL (V) VOL (V)
FIGURE 32-9: TYPICAL IPD CURRENT @ VDD = 3.3V, +85ºC FIGURE 32-11: TYPICAL IDOZE CURRENT @ VDD = 3.3V, +85ºC
© 2007-2012 Microchip Technology Inc.
80.00
1200
70.00
600 40.00
400 30.00
20.00
200
10.00
0
0.00
-40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120
1:1 2:1 64:1 128:1
Temperature (Celsius) Doze Ratio
FIGURE 32-10: TYPICAL IDD CURRENT @ VDD = 3.3V, +85ºC FIGURE 32-12: TYPICAL IIDLE CURRENT @ VDD = 3.3V, +85ºC
60 35
25
40
30
15
20 10
PMD = 0, no PLL
DS70293G-page 359
PMD = 1, no PLL 5
10
0
0 10 20 30 40
0 5 10 15 20 25 30 35 40 45
MIPS
MIPS
FIGURE 32-13: TYPICAL FRC FREQUENCY @ VDD = 3.3V FIGURE 32-14: TYPICAL LPRC FREQUENCY @ VDD = 3.3V
DS70293G-page 360
7400
30
7300
7200 25
-40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120
XXXXXXXXXXXXXXXXX PIC24HJ32GP
XXXXXXXXXXXXXXXXX 302-E/SP e3
YYWWNNN 0730235
XXXXXXXXXXXXXXXXXXXX PIC24HJ32GP
XXXXXXXXXXXXXXXXXXXX 302-E/SO e3
XXXXXXXXXXXXXXXXXXXX 0730235
YYWWNNN
XXXXXXXX 24HJ32GP
XXXXXXXX 302EMM
YYWWNNN 0730235
XXXXXXXXXX PIC
XXXXXXXXXX 24HJ32GP304
XXXXXXXXXX -E/ML e3
YYWWNNN 0730235
XXXXXXXXXX PIC
XXXXXXXXXX 24HJ32GP304
XXXXXXXXXX -I/PT e3
YYWWNNN 0730235
Note: If the full Microchip part number cannot be marked on one line, it is carried over to the next
line, thus limiting the number of available characters for customer-specific information.
NOTE 1
E1
1 2 3
A A2
L c
A1 b1
b e eB
Units INCHES
Dimension Limits MIN NOM MAX
Number of Pins N 28
Pitch e .100 BSC
Top to Seating Plane A – – .200
Molded Package Thickness A2 .120 .135 .150
Base to Seating Plane A1 .015 – –
Shoulder to Shoulder Width E .290 .310 .335
Molded Package Width E1 .240 .285 .295
Overall Length D 1.345 1.365 1.400
Tip to Seating Plane L .110 .130 .150
Lead Thickness c .008 .010 .015
Upper Lead Width b1 .040 .050 .070
Lower Lead Width b .014 .018 .022
Overall Row Spacing § eB – – .430
Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. § Significant Characteristic.
3. Dimensions D and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed .010" per side.
4. Dimensioning and tolerancing per ASME Y14.5M.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
D
N
E
E1
NOTE 1
1 2 3
e
b
h
α
h
φ c
A A2
L
A1 L1 β
Units MILLMETERS
Dimension Limits MIN NOM MAX
Number of Pins N 28
Pitch e 1.27 BSC
Overall Height A – – 2.65
Molded Package Thickness A2 2.05 – –
Standoff § A1 0.10 – 0.30
Overall Width E 10.30 BSC
Molded Package Width E1 7.50 BSC
Overall Length D 17.90 BSC
Chamfer (optional) h 0.25 – 0.75
Foot Length L 0.40 – 1.27
Footprint L1 1.40 REF
Foot Angle Top φ 0° – 8°
Lead Thickness c 0.18 – 0.33
Lead Width b 0.31 – 0.51
Mold Draft Angle Top α 5° – 15°
Mold Draft Angle Bottom β 5° – 15°
Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. § Significant Characteristic.
3. Dimensions D and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed 0.15 mm per side.
4. Dimensioning and tolerancing per ASME Y14.5M.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
REF: Reference Dimension, usually without tolerance, for information purposes only.
Microchip Technology Drawing C04-052B
28-Lead Plastic Quad Flat, No Lead Package (MM) – 6x6x0.9 mm Body [QFN-S]
with 0.40 mm Contact Length
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
D D2
EXPOSED
PAD
E2
E
b
2 2
1 1 K
N N
L
NOTE 1 BOTTOM VIEW
TOP VIEW
A3 A1
Units MILLIMETERS
Dimension Limits MIN NOM MAX
Number of Pins N 28
Pitch e 0.65 BSC
Overall Height A 0.80 0.90 1.00
Standoff A1 0.00 0.02 0.05
Contact Thickness A3 0.20 REF
Overall Width E 6.00 BSC
Exposed Pad Width E2 3.65 3.70 4.70
Overall Length D 6.00 BSC
Exposed Pad Length D2 3.65 3.70 4.70
Contact Width b 0.23 0.38 0.43
Contact Length L 0.30 0.40 0.50
Contact-to-Exposed Pad K 0.20 – –
Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. Package is saw singulated.
3. Dimensioning and tolerancing per ASME Y14.5M.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
REF: Reference Dimension, usually without tolerance, for information purposes only.
Microchip Technology Drawing C04-124B
/HDG3ODVWLF4XDG)ODW1R/HDG3DFNDJH 00 ±[[PP%RG\>4)16@
ZLWKPP&RQWDFW/HQJWK
1RWH )RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
44-Lead Plastic Quad Flat, No Lead Package (ML) – 8x8 mm Body [QFN]
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
D D2
EXPOSED
PAD
E2
b
2 2
1 1
N N K
NOTE 1 L
A3 A1
Units MILLIMETERS
Dimension Limits MIN NOM MAX
Number of Pins N 44
Pitch e 0.65 BSC
Overall Height A 0.80 0.90 1.00
Standoff A1 0.00 0.02 0.05
Contact Thickness A3 0.20 REF
Overall Width E 8.00 BSC
Exposed Pad Width E2 6.30 6.45 6.80
Overall Length D 8.00 BSC
Exposed Pad Length D2 6.30 6.45 6.80
Contact Width b 0.25 0.30 0.38
Contact Length L 0.30 0.40 0.50
Contact-to-Exposed Pad K 0.20 – –
Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. Package is saw singulated.
3. Dimensioning and tolerancing per ASME Y14.5M.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
REF: Reference Dimension, usually without tolerance, for information purposes only.
/HDG3ODVWLF4XDG)ODW1R/HDG3DFNDJH 0/ ±[PP%RG\>4)1@
1RWH )RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
44-Lead Plastic Thin Quad Flatpack (PT) – 10x10x1 mm Body, 2.00 mm Footprint [TQFP]
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
D
D1
E
e
E1
N
b
NOTE 1 1 2 3
NOTE 2
A α
c φ
β A1 A2
L L1
Units MILLIMETERS
Dimension Limits MIN NOM MAX
Number of Leads N 44
Lead Pitch e 0.80 BSC
Overall Height A – – 1.20
Molded Package Thickness A2 0.95 1.00 1.05
Standoff A1 0.05 – 0.15
Foot Length L 0.45 0.60 0.75
Footprint L1 1.00 REF
Foot Angle φ 0° 3.5° 7°
Overall Width E 12.00 BSC
Overall Length D 12.00 BSC
Molded Package Width E1 10.00 BSC
Molded Package Length D1 10.00 BSC
Lead Thickness c 0.09 – 0.20
Lead Width b 0.30 0.37 0.45
Mold Draft Angle Top α 11° 12° 13°
Mold Draft Angle Bottom β 11° 12° 13°
Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. Chamfers at corners are optional; size may vary.
3. Dimensions D1 and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed 0.25 mm per side.
4. Dimensioning and tolerancing per ASME Y14.5M.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
REF: Reference Dimension, usually without tolerance, for information purposes only.
Microchip Technology Drawing C04-076B
/HDG3ODVWLF7KLQ4XDG)ODWSDFN 37 ±[[PP%RG\PP>74)3@
1RWH )RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
NOTES:
Added Note 2 to the 28-Pin QFN-S and 44-Pin QFN pin diagrams, which
references pin connections to VSS.
Section 1.0 “Device Overview” Updated AVDD in the PINOUT I/O Descriptions (see Table 1-1).
Section 2.0 “Guidelines for Getting Added new section to the data sheet that provides guidelines on getting
Started with 16-bit Microcontrollers” started with 16-bit Digital Signal Controllers.
Updated Reset value for IPC15 in the Interrupt Controller Register Map
(see Table 4-4).
Removed the FLTA1IE bit (IEC3) from the Interrupt Controller Register
Map (see Table 4-4).
Updated bit locations for RPINR25 in the Peripheral Pin Select Input
Register Map (see Table 4-19).
Updated the Reset value for CLKDIV in the System Control Register Map
(see Table 4-31).
Section 5.0 “Flash Program Memory” Updated Section 5.3 “Programming Operations” with programming
time formula.
Section 9.0 “Oscillator Configuration” Updated the Oscillator System Diagram and added Note 2 (see
Figure 9-1).
Updated default bit values for DOZE<2:0> and FRCDIV<2:0> in the Clock
Divisor (CLKDIV) Register (see Register 9-2).
Updated bit values for ADCS<7:0> and added Notes 1 and 2 to the ADC1
Control Register 3 (AD1CON3) (see Register 20-3).
Added Note 2 to the ADC1 Input Scan Select Register Low (AD1CSSL)
(see Register 20-7).
Updated Min and Max values for parameter DC12 (RAM Data Retention
Voltage) and added Note 4 (see Table 28-4).
Updated Characteristics for I/O Pin Input Specifications (see Table 28-9).
Updated Program Memory values for parameters 136, 137 and 138
(renamed to 136a, 137a and 138a), added parameters 136b, 137b and
138b, and added Note 2 (see Table 28-12).
Updated all typical and maximum Idle Current (IIDLE) values (see
Table 28-6).
Updated all typical Doze Current (Idoze) values (see Table 28-8).
Added Note 2 to the PLL Clock Timing Specifications (see Table 28-
17)
Updated all SPI specifications (see Table 28-28 through Table 28-35
and Figure 28-10 through Figure 28-16)
Updated the minimum value for parameter PM6 and the maximum
value for parameter PM7 in the Parallel Master Port Read Timing
Requirements (see Table 28-49).
INDEX
A D
A/D Converter ................................................................... 227 Data Address Space........................................................... 27
DMA .......................................................................... 227 Alignment.................................................................... 27
Initialization ............................................................... 227 Memory Map for PIC24HJ128GP202/204 and
Key Features............................................................. 227 PIC24HJ64GP202/204 Devices
AC Characteristics .................................................... 306, 348 with 8 KB RAM ................................................... 29
ADC Module.............................................................. 351 Memory Map for PIC24HJ32GP302/304 Devices
ADC Module (10-bit Mode) ....................................... 352 with 4 KB RAM ................................................... 28
ADC Module (12-bit Mode) ....................................... 351 Near Data Space ........................................................ 27
Internal RC Accuracy ................................................ 308 Software Stack ........................................................... 47
Load Conditions ................................................ 306, 348 Width .......................................................................... 27
ADC Module DC and AC Characteristics
ADC11 Register Map .................................................. 36 Graphs and Tables ................................................... 355
Alternate Interrupt Vector Table (AIVT) .............................. 69 DC Characteristics............................................................ 296
Arithmetic Logic Unit (ALU)................................................. 23 Doze Current (IDOZE)................................................ 347
Assembler High Temperature..................................................... 346
MPASM Assembler................................................... 292 I/O Pin Input Specifications ...................................... 301
I/O Pin Output........................................................... 347
B I/O Pin Output Specifications.................................... 304
Block Diagrams Idle Current (IDOZE) .................................................. 300
16-bit Timer1 Module ................................................ 161 Idle Current (IIDLE) .................................................... 299
A/D Module ....................................................... 228, 229 Operating Current (IDD) ............................................ 298
Connections for On-Chip Voltage Regulator............. 277 Operating MIPS vs. Voltage ..................................... 346
Device Clock ..................................................... 119, 121 Power-Down Current (IPD)........................................ 300
ECAN Module ........................................................... 201 Power-down Current (IPD) ........................................ 346
Input Capture ............................................................ 171 Program Memory.............................................. 305, 347
Output Compare ....................................................... 175 Temperature and Voltage......................................... 346
PIC24HJ32GP302/304, PIC24HJ64GPX02/X04, and Temperature and Voltage Specifications.................. 297
PIC24HJ128GPX02/X04 .................................... 10 Thermal Operating Conditions.................................. 346
PIC24HJ32GP302/304, PIC24HJ64GPX02/X04, and Development Support ....................................................... 291
PIC24HJ128GPX02/X04 CPU Core ................... 18 DMA Module
PLL............................................................................ 121 DMA Register Map ..................................................... 37
Reset System.............................................................. 59 DMAC Registers ............................................................... 109
Shared Port Structure ............................................... 135 DMAxCNT ................................................................ 109
SPI ............................................................................ 179 DMAxCON................................................................ 109
Timer2 (16-bit) .......................................................... 165 DMAxPAD ................................................................ 109
Timer2/3 (32-bit) ....................................................... 167 DMAxREQ ................................................................ 109
UART ........................................................................ 193 DMAxSTA................................................................. 109
Watchdog Timer (WDT) ............................................ 278 DMAxSTB................................................................. 109
Doze Mode ....................................................................... 130
C
C Compilers E
MPLAB C18 .............................................................. 292 ECAN Module
Clock Switching................................................................. 128 CiBUFPNT1 register................................................. 213
Enabling .................................................................... 128 CiBUFPNT2 register................................................. 214
Sequence.................................................................. 128 CiBUFPNT3 register................................................. 214
Code Examples CiBUFPNT4 register................................................. 215
Erasing a Program Memory Page............................... 57 CiCFG1 register........................................................ 211
Initiating a Programming Sequence............................ 58 CiCFG2 register........................................................ 212
Loading Write Buffers ................................................. 58 CiCTRL1 register...................................................... 204
Port Write/Read ........................................................ 136 CiCTRL2 register...................................................... 205
PWRSAV Instruction Syntax..................................... 129 CiEC register ............................................................ 211
Code Protection ........................................................ 273, 279 CiFCTRL register...................................................... 207
Configuration Bits.............................................................. 273 CiFEN1 register ........................................................ 213
Configuration Register Map .............................................. 273 CiFIFO register ......................................................... 208
Configuring Analog Port Pins ............................................ 136 CiFMSKSEL1 register .............................................. 217
CPU CiFMSKSEL2 register .............................................. 218
Control Register .......................................................... 21 CiINTE register ......................................................... 210
CPU Clocking System....................................................... 120 CiINTF register ......................................................... 209
PLL Configuration ..................................................... 121 CiRXFnEID register .................................................. 217
Selection ................................................................... 120 CiRXFnSID register .................................................. 216
Sources..................................................................... 120 CiRXFUL1 register ................................................... 220
Customer Change Notification Service ............................. 387 CiRXFUL2 register ................................................... 220
Customer Notification Service........................................... 387 CiRXMnEID register ................................................. 219
Customer Support ............................................................. 387 CiRXMnSID register ................................................. 219
CiRXOVF1 register................................................... 221
I O
I/O Ports ............................................................................ 135 Open-Drain Configuration................................................. 136
Parallel I/O (PIO)....................................................... 135 Output Compare ............................................................... 175
Write/Read Timing .................................................... 136
I2 C
P
Operating Modes ...................................................... 185 Packaging ......................................................................... 363
Registers ................................................................... 185 Details....................................................................... 364
In-Circuit Debugger ........................................................... 279 Marking ..................................................................... 363
Peripheral Module Disable (PMD) .................................... 130 Extended Identifier) .......................................... 219
Pinout I/O Descriptions ....................................................... 11 CiRXMnSID (ECAN Acceptance Filter Mask n
PMD Module Standard Identifier) ........................................... 219
Register Map............................................................... 46 CiRXOVF1 (ECAN Receive Buffer Overflow 1)........ 221
PORTA CiRXOVF2 (ECAN Receive Buffer Overflow 2)........ 221
Register Map......................................................... 44, 45 CiTRBnSID (ECAN Buffer n Standard Identifier)..... 223,
PORTB 224, 226
Register Map............................................................... 45 CiTRmnCON (ECAN TX/RX Buffer m Control) ........ 222
Power-on Reset (POR) ....................................................... 65 CiVEC (ECAN Interrupt Code) ................................. 206
Power-Saving Features .................................................... 129 CLKDIV (Clock Divisor) ............................................ 125
Clock Frequency and Switching................................ 129 CORCON (Core Control)...................................... 22, 74
Program Address Space ..................................................... 25 DMACS0 (DMA Controller Status 0) ........................ 114
Construction................................................................ 49 DMACS1 (DMA Controller Status 1) ........................ 116
Data Access from Program Memory DMAxCNT (DMA Channel x Transfer Count)........... 113
Using Program Space Visibility........................... 52 DMAxCON (DMA Channel x Control)....................... 110
Data Access from Program Memory DMAxPAD (DMA Channel x Peripheral Address) .... 113
Using Table Instructions ..................................... 51 DMAxREQ (DMA Channel x IRQ Select) ................. 111
Data Access from, Address Generation...................... 50 DMAxSTA (DMA Channel x RAM Start Address A) . 112
Memory Map ............................................................... 25 DMAxSTB (DMA Channel x RAM Start Address B) . 112
Table Read Instructions DSADR (Most Recent DMA RAM Address) ............. 117
TBLRDH ............................................................. 51 I2CxCON (I2Cx Control)........................................... 188
TBLRDL .............................................................. 51 I2CxMSK (I2Cx Slave Mode Address Mask)............ 192
Visibility Operation ...................................................... 52 I2CxSTAT (I2Cx Status) ........................................... 190
Program Memory IFS0 (Interrupt Flag Status 0) ............................... 77, 84
Interrupt Vector ........................................................... 26 IFS1 (Interrupt Flag Status 1) ............................... 79, 86
Organization................................................................ 26 IFS2 (Interrupt Flag Status 2) ............................... 81, 88
Reset Vector ............................................................... 26 IFS3 (Interrupt Flag Status 3) ............................... 82, 89
IFS4 (Interrupt Flag Status 4) ............................... 83, 90
R INTCON1 (Interrupt Control 1) ................................... 75
Reader Response ............................................................. 388 INTCON2 (Interrupt Control 2) ................................... 76
Register Map INTTREG Interrupt Control and Status Register ...... 105
CRC ............................................................................ 44 IPC0 (Interrupt Priority Control 0) ............................... 91
Dual Comparator......................................................... 44 IPC1 (Interrupt Priority Control 1) ............................... 92
Parallel Master/Slave Port .......................................... 43 IPC11 (Interrupt Priority Control 11) ......................... 101
Real-Time Clock and Calendar................................... 44 IPC15 (Interrupt Priority Control 15) ......................... 102
Registers IPC16 (Interrupt Priority Control 16) ......................... 103
AD1CHS0 (ADC1 Input Channel 0 Select ................ 238 IPC17 (Interrupt Priority Control 17) ......................... 104
AD1CHS123 (ADC1 Input Channel 1, 2, 3 Select) ... 237 IPC2 (Interrupt Priority Control 2) ............................... 93
AD1CON1 (ADC1 Control 1) .................................... 232 IPC3 (Interrupt Priority Control 3) ............................... 94
AD1CON2 (ADC1 Control 2) .................................... 234 IPC4 (Interrupt Priority Control 4) ............................... 95
AD1CON3 (ADC1 Control 3) .................................... 235 IPC5 (Interrupt Priority Control 5) ............................... 96
AD1CON4 (ADC1 Control 4) .................................... 236 IPC6 (Interrupt Priority Control 6) ............................... 97
AD1CSSL (ADC1 Input Scan Select Low)................ 239 IPC7 (Interrupt Priority Control 7) ............................... 98
AD1PCFGL (ADC1 Port Configuration Low) ............ 239 IPC8 (Interrupt Priority Control 8) ............................... 99
CiBUFPNT1 (ECAN Filter 0-3 Buffer Pointer)........... 213 IPC9 (Interrupt Priority Control 9) ............................. 100
CiBUFPNT2 (ECAN Filter 4-7 Buffer Pointer)........... 214 NVMCON (Flash Memory Control)............................. 55
CiBUFPNT3 (ECAN Filter 8-11 Buffer Pointer)......... 214 NVMKEY (Nonvolatile Memory Key) .......................... 56
CiBUFPNT4 (ECAN Filter 12-15 Buffer Pointer)....... 215 OCxCON (Output Compare x Control) ..................... 178
CiCFG1 (ECAN Baud Rate Configuration 1) ............ 211 OSCCON (Oscillator Control)................................... 123
CiCFG2 (ECAN Baud Rate Configuration 2) ............ 212 OSCTUN (FRC Oscillator Tuning)............................ 127
CiCTRL1 (ECAN Control 1) ...................................... 204 PLLFBD (PLL Feedback Divisor) ............................. 126
CiCTRL2 (ECAN Control 2) ...................................... 205 PMD1 (Peripheral Module Disable
CiEC (ECAN Transmit/Receive Error Count)............ 211 Control Register 1) ........................................... 132
CiFCTRL (ECAN FIFO Control)................................ 207 PMD2 (Peripheral Module Disable
CiFEN1 (ECAN Acceptance Filter Enable) ............... 213 Control Register 2) ........................................... 133
CiFIFO (ECAN FIFO Status)..................................... 208 PMD3 (Peripheral Module Disable
CiFMSKSEL1 (ECAN Filter 7-0 Mask Selection)..... 217, Control Register 3) ........................................... 134
218 RCON (Reset Control)................................................ 61
CiINTE (ECAN Interrupt Enable) .............................. 210 SPIxCON1 (SPIx Control 1) ..................................... 182
CiINTF (ECAN Interrupt Flag)................................... 209 SPIxCON2 (SPIx Control 2) ..................................... 184
CiRXFnEID (ECAN Acceptance Filter n SPIxSTAT (SPIx Status and Control) ....................... 181
Extended Identifier)........................................... 217 SR (CPU Status) .................................................. 21, 74
CiRXFnSID (ECAN Acceptance Filter n T1CON (Timer1 Control) .......................................... 163
Standard Identifier) ........................................... 216 TCxCON (Input Capture x Control) .......................... 173
CiRXFUL1 (ECAN Receive Buffer Full 1) ................. 220 TxCON (Type B Time Base Control) ........................ 168
CiRXFUL2 (ECAN Receive Buffer Full 2) ................. 220 TyCON (Type C Time Base Control)........................ 169
CiRXMnEID (ECAN Acceptance Filter Mask n UxMODE (UARTx Mode) ......................................... 195
UxSTA (UARTx Status and Control) ......................... 197 Input Capture (CAPx) ............................................... 314
Reset OC/PWM................................................................... 315
Illegal Opcode ....................................................... 59, 67 Output Compare (OCx)............................................. 314
Trap Conflict.......................................................... 66, 67 Reset, Watchdog Timer, Oscillator Start-up Timer
Uninitialized W Register ........................................ 59, 67 and Power-up Timer ......................................... 310
Reset Sequence.................................................................. 69 Timer1, 2 and 3 External Clock ................................ 312
Resets ................................................................................. 59 Timing Requirements
ADC Conversion (10-bit mode)................................. 353
S ADC Conversion (12-bit Mode)................................. 353
Serial Peripheral Interface (SPI) ....................................... 179 CLKO and I/O ........................................................... 309
Software Reset Instruction (SWR) ...................................... 66 External Clock........................................................... 307
Software Simulator (MPLAB SIM)..................................... 293 Input Capture ............................................................ 314
Software Stack Pointer, Frame Pointer SPIx Master Mode (CKE = 0) ................................... 349
CALLL Stack Frame.................................................... 47 SPIx Module Master Mode (CKE = 1) ...................... 349
Special Features of the CPU............................................. 273 SPIx Module Slave Mode (CKE = 0) ........................ 350
SPI Module SPIx Module Slave Mode (CKE = 1) ........................ 350
SPI1 Register Map ...................................................... 35 Timing Specifications
Symbols Used in Opcode Descriptions............................. 284 10-bit A/D Conversion Requirements ....................... 339
System Control 12-bit A/D Conversion Requirements ....................... 337
Register Map......................................................... 45, 46 CAN I/O Requirements ............................................. 332
I2Cx Bus Data Requirements (Master Mode)........... 329
T I2Cx Bus Data Requirements (Slave Mode)............. 331
Temperature and Voltage Specifications Output Compare Requirements................................ 314
AC ..................................................................... 306, 348 PLL Clock ......................................................... 308, 348
Timer1 ............................................................................... 161 Reset, Watchdog Timer,
Timer2/3 ............................................................................ 165 Oscillator Start-up Timer, Power-up Timer
Timing Characteristics and Brown-out Reset Requirements ................ 311
CLKO and I/O ........................................................... 309 Simple OC/PWM Mode Requirements ..................... 315
Timing Diagrams Timer1 External Clock Requirements ....................... 312
10-bit A/D Conversion (CHPS<1:0> = 01, Timer2 External Clock Requirements ....................... 313
SIMSAM = 0, ASAM = 0, Timer3 External Clock Requirements ....................... 313
SSRC<2:0> = 000) ........................................... 338
10-bit A/D Conversion (CHPS<1:0> = 01, U
SIMSAM = 0, ASAM = 1, SSRC<2:0> = 111, UART Module
SAMC<4:0> = 00001) ....................................... 338 UART1 Register Map............................................ 34, 35
10-bit A/D Conversion (CHPS<1:0> = 01, SIMSAM = 0, Universal Asynchronous Receiver Transmitter (UART) ... 193
ASAM = 1, SSRC<2:0> = 111, Using the RCON Status Bits............................................... 67
SAMC<4:0> = 00001) ....................................... 338
12-bit A/D Conversion V
(ASAM = 0, SSRC<2:0> = 000) ........................ 336 Voltage Regulator (On-Chip) ............................................ 277
Brown-out Situations ................................................... 66
ECAN I/O .................................................................. 332 W
External Clock ........................................................... 307 Watchdog Time-out Reset (WDTR).................................... 66
I2Cx Bus Data (Master Mode) .................................. 328 Watchdog Timer (WDT)............................................ 273, 278
I2Cx Bus Data (Slave Mode) .................................... 330 Programming Considerations ................................... 278
I2Cx Bus Start/Stop Bits (Master Mode) ................... 328 WWW Address ................................................................. 387
I2Cx Bus Start/Stop Bits (Slave Mode) ..................... 330 WWW, On-Line Support ....................................................... 3
READER RESPONSE
It is our intention to provide you with the best documentation possible to ensure successful use of your Microchip
product. If you wish to provide your comments on organization, clarity, subject matter, and ways in which our
documentation can better serve you, please FAX your comments to the Technical Publications Manager at
(480) 792-4150.
Please list the following information, and use this outline to provide us with your comments about this document.
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________ FAX: (______) _________ - _________
Application (optional):
Would you like a reply? Y N
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?
NOTES:
• 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-62076-238-7
QUALITY MANAGEMENT SYSTEM Microchip received ISO/TS-16949:2009 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
CERTIFIED BY DNV 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
== ISO/TS 16949 == 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.