Beruflich Dokumente
Kultur Dokumente
PIC24HJ16GP304
Data Sheet
High-Performance,
16-bit Microcontrollers
Preliminary
DS70289B
Note the following details of the code protection feature on Microchip devices:
Microchip products meet the specification contained in their particular Microchip Data Sheet.
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 Microchips 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 Microchips 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.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron,
dsPIC, KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro,
PICSTART, PRO MATE, rfPIC and SmartShunt are registered
trademarks of Microchip Technology Incorporated in the
U.S.A. and other countries.
FilterLab, Linear Active Thermistor, MXDEV, MXLAB,
SEEVAL, SmartSensor and The Embedded Control Solutions
Company are registered trademarks of Microchip Technology
Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard,
dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN,
ECONOMONITOR, FanSense, In-Circuit Serial
Programming, ICSP, ICEPIC, Mindi, MiWi, MPASM, MPLAB
Certified logo, MPLIB, MPLINK, mTouch, PICkit, PICDEM,
PICDEM.net, PICtail, PIC32 logo, PowerCal, PowerInfo,
PowerMate, PowerTool, REAL ICE, rfLAB, Select Mode, Total
Endurance, UNI/O, WiperLock and ZENA are trademarks of
Microchip Technology Incorporated in the U.S.A. and other
countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
2008, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
DS70289B-page ii
Preliminary
PIC24HJ32GP202/204 AND
PIC24HJ16GP304
High-Performance, 16-bit Microcontrollers
Operating Range:
Digital I/O:
High-Performance CPU:
Interrupt Controller:
5-cycle latency
118 interrupt vectors
Up to 21 available interrupt sources
Up to 3 external interrupts
Seven programmable priority levels
Four processor exceptions
System Management:
Flexible clock options:
- External, crystal, resonator, internal RC
- Fully integrated Phase-Locked Loop (PLL)
- Extremely low jitter PLL
Power-up Timer
Oscillator Start-up Timer/Stabilizer
Watchdog Timer with its own RC oscillator
Fail-Safe Clock Monitor
Reset by multiple sources
Power Management:
On-chip 2.5V voltage regulator
Switch between clock sources in real time
Idle, Sleep and Doze modes with fast wake-up
Timers/Capture/Compare:
Timer/Counters, up to three 16-bit timers:
- Can pair up to make one 32-bit timer
- One timer runs as Real-Time Clock with
external 32.768 kHz oscillator
- Programmable prescaler
Input Capture (up to four channels):
- Capture on up, down or both edges
- 16-bit capture input functions
- 4-deep FIFO on each capture
Output Compare (up to two channels):
- Single or Dual 16-Bit Compare mode
- 16-bit Glitchless PWM Mode
Preliminary
DS70289B-page 3
4-wire SPI
- Framing supports I/O interface to simple
codecs
- Supports 8-bit and 16-bit data
- Supports all serial clock formats and
sampling modes
I2C
- Full Multi-Master Slave mode support
- 7-bit and 10-bit addressing
- Bus collision detection and arbitration
- Integrated signal conditioning
- Slave address masking
UART
- Interrupt on address bit detect
- Interrupt on UART error
- Wake-up on Start bit from Sleep mode
- 4-character TX and RX FIFO buffers
- LIN bus support
- IrDA encoding and decoding in hardware
- High-Speed Baud mode
- Hardware Flow Control with CTS and RTS
DS70289B-page 4
Packaging:
28-pin SDIP/SOIC/QFN-S
44-pin QFN/TQFP
Note:
Preliminary
16-bit Timer
Input Capture
UART
External Interrupts(2)
SPI
I2C
32
16
3(1)
1 ADC,
10 ch
21
SDIP
SOIC
QFN-S
PIC24HJ32GP204
44
32
26
3(1)
1 ADC,
13 ch
35
QFN
TQFP
PIC24HJ16GP304
44
16
26
3(1)
1 ADC,
13 ch
35
QFN
TQFP
Note 1:
2:
Packages
Remappable Pins
28
10-Bit/12-Bit ADC
RAM
PIC24HJ32GP202
Output Compare
Std. PWM
Device
Remappable Peripherals
Pins
TABLE 1:
Preliminary
DS70289B-page 5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
PIC24HFJ32GP202
MCLR
AN0/VREF+/CN2/RA0
AN1/VREF-/CN3/RA1
PGED1/AN2/C2IN-/RP0(1)/CN4/RB0
PGEC1/AN3/C2IN+/RP1(1)/CN5/RB1
AN4/RP2(1)/CN6/RB2
AN5/RP3(1)/CN7/RB3
VSS
OSCI/CLKI/CN30/RA2
OSCO/CLKO/CN29/RA3
SOSCI/RP4(1)/CN1/RB4
SOSCO/T1CK/CN0/RA4
VDD
PGED3/ASDA1/RP5(1)/CN27/RB5
28
27
26
25
24
23
22
21
20
19
18
17
16
15
AVDD
AVSS
AN9/RP15(1)/CN11/RB15
AN10/RP14(1)/CN12/RB14
AN11/RP13(1)/CN13/RB13
AN12/RP12(1)/CN14/RB12
PGEC2/TMS/RP11(1)/CN15/RB11
PGED2/TDI/RP10(1)/CN16 / RB10
VCAP/VDDCORE
VSS
TDO/SDA1/RP9(1)/CN21/RB9
TCK/SCL1/RP8(1)/CN22/RB8
INT0/RP7(1)/CN23/RB7
PGEC3/ASCL1/RP6(1)/CN24/RB6
AN10/RP14(1)/CN12/RB14
AVDD
AVSS
AN9/RP15(1)/CN11/RB15
AN1/VREF-/CN3/RA1
AN0/VREF+/CN2/RA0
MCLR
28-Pin QFN-S
28 27 26 25 24 23 22
PGED1/AN2/C2IN-/RP0(1)/CN4/RB0
PGEC1/AN3/C2IN+/RP1(1)/CN5/RB1
AN4/RP2(1)/CN6/RB2
1
2
3
21
20
PIC24HJ32GP202
AN11/RP13(1)/CN13/RB13
AN12/RP12(1)/CN14/RB12
19
PGEC2/TMS/RP11(1)/CN15/RB11
18
PGED2/TDI/RP10(1)/CN16/RB10
AN5/RP3(1)/CN7/RB3
VSS
4
5
17
VCAP/VDDCORE
OSCI/CLKI/CN30/RA2
OSCO/CLKO/CN29/RA3
16
Vss
15
TDO/SDA1/RP9(1)/CN21/RB9
PGEC3/ASCL1/RP6(1)/CN24/RB6
INT0/RP7(1)/CN23/RB7
TCK/SCL1/RP8(1)/CN22/RB8
PGED3/ASDA1/RP5(1)/CN27/RB5
SOSCI/RP4(1)/CN1/RB4
SOSCO/T1CK/CN0/RA4
VDD
9 10 11 12 13 14
Note 1: The RPn pins can be used by any remappable peripheral. See Table 1 for the list of available
peripherals.
DS70289B-page 6
Preliminary
AN4/RP2(1)/CN6/RB2
AN5/RP3(1)/CN7/RB3
AN6/RP16(1)/CN8/RC0
23
22
21
20
19
18
17
16
15
14
13
12
PGEC1/AN3/C2IN+/RP1(1)/CN5/RB1
PGED1/AN2/C2IN-/RP0(1)/CN4/RB0
AN1/VREF-/CN3/RA1
AN0/VREF+/CN2/RA0
MCLR
AVDD
AVSS
AN9/RP15(1)/CN11/RB15
AN10/RP14(1)/CN12/RB14
TCK/RA7
TMS/RA10
44-Pin QFN
11
AN11/RP13(1)/CN13/RB13
24
10
AN12/RP12(1)/CN14/RB12
25
PGEC2/RP11(1)/CN15/RB11
AN7/RP17(1)/CN9/RC1
AN8/RP18(1)/CN10/RC2
26
PGED2/RP10(1)/CN16/RB10
27
VDD
VSS
OSCI/CLKI/CN30/RA2
OSCO/CLKO/CN29/RA3
28
VCAP/VDDCORE
VSS
PIC24HJ32GP204
PIC24HJ16GP304
6
4
RP25(1)/CN19/RC9
RP24(1)/CN20/RC8
31
RP23(1)/CN17/RC7
TDO/RA8
32
SOSCI/RP4(1)/CN1/RB4
33
RP22(1)/CN18/RC6
SDA1/RP9(1)/CN21/RB9
SOSCO/T1CK/CN0/RA4
TDI/RA9
RP19(1)/CN28/RC3
RP20(1)/CN25/RC4
RP21(1)/CN26/RC5
VSS
VDD
PGED3/ASDA1/RP5(1)/CN27/RB5
PGEC3/ASCL1/RP6(1)/CN24/RB6
INT0/RP7(1)/CN23/RB7
SCL1/RP8(1)/CN22/RB8
34
35
36
37
38
39
40
41
42
43
44
30
29
Note 1: The RPn pins can be used by any remappable peripheral. See Table 1 for the list of available
peripherals.
Preliminary
DS70289B-page 7
PGEC1/AN3/C2IN+/RP1(1)/CN5/RB1
PGED1/AN2/C2IN-/RP0(1)/CN4/RB0
AN1/VREF-/CN3/RA1
AN0/VREF+/CN2/RA0
MCLR
AVDD
AVSS
AN9/RP15(1)/CN11/RB15
AN10/RP14(1)/CN12/RB14
TCK/RA7
TMS/RA10
44-Pin TQFP
12
13
14
15
16
17
18
19
20
21
22
11
10
9
8
7
6
5
4
3
2
1
AN11/RP13(1)/CN13/RB13
AN12/RP12(1)/CN14/RB12
PGEC2/RP11(1)/CN15/RB11
PGED2/RP10(1)/CN16/RB10
VCAP/VDDCORE
VSS
RP25(1)/CN19/RC9
RP24(1)/CN20/RC8
RP23(1)/CN17/RC7
RP22(1)/CN18/RC6
SDA1/RP9(1)/CN21/RB9
38
39
40
41
42
43
44
PIC24HJ32GP204
PIC24HJ16GP304
34
35
36
37
23
24
25
26
27
28
29
30
31
32
33
SOSCO/T1CK/CN0/RA4
TDI/RA9
RP19(1)/CN28/RC3
RP20(1)/CN25/RC4
RP21(1)/CN26/RC5
VSS
VDD
PGED3/ASDA1/RP5(1)/CN27/RB5
PGEC3/ASCL1/RP6(1)/CN24/RB6
INT0/RP7(1)/CN23/RB7
SCL1/RP8(1)/CN22/RB8
AN4/RP2(1)/CN6/RB2
AN5/RP3(1)/CN7/RB3
AN6/RP16(1)/CN8/RC0
AN7/RP17(1)/CN9/RC1
AN8/RP18(1)/CN10/RC2
VDD
VSS
OSCI/CLKI/CN30/RA2
OSCO/CLKO/CN29/RA3
TDO/RA8
SOSCI/RP4(1)/CN1/RB4
Note 1: The RPn pins can be used by any remappable peripheral. See Table 1 for the list of available
peripherals.
DS70289B-page 8
Preliminary
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:
Microchips 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.
Preliminary
DS70289B-page 9
DS70289B-page 10
Preliminary
DEVICE OVERVIEW
This data sheet summarizes the features
of the PIC24HJ32GP202/204 and
PIC24HJ16GP304 devices. It is not
intended to be a comprehensive reference
source. To complement the information in
this data sheet, refer to the PIC24H
Family Reference Manual.
Preliminary
DS70289B-page 11
Interrupt
Controller
16
16
PORTA
16
Data Latch
23
PCU PCH PCL
Program Counter
Loop
Stack
Control
Control
Logic
Logic
23
23
X RAM
PORTB
Address
Latch
16
16
Remappable
Pins
Address Latch
Program Memory
EA MUX
Address Bus
Data Latch
ROM Latch
24
Instruction
Decode and
Control
Instruction Reg
Control Signals
to Various Blocks
OSC2/CLKO
OSC1/CLKI
Timing
Generation
FRC/LPRC
Oscillators
Precision
Band Gap
Reference
Voltage
Regulator
VDDCORE/VCAP
Timers
1-3
IC1,2,7,8
Note:
Literal Data
16
16
16
17 x 17 Multiplier
Power-up
Timer
Divide Support
16 x 16
W Register Array
16
Oscillator
Start-up Timer
Power-on
Reset
16-bit ALU
Watchdog
Timer
16
Brown-out
Reset
VDD, VSS
MCLR
ADC1
OC/
PWM1,2
UART1
CNx
SPI1
I2C1
Not all pins or features are implemented on all device pinout configurations. See pinout diagrams for the specific pins
and features present on each device.
DS70289B-page 12
Preliminary
Buffer
Type
Analog
Description
AN0-AN12
CLKI
CLKO
I
O
ST/CMOS External clock source input. Always associated with OSC1 pin function.
OSC1
OSC2
I/O
SOSCI
SOSCO
I
O
CN0-CN30
ST
IC1-IC2
IC7-IC8
ST
OCFA
OC1-OC2
I
O
ST
INT0
INT1
INT2
I
I
I
ST
ST
ST
External interrupt 0.
External interrupt 1.
External interrupt 2.
RA0-RA4
RA7-RA10
I/O
ST
RB0-RB15
I/O
ST
RC0-RC9
I/O
ST
T1CK
T2CK
T3CK
I
I
I
ST
ST
ST
U1CTS
U1RTS
U1RX
U1TX
I
O
I
O
ST
ST
SCK1
SDI1
SDO1
SS1
I/O
I
O
I/O
ST
ST
ST
SCL1
SDA1
ASCL1
ASDA1
I/O
I/O
I/O
I/O
ST
ST
ST
ST
TMS
TCK
TDI
TDO
I
I
I
O
ST
ST
ST
PGD1/EMUD1
PGC1/EMUC1
PGD2/EMUD2
PGC2/EMUC2
PGD3/EMUD3
PGC3/EMUC3
I/O
I
I/O
I
I/O
I
ST
ST
ST
ST
ST
ST
VDDCORE
VSS
Preliminary
O = Output
P = Power
DS70289B-page 13
Buffer
Type
Description
VREF+
Analog
VREF-
Analog
AVDD
MCLR
I/P
ST
AVSS
VDD
Positive supply for analog modules. This pin must be connected at all
times.
Master Clear (Reset) input. This pin is an active-low Reset to the device.
DS70289B-page 14
Preliminary
O = Output
P = Power
CPU
2.1
2.2
Preliminary
DS70289B-page 15
Interrupt
Controller
8
16
16
16
Data Latch
23
23
16
X RAM
Address
Latch
23
16
Address Generator Units
Address Latch
Program Memory
EA MUX
Address Bus
Data Latch
ROM Latch
24
Control Signals
to Various Blocks
Instruction Reg
Literal Data
Instruction
Decode and
Control
16
16
16
17 x 17
Multiplier
Divide Support
16 x 16
W Register Array
16
16-bit ALU
16
To Peripheral Modules
DS70289B-page 16
Preliminary
D0
W0/WREG
PUSH.S Shadow
W1
DO Shadow
W2
W3
Legend
W4
W5
W6
W7
Working Registers
W8
W9
W10
W11
W12
W13
W14/Frame Pointer
W15/Stack Pointer
SPLIM
PC22
PC0
Program Counter
0
0
7
TBLPAG
0
PSVPAG
0
RCOUNT
15
0
Core Configuration Register
CORCON
SRH
DC
OV
STATUS Register
SRL
Preliminary
DS70289B-page 17
REGISTER 2-1:
U-0
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0
DC
bit 15
bit 8
R/W-0(1)
R/W-0(2)
R/W-0(2)
IPL<2:0>(2)
R-0
R/W-0
R/W-0
R/W-0
R/W-0
RA
OV
bit 7
bit 0
Legend:
C = Clear only bit
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-9
Unimplemented: Read as 0
bit 8
bit 7-5
bit 4
bit 3
bit 2
bit 1
bit 0
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 NSTDIS = 1 (INTCON1<15>).
DS70289B-page 18
Preliminary
U-0
bit 15
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 8
U-0
U-0
R/C-0
IPL3(1)
R/W-0
PSV
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
0 = Bit is cleared
bit 15-4
bit 3
bit 2
bit 1-0
-n = Value at POR
1 = Bit is set
U = Unimplemented bit, read as 0
Unimplemented: Read as 0
IPL3: CPU Interrupt Priority Level Status bit 3(1)
1 = CPU interrupt priority level is greater than 7
0 = CPU interrupt priority level is 7 or less
PSV: Program Space Visibility in Data Space Enable bit
1 = Program space visible in data space
0 = Program space not visible in data space
Unimplemented: Read as 0
Note 1: The IPL3 bit is concatenated with the IPL<2:0> bits (SR<7:5>) to form the CPU interrupt priority level.
Preliminary
DS70289B-page 19
2.4.2
2.4.1
MULTIPLIER
DIVIDER
2.4.3
DS70289B-page 20
Preliminary
MEMORY ORGANIZATION
Note:
3.1
User Program
Flash Memory
(11264 instructions)
PIC24HJ16GP304
GOTO Instruction
Reset Address
Interrupt Vector Table
Reserved
Alternate Vector Table
0x000000
0x000002
0x000004
0x0000FE
0x000100
0x000104
0x0001FE
0x000200
FIGURE 3-1:
0x0057FE
0x005800
Unimplemented
(Read 0s)
User Program
Flash Memory
(5632 instructions)
Reserved
0xF7FFFE
0xF80000
0xF80017
0xF80018
Reserved
0x002BFE
0x002C00
0x7FFFFE
0x800000
Reserved
DEVID (2)
0x0000FE
0x000100
0x000104
0x0001FE
0x000200
Unimplemented
(Read 0s)
0x7FFFFE
0x800000
Device Configuration
Registers
0x000000
0x000002
0x000004
0xFEFFFE
0xFF0000
0xFFFFFE
Device Configuration
Registers
Reserved
DEVID (2)
Preliminary
0xF7FFFE
0xF80000
0xF80017
0xF80018
0xFEFFFE
0xFF0000
0xFFFFFE
DS70289B-page 21
PROGRAM MEMORY
ORGANIZATION
3.1.2
PIC24HJ32GP202/204
and
PIC24HJ16GP304
devices also have two interrupt vector tables, located
from 0x000004 to 0x0000FF and 0x000100 to
0x0001FF. These vector tables allow each of the many
device interrupt sources to be handled by separate
Interrupt Service Routines (ISRs).
Section 6.1
Interrupt Vector Table provides a more detailed
discussion of the interrupt vector tables.
FIGURE 3-2:
msw
Address
16
PC Address
(lsw Address)
0
0x000000
0x000002
0x000004
0x000006
00000000
00000000
00000000
00000000
Program Memory
Phantom Byte
(read as 0)
DS70289B-page 22
0x000001
0x000003
0x000005
0x000007
Instruction Width
Preliminary
3.2.1
3.2.3
3.2.2
SFR SPACE
Note:
3.2.4
Preliminary
DS70289B-page 23
2 Kbyte
SFR Space
LSb
0x0000
0x0001
SFR Space
0x07FE
0x0800
0x07FF
0x0801
X Data RAM (X)
2 Kbyte
SRAM Space
LSB
Address
16 bits
0x0FFF
0x1001
0x0FFE
0x1000
0x1FFF
0x2001
0x1FFE
0x2000
0x8001
0x8000
X Data
Unimplemented (X)
Optionally
Mapped
into Program
Memory
0xFFFF
DS70289B-page 24
8 Kbyte
Near data space
0xFFFE
Preliminary
SFR 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
All
Resets
Preliminary
WREG0
0000
Working Register 0
0000
WREG1
0002
Working Register 1
0000
WREG2
0004
Working Register 2
0000
WREG3
0006
Working Register 3
0000
WREG4
0008
Working Register 4
0000
WREG5
000A
Working Register 5
0000
WREG6
000C
Working Register 6
0000
WREG7
000E
Working Register 7
0000
WREG8
0010
Working Register 8
0000
WREG9
0012
Working Register 9
0000
WREG10
0014
Working Register 10
0000
WREG11
0016
Working Register 11
0000
WREG12
0018
Working Register 12
0000
WREG13
001A
Working Register 13
0000
WREG14
001C
Working Register 14
0000
WREG15
001E
Working Register 15
0800
SPLIM
0020
xxxx
PCL
002E
PCH
0030
0000
TBLPAG
0032
0000
PSVPAG
0034
0000
RCOUNT
0036
SR
0042
DC
IPL2
IPL1
IPL0
RA
OV
0000
CORCON
0044
IPL3
PSV
0000
DISICNT
0052
Legend:
0000
xxxx
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
xxxx
DS70289B-page 25
TABLE 3-1:
SFR
Name
SFR
Addr
Bit 15
Bit 14
CNEN1
0060
CN15IE
CNEN2
0062
CNPU1
0068
CNPU2
006A
Legend:
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
CN14IE
CN13IE
CN30IE
CN29IE
CN12IE
CN11IE
CN7IE
CN27IE
CN24IE
CN23IE
CN7PUE
CN6PUE
CN30PUE CN29PUE
CN27PUE
Bit 8
Bit 7
Bit 6
Bit 0
All
Resets
CN1IE
CN0IE
0000
CN16IE
0000
CN1PUE
CN0PUE
0000
CN16PUE
0000
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
CN6IE
CN5IE
CN4IE
CN3IE
CN2IE
CN22IE
CN21IE
CN5PUE
CN4PUE
CN3PUE
CN2PUE
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
TABLE 3-3:
Preliminary
SFR
Name
SFR
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
All
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
CN6PUE
CN5PUE
CN4PUE
CN3PUE
CN2PUE
CN1PUE
CN0PUE
0000
CN30PUE CN29PUE CN28PUE CN27PUE CN26PUE CN25PUE CN24PUE CN23PUE CN22PUE CN21PUE CN20PUE CN19PUE CN18PUE CN17PUE CN16PUE
0000
CNPU1
0068
CNPU2
006A
Legend:
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
DS70289B-page 26
TABLE 3-2:
SFR
Name
SFR
Addr
Bit 15
INTCON1
0080
INTCON2
0082
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
NSTDIS
DIV0ERR
ALTIVT
DISI
Bit 4
Bit 3
Bit 2
Bit 1
INT2EP
Bit 0
All
Resets
OSCFAIL
0000
INT1EP
INT0EP
0000
Preliminary
IFS0
0084
AD1IF
U1TXIF
U1RXIF
T3IF
T2IF
OC2IF
IC2IF
T1IF
OC1IF
IC1IF
INT0IF
0000
IFS1
0086
INT2IF
IC8IF
IC7IF
INT1IF
CNIF
MI2C1IF
SI2C1IF
0000
IFS4
008C
U1EIF
0000
IEC0
0094
AD1IE
U1TXIE
U1RXIE
T3IE
T2IE
OC2IE
IC2IE
T1IE
OC1IE
IC1IE
INT0IE
0000
IEC1
0096
INT2IE
IC8IE
IC7IE
INT1IE
CNIE
IEC4
009C
IPC0
00A4
IPC1
00A6
IPC2
00A8
IPC3
00AA
IPC4
00AC
CNIP<2:0>
IPC5
00AE
IC8IP<2:0>
IPC7
00B2
INT2IP<2:0>
IPC16
00C4
U1EIP<2:0>
INTTREG
00E0
Legend:
T1IP<2:0>
T2IP<2:0>
U1RXIP<2:0>
SPI1IF SPI1EIF
SPI1IE SPI1EIE
OC1IP<2:0>
OC2IP<2:0>
SPI1IP<2:0>
IC7IP<2:0>
ILR<3:0>
IC1IP<2:0>
IC2IP<2:0>
SPI1EIP<2:0>
AD1IP<2:0>
MI2C1IP<2:0>
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
MI2C1IE SI2C1IE
U1EIE
INT0IP<2:0>
0000
0000
4444
4440
T3IP<2:0>
4444
U1TXIP<2:0>
0044
SI2C1IP<2:0>
4044
INT1IP<2:0>
VECNUM<6:0>
4404
0040
0040
0000
DS70289B-page 27
TABLE 3-4:
SFR Name
SFR
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
All
Resets
TMR1
0100
Timer1 Register
PR1
0102
Period Register 1
T1CON
0104
TMR2
0106
Timer2 Register
xxxx
TMR3HLD
0108
xxxx
TMR3
010A
Timer3 Register
xxxx
PR2
010C
Period Register 2
FFFF
PR3
010E
Period Register 3
T2CON
0110
TON
TSIDL
TGATE
TCKPS<1:0>
T32
TCS
0000
T3CON
0112
TON
TSIDL
TGATE
TCKPS<1:0>
TCS
0000
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
All
Resets
ICI<1:0>
ICOV
ICBNE
ICM<2:0>
ICI<1:0>
ICOV
ICBNE
ICM<2:0>
ICI<1:0>
ICOV
ICBNE
ICM<2:0>
ICI<1:0>
ICOV
ICBNE
ICM<2:0>
Bit 4
Bit 3
Legend:
TSIDL
FFFF
TGATE
Preliminary
SFR Name
IC1BUF
0140
IC1CON
0142
IC2BUF
0144
IC2CON
0146
IC7BUF
0158
IC7CON
015A
IC8BUF
015C
IC8CON
015E
TSYNC
TCS
0000
FFFF
Bit 15
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
ICSIDL
Bit 8
Bit 7
Bit 6
Bit 5
xxxx
ICTMR
0000
ICSIDL
xxxx
ICTMR
0000
ICSIDL
xxxx
ICTMR
0000
ICSIDL
xxxx
ICTMR
0000
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
TABLE 3-7:
SFR
Addr
Bit 15
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
OC1RS
0180
OC1R
0182
OC1CON
0184
OC2RS
0186
OC2R
0188
OC2CON
018A
Legend:
TCKPS<1:0>
SFR
Addr
SFR Name
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
TABLE 3-6:
Legend:
TON
xxxx
OCSIDL
OCSIDL
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
Bit 5
Bit 2
Bit 1
Bit 0
All
Resets
xxxx
xxxx
OCFLT
OCTSEL
OCM<2:0>
0000
xxxx
xxxx
OCFLT
OCTSEL
OCM<2:0>
0000
DS70289B-page 28
TABLE 3-5:
SFR Name
SFR
Addr
Bit 15
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
I2C1RCV
0200
Receive Register
0000
I2C1TRN
0202
Transmit Register
00FF
I2C1BRG
0204
I2C1CON
0206
I2CEN
I2CSIDL
SCLREL
IPMIEN
A10M
DISSLW
SMEN
GCEN
STREN
ACKDT
ACKEN
RCEN
PEN
RSEN
SEN
1000
I2C1STAT
0208
ACKSTAT
TRSTAT
BCL
GCSTAT
ADD10
IWCOL
I2COV
D_A
R_W
RBF
TBF
0000
I2C1ADD
020A
Address Register
0000
I2C1MSK
020C
0000
Legend:
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
TABLE 3-9:
SFR Name
SFR
Addr
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
All
Resets
0000
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
WAKE
LPBACK
Preliminary
Bit 5
Bit 4
Bit 3
ABAUD
URXINV
BRGH
ADDEN
RIDLE
PERR
Bit 2
Bit 1
All
Resets
STSEL
0000
URXDA
0110
U1MODE
0220
UARTEN
USIDL
IREN
RTSMD
UEN1
UEN0
U1STA
0222
UTXISEL1
UTXINV
UTXISEL0
UTXBRK
UTXEN
UTXBF
TRMT
U1TXREG
0224
xxxx
U1RXREG
0226
0000
U1BRG
0228
Legend:
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
TABLE 3-10:
SFR
Name
URXISEL<1:0>
PDSEL<1:0>
Bit 0
FERR
OERR
0000
SFR
Addr
Bit 15
Bit 14
Bit 13
SPI1STAT
0240
SPIEN
SPISIDL
SPI1CON1
0242
DISSCK
DISSDO
MODE16
SMP
SPI1CON2
0244
FRMEN
SPIFSD
FRMPOL
SPI1BUF
0248
Legend:
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
CKE
SSEN
SPIROV
CKP
MSTEN
Bit 3
Bit 2
Bit 1
Bit 0
All
Resets
SPITBF
SPIRBF
0000
SPRE<2:0>
PPRE<1:0>
FRMDLY
0000
0000
0000
DS70289B-page 29
TABLE 3-8:
File
Name
Addr
Bit 15
Bit 14
Bit 13
RPINR0
0680
RPINR1
0682
RPINR3
0686
RPINR7
068E
RPINR10
0694
RPINR11
0696
RPINR18
06A4
RPINR20
06A8
RPINR21
06AA
Legend:
Bit 11
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
All
Resets
1F00
INT2R<4:0>
001F
T3CKR<4:0>
T2CKR<4:0>
1F1F
IC2R<4:0>
IC1R<4:0>
1F1F
IC8R<4:0>
IC7R<4:0>
1F1F
OCFAR<4:0>
001F
U1CTSR<4:0>
U1RXR<4:0>
1F1F
SCK1R<4:0>
SDI1R<4:0>
1F1F
SS1R<4:0>
001F
Bit 10
Bit 9
Bit 8
INT1R<4:0>
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
TABLE 3-12:
Preliminary
File
Name
Bit 12
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
All
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
Legend:
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
DS70289B-page 30
TABLE 3-11:
PERIPHERAL PIN SELECT OUTPUT REGISTER MAP FOR PIC24HJ32GP204 AND PIC24HJ16GP304
File Name
Addr
Bit 15
Bit 14
Bit 13
RPOR0
06C0
RPOR1
06C2
RPOR2
06C4
RPOR3
06C6
RPOR4
06C8
RPOR5
06CA
RPOR6
Bit 11
Bit 10
Bit 9
Bit 8
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
All
Resets
Bit 7
Bit 6
Bit 5
RP1R<4:0>
RP0R<4:0>
0000
RP3R<4:0>
RP2R<4:0>
0000
RP5R<4:0>
RP4R<4:0>
0000
RP7R<4:0>
RP6R<4:0>
0000
RP9R<4:0>
RP8R<4:0>
0000
RP11R<4:0>
RP10R<4:0>
0000
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
RPOR10
06D4
RP21R<4:0>
RP20R<4:0>
0000
RPOR11
06D6
RP23R<4:0>
RP22R<4:0>
0000
RPOR12
06D8
RP25R<4:0>
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
RP24R<4:0>
0000
Legend:
Bit 12
Preliminary
DS70289B-page 31
TABLE 3-13:
Bit 14
Bit 13
Bit 12
Preliminary
Addr
ADC1BUF0
0300
xxxx
ADC1BUF1
0302
xxxx
ADC1BUF2
0304
xxxx
ADC1BUF3
0306
xxxx
ADC1BUF4
0308
xxxx
ADC1BUF5
030A
xxxx
ADC1BUF6
030C
xxxx
ADC1BUF7
030E
xxxx
ADC1BUF8
0310
xxxx
ADC1BUF9
0312
xxxx
ADC1BUFA
0314
xxxx
ADC1BUFB
0316
xxxx
ADC1BUFC
0318
xxxx
ADC1BUFD
031A
xxxx
ADC1BUFE
031C
xxxx
ADC1BUFE
031E
AD1CON1
0320
AD1CON2
0322
AD1CON3
0324
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
AD1CHS123
AD1CHS0
ADSIDL
VCFG<2:0>
AD12B
FORM<1:0>
CSCNA
CHPS<1:0>
ADRC
0326
0328
CH0NB
AD1PCFGL
032C
PCFG12
AD1CSSL
0330
CSS12
Legend:
Bit 11
All
Resets
File Name
xxxx
SSRC<2:0>
BUFS
CH123NB<1:0>
CSS11
CSS10
SAMP
DONE
BUFM
ALTS
ADCS<7:0>
CH123SB
CH0SB<4:0>
PCFG11 PCFG10
ASAM
SMPI<3:0>
SAMC<4:0>
SIMSAM
CH0NA
0000
0000
0000
CH123NA<1:0>
CH123SA
CH0SA<4:0>
0000
0000
PCFG9
PCFG8
PCFG7
PCFG6
PCFG5
PCFG4
PCFG3
PCFG2
PCFG1
PCFG0
0000
CSS9
CSS8
CSS7
CSS6
CSS5
CSS4
CSS3
CSS2
CSS1
CSS0
0000
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
DS70289B-page 32
TABLE 3-14:
Preliminary
Addr
ADC1BUF0
0300
xxxx
ADC1BUF1
0302
xxxx
ADC1BUF2
0304
xxxx
ADC1BUF3
0306
xxxx
ADC1BUF4
0308
xxxx
ADC1BUF5
030A
xxxx
ADC1BUF6
030C
xxxx
ADC1BUF7
030E
xxxx
ADC1BUF8
0310
xxxx
ADC1BUF9
0312
xxxx
ADC1BUFA
0314
xxxx
ADC1BUFB
0316
xxxx
ADC1BUFC
0318
xxxx
ADC1BUFD
031A
xxxx
ADC1BUFE
031C
xxxx
ADC1BUFF
031E
xxxx
Bit 13
AD1CON1
0320
AD1CON2
0322
AD1CON3
0324
ADRC
AD1CHS123
0326
AD1CHS0
0328
CH0NB
AD1PCFGL
032C
0330
AD1CSSL
Legend:
ADON
Bit 14
ADSIDL
VCFG<2:0>
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
AD12B
FORM<1:0>
CSCNA
CHPS<1:0>
Bit 7
Bit 6
Bit 5
SSRC<2:0>
BUFS
CSS11
CSS10
SIMSAM
Bit 2
Bit 1
ASAM
Bit 0
SAMP
DONE
0000
BUFM
ALTS
0000
CH123SA
0000
ADCS<7:0>
CH123NB<1:0>
CH123SB
CH0SB<4:0>
CSS12
Bit 3
SMPI<3:0>
SAMC<4:0>
Bit 4
All
Resets
File Name
0000
CH123NA<1:0>
CH0NA
PCFG9
PCFG5
PCFG4
PCFG3
PCFG2
PCFG1
PCFG0
0000
CSS9
CSS5
CSS4
CSS3
CSS2
CSS1
CSS0
0000
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
CH0SA<4:0>
0000
DS70289B-page 33
TABLE 3-15:
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
All
Resets
TRISA
02C0
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
001F
PORTA
02C2
RA4
RA3
RA2
RA1
RA0
xxxx
LATA
02C4
LATA4
LATA3
LATA2
LATA1
LATA0
xxxx
ODCA
02C6
ODCA4
ODCA3
ODCA2
ODCA1
ODCA0
xxxx
Legend:
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
TABLE 3-17:
Preliminary
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
All
Resets
TRISA
02C0
TRISA10
TRISA9
TRISA8
TRISA7
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
079F
PORTA
02C2
RA10
RA9
RA8
RA7
RA4
RA3
RA2
RA1
RA0
xxxx
LATA
02C4
LATA10
LATA9
LATA8
LATA7
LATA4
LATA3
LATA2
LATA1
LATA0
xxxx
ODCA
02C6
ODCA10
ODCA9
ODCA8
ODCA7
ODCA4
ODCA3
ODCA2
ODCA1
ODCA0
xxxx
Legend:
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
TABLE 3-18:
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
All
Resets
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
ODCB15
ODCB14
ODCB13
ODCB12
ODCB11
ODCB10
ODCB9
ODCB8
ODCB7
ODCB6
ODCB5
ODCB4
ODCB3
ODCB2
ODCB1
ODCB0
xxxx
Legend:
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal for PinHigh devices.
File Name
TABLE 3-19:
2008 Microchip Technology Inc.
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
All
Resets
TRISC
02D0
TRISC9
TRISC8
TRISC7
TRISC6
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
03FF
PORTC
02D2
RC9
RC8
RC7
RC6
RC5
RC4
RC4
RC2
RC1
RC0
xxxx
LATC
02D4
LATC9
LATC8
LATC7
LATC6
LATC5
LATC4
LATC4
LATC2
LATC1
LATC0
xxxx
02D6
ODCC9
ODCC8
ODCC7
ODCC6
ODCC5
ODCC4
ODCC4
ODCC2
ODCC1
ODCC0
xxxx
ODCC
Legend:
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
DS70289B-page 34
TABLE 3-16:
File Name
Addr
Bit 15
Bit 14
RCON
0740
TRAPR
IOPUWR
OSCCON
0742
CLKDIV
0744
ROI
PLLFBD
0746
OSCTUN
0748
Legend:
Note 1:
2:
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
RCON register Reset values dependent on type of Reset.
OSCCON register Reset values dependent on the FOSC Configuration bits and by type of Reset.
TABLE 3-21:
Bit 13
Bit 12
COSC<2:0>
Bit 11
Bit 10
DOZE<2:0>
DOZEN
Bit 9
Bit 8
CM
VREGS
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
EXTR
SWR
SWDTEN
WDTO
SLEEP
IDLE
BOR
POR
xxxx(1)
LOCK
CF
LPOSCEN
OSWEN
0300(2)
FRCDIV<2:0>
PLLPOST<1:0>
PLLPRE<4:0>
3040
PLLDIV<8:0>
0030
TUN<5:0>
0000
Preliminary
Bit 15
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
NVMCON
0760
WR
WREN
WRERR
ERASE
0766
Bit 3
Bit 2
Bit 1
Bit 0
All
Resets
0000(1)
NVMOP<3:0>
NVMKEY<7:0>
0000
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
Reset value shown is for POR only. Value on other Reset states is dependent on the state of memory write or erase operations at the time of Reset.
TABLE 3-22:
All
Resets
AD1MD
0000
OC2MD
OC1MD
0000
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
PMD1
0770
T3MD
T2MD
T1MD
I2C1MD
U1MD
SPI1MD
PMD2
0772
IC8MD
IC7MD
IC2MD
IC1MD
Legend:
All
Resets
CLKLOCK IOLOCK
Addr
Legend:
Note 1:
Bit 0
NOSC<2:0>
File Name
NVMKEY
Bit 1
x = unknown value on Reset, = unimplemented, read as 0. Reset values are shown in hexadecimal.
DS70289B-page 35
TABLE 3-20:
3.2.6
SOFTWARE STACK
FIGURE 3-4:
0x0000
15
DS70289B-page 36
3.3
3.3.1
3.3.2
MCU INSTRUCTIONS
PC<15:0>
000000000 PC<22:16>
<Free Word>
Register Direct
Register Indirect
Register Indirect Post-Modified
Register Indirect Pre-Modified
5-bit or 10-bit Literal
Note:
Preliminary
Addressing Mode
File Register Direct
Description
The address of the file register is specified explicitly.
Register Direct
Register Indirect
Register Indirect with Register Offset The sum of Wn and Wb forms the EA.
(Register Indexed)
Register Indirect with Literal Offset
3.3.3
Register Direct
Register Indirect
Register Indirect Post-modified
Register Indirect Pre-modified
Register Indirect with Register Offset (Indexed)
Register Indirect with Literal Offset
8-bit Literal
16-bit Literal
Note:
3.3.4
OTHER INSTRUCTIONS
Preliminary
DS70289B-page 37
3.4.1
Aside
from
normal
execution,
the
PIC24HJ32GP202/204
and
PIC24HJ16GP304
architecture provides two methods by which program
space can be accessed during operation:
Using table instructions to access individual bytes
or words anywhere in the program space
Remapping a portion of the program space into
the data space (Program Space Visibility)
TABLE 3-24:
Access Type
<22:16>
<15>
<14:1>
Instruction Access
(Code Execution)
User
TBLRD/TBLWT
(Byte/Word Read/Write)
User
TBLPAG<7:0>
Configuration
TBLPAG<7:0>
Data EA<15:0>
1xxx xxxx
PC<22:1>
0
0xx
xxxx
0xxx xxxx
User
xxxx
<0>
0
xxxx
xxxx xxx0
Data EA<15:0>
xxxx xxxx xxxx xxxx
PSVPAG<7:0>
xxxx xxxx
Data EA<14:0>(1)
xxx xxxx xxxx xxxx
Data EA<15> is always 1 in this case, but is not used in calculating the program space address. Bit 15 of
the address is PSVPAG<0>.
DS70289B-page 38
Preliminary
Program Counter(1)
Program Counter
23 bits
EA
Table Operations(2)
1/0
1/0
TBLPAG
8 bits
16 bits
24 bits
Select
Program Space Visibility(1)
(Remapping)
EA
PSVPAG
8 bits
15 bits
23 bits
User/Configuration
Space Select
Byte Select
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.
Preliminary
DS70289B-page 39
FIGURE 3-6:
TBLPAG
02
23
15
0x000000
23
16
00000000
0x020000
0x030000
00000000
00000000
00000000
Phantom Byte
TBLRDH.B (Wn<0> = 0)
TBLRDL.B (Wn<0> = 1)
TBLRDL.B (Wn<0> = 0)
TBLRDL.W
0x800000
DS70289B-page 40
Preliminary
FIGURE 3-7:
Program Space
PSVPAG
02
23
15
Data Space
0
0x000000
0x0000
Data EA<14:0>
0x010000
0x018000
The data in the page
designated by
PSVPAG is mapped
into the upper half of
the data memory
space...
0x8000
PSV Area
0x800000
Preliminary
DS70289B-page 41
DS70289B-page 42
Preliminary
4.1
FIGURE 4-1:
Program Counter
Working Reg EA
Using
Table Instruction
1/0
TBLPAG Reg
8 bits
User/Configuration
Space Select
16 bits
24-bit EA
Preliminary
Byte
Select
DS70289B-page 43
RTSP Operation
4.3
Programming Operations
EQUATION 4-1:
PROGRAMMING TIME
T
------------------------------------------------------------------------------------------------------------------------7.37 MHz ( FRC Accuracy )% ( FRC Tuning )%
For example, if the device is operating at +125C, the
FRC accuracy will be 5%. If the TUN<5:0> bits (see
Register 7-4) are set to b111111, the Minimum Row
Write Time is:
11064 Cycles
T RW = ---------------------------------------------------------------------------------------------- = 1.435ms
7.37 MHz ( 1 + 0.05 ) ( 1 0.00375 )
and, the Maximum Row Write Time is:
11064 Cycles
T RW = ---------------------------------------------------------------------------------------------- = 1.586ms
7.37 MHz ( 1 0.05 ) ( 1 0.00375 )
Setting the WR bit (NVMCON<15>) starts the
operaion, and the WR bit is automatically cleared when
the operation is finished.
4.4
Control Registers
DS70289B-page 44
Preliminary
R/SO-0(1)
R/W-0(1)
R/W-0(1)
U-0
U-0
U-0
U-0
U-0
WR
WREN
WRERR
bit 15
bit 8
R/W-0(1)
U-0
ERASE
U-0
U-0
R/W-0(1)
R/W-0(1)
R/W-0(1)
R/W-0(1)
(2)
NVMOP<3:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15
bit 14
bit 13
bit 12-7
Unimplemented: Read as 0
bit 6
bit 5-4
Unimplemented: Read as 0
bit 3-0
Preliminary
DS70289B-page 45
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 15
bit 8
W-0
W-0
W-0
W-0
W-0
W-0
W-0
W-0
NVMKEY<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-8
Unimplemented: Read as 0
bit 7-0
DS70289B-page 46
Preliminary
x = Bit is unknown
4.
5.
EXAMPLE 4-1:
6.
#0x55, W0
W0, NVMKEY
#0xAA, W1
W1, NVMKEY
NVMCON, #WR
;
; Initialize NVMCON
;
;
;
;
;
;
;
;
;
;
;
;
Preliminary
DS70289B-page 47
; 63rd_program_word
MOV
#LOW_WORD_31, W2
;
MOV
#HIGH_BYTE_31, W3
;
TBLWTL W2, [W0]
; Write PM low word into program latch
TBLWTH W3, [W0++]
; Write PM high byte into program latch
EXAMPLE 4-3:
DISI
#5
MOV
MOV
MOV
MOV
BSET
NOP
NOP
#0x55, W0
W0, NVMKEY
#0xAA, W1
W1, NVMKEY
NVMCON, #WR
DS70289B-page 48
Preliminary
RESETS
FIGURE 5-1:
VDD
BOR
Internal
Regulator
SYSRST
VDD Rise
Detect
POR
Trap Conflict
Illegal Opcode
Uninitialized W Register
Configuration Mismatch
Preliminary
DS70289B-page 49
REGISTER 5-1:
R/W-0
R/W-0
U-0
U-0
U-0
U-0
R/W-0
R/W-0
TRAPR
IOPUWR
CM
VREGS
bit 15
bit 8
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-1
R/W-1
EXTR
SWR
SWDTEN(2)
WDTO
SLEEP
IDLE
BOR
POR
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15
bit 14
bit 13-10
Unimplemented: Read as 0
bit 9
bit 8
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
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.
DS70289B-page 50
Preliminary
bit 1
bit 0
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.
Preliminary
DS70289B-page 51
System Reset
2.
3.
4.
5.
TABLE 5-1:
6.
OSCILLATOR DELAY
Oscillator
Start-up Delay
Oscillator Start-up
Timer
Total Delay
FRC, FRCDIV16,
FRCDIVN
TOSCD
TOSCD
FRCPLL
TOSCD
TLOCK
TOSCD + TLOCK
XT
TOSCD
TOST
TOSCD + TOST
HS
TOSCD
TOST
TOSCD + TOST
EC
XTPLL
TOSCD
TOST
TLOCK
HSPLL
TOSCD
TOST
TLOCK
Oscillator Mode
ECPLL
TLOCK
TLOCK
SOSC
TOSCD
TOST
TOSCD + TOST
TOSCD
TOSCD
LPRC
Note 1:
2:
3:
TOSCD = Oscillator Start-up Delay (1.1 s max for FRC, 70 s max for LPRC). Crystal Oscillator start-up
times vary with crystal characteristics, load capacitance, etc.
TOST = Oscillator Start-up Timer Delay (1024 oscillator clock period). For example, TOST = 102.4 s for a
10 MHz crystal and TOST = 32 ms for a 32 kHz crystal.
TLOCK = PLL lock time (1.5 ms nominal), if PLL is enabled.
DS70289B-page 52
Preliminary
VDD
TPOR
POR Reset
BOR Reset
TBOR
2
3
TPWRT
SYSRST
Oscillator Clock
TOSCD
TOST
TLOCK
6
TFSCM
FSCM
5
Reset
Device Status
Run
Time
Note 1:
POR Reset: 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 Reset: 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 5-1. Refer to Section 7.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.
Preliminary
DS70289B-page 53
OSCILLATOR DELAY
Symbol
Parameter
Value
VPOR
POR threshold
1.8V nominal
TPOR
30 s maximum
VBOR
BOR threshold
2.5V nominal
TBOR
100 s maximum
TPWRT
0-128 ms nominal
TFSCM
900 s maximum
Note:
5.2
When the device exits the Reset condition (begins normal operation), the
device operating parameters (voltage,
frequency, temperature, etc.) must be
within their operating ranges, otherwise
the device may not function correctly.
The user application must ensure that
the delay between the time power is
first applied, and the time SYSRST
becomes inactive, is long enough to get
all
operating
parameters
within
specification.
DS70289B-page 54
5.2.1
Preliminary
BROWN-OUT SITUATIONS
VDD
VBOR
TBOR + TPWRT
SYSRST
VDD
VBOR
TBOR + TPWRT
SYSRST
VDD dips before PWRT expires
VDD
VBOR
TBOR + TPWRT
SYSRST
5.3
5.3.1
5.3.2
5.4
5.5
5.6
Preliminary
DS70289B-page 55
5.8.2
5.8
5.8.3
5.9
Note:
TABLE 5-3:
SECURITY RESET
5.8.1
UNINITIALIZED W REGISTER
RESET
Set by:
Cleared by:
TRAPR (RCON<15>)
POR,BOR
IOPWR (RCON<14>)
POR,BOR
CM (RCON<9>)
Configuration Mismatch
POR,BOR
EXTR (RCON<7>)
MCLR Reset
POR
SWR (RCON<6>)
RESET instruction
POR,BOR
WDTO (RCON<4>)
WDT time-out
PWRSAV instruction,
CLRWDT instruction, POR,BOR
SLEEP (RCON<3>)
POR,BOR
IDLE (RCON<2>)
POR,BOR
BOR (RCON<1>)
POR, BOR
POR (RCON<0>)
POR
Note:
DS70289B-page 56
Preliminary
INTERRUPT CONTROLLER
6.1.1
6.2
Reset Sequence
6.1
Preliminary
DS70289B-page 57
FIGURE 6-1:
0x000000
0x000002
0x000004
0x000014
0x00007C
0x00007E
0x000080
0x0000FC
0x0000FE
0x000100
0x000102
0x000114
0x0001FE
0x000200
Note 1: See Table 6-1 for the list of implemented interrupt vectors.
DS70289B-page 58
Preliminary
INTERRUPT VECTORS
Vector
Number
Interrupt
Request (IRQ)
Number
IVT Address
AIVT Address
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
0x000014
0x000016
0x000018
0x00001A
0x00001C
0x00001E
0x000020
0x000022
0x000024
0x000026
0x000028
0x00002A
0x00002C
0x00002E
0x000030
0x000032
0x000034
0x000036
0x000038
0x00003A
0x00003C
0x00003E
0x000040
0x000042
0x000044
0x000046
0x000048
0x00004A
0x00004C
0x00004E
0x000050
0x000052
0x000054
0x000056
0x000058
0x00005A
0x00005C
0x00005E
0x000060
0x000062
0x000064
0x000066
0x000068
0x00006A
0x00006C
0x00006E
0x000114
0x000116
0x000118
0x00011A
0x00011C
0x00011E
0x000120
0x000122
0x000124
0x000126
0x000128
0x00012A
0x00012C
0x00012E
0x000130
0x000132
0x000134
0x000136
0x000138
0x00013A
0x00013C
0x00013E
0x000140
0x000142
0x000144
0x000146
0x000148
0x00014A
0x00014C
0x00014E
0x000150
0x000152
0x000154
0x000156
0x000158
0x00015A
0x00015C
0x00015E
0x000160
0x000162
0x000164
0x000166
0x000168
0x00016A
0x00016C
0x00016E
Preliminary
Interrupt Source
INT0 External Interrupt 0
IC1 Input Compare 1
OC1 Output Compare 1
T1 Timer1
Reserved
IC2 Input Capture 2
OC2 Output Compare 2
T2 Timer2
T3 Timer3
SPI1E SPI1 Error
SPI1 SPI1 Transfer Done
U1RX UART1 Receiver
U1TX UART1 Transmitter
ADC1 ADC1
Reserved
Reserved
SI2C1 I2C1 Slave Events
MI2C1 I2C1 Master Events
Reserved
Change Notification Interrupt
INT1 External Interrupt 1
Reserved
IC7 Input Capture 7
IC8 Input Capture 8
Reserved
Reserved
Reserved
Reserved
Reserved
INT2 External Interrupt 2
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
DS70289B-page 59
Vector
Number
Interrupt
Request (IRQ)
Number
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80-125
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72-117
TABLE 6-2:
IVT Address
AIVT Address
Interrupt Source
0x000070
0x000170
0x000072
0x000172
0x000074
0x000174
0x000076
0x000176
0x000078
0x000178
0x00007A
0x00017A
0x00007C
0x00017C
0x00007E
0x00017E
0x000080
0x000180
0x000082
0x000182
0x000084
0x000184
0x000086
0x000186
0x000088
0x000188
0x00008A
0x00018A
0x00008C
0x00018C
0x00008E
0x00018E
0x000090
0x000190
0x000092
0x000192
0x000094
0x000194
0x000096
0x000196
0x000098
0x000198
0x00009A
0x00019A
0x00009C
0x00019C
0x00009E
0x00019E
0x0000A0
0x0001A0
0x0000A2
0x0001A2
0x0000A4-0x0000 0x0001A4-0x0001
FE
FE
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
U1E UART1 Error
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
TRAP VECTORS
Vector Number
IVT Address
AIVT Address
Trap Source
0x000004
0x000104
Reserved
0x000006
0x000106
Oscillator Failure
0x000008
0x000108
Address Error
0x00000A
0x00010A
Stack Error
0x00000C
0x00010C
Math Error
0x00000E
0x00010E
Reserved
0x000010
0x000110
Reserved
0x000012
0x000112
Reserved
DS70289B-page 60
Preliminary
6.3.4
PIC24HJ32GP202/204
and
PIC24HJ16GP304
devices implement a total of 17 registers for the
interrupt controller:
6.3.1
6.3.2
IFSx
6.3.3
IECx
IPCx
6.3.5
INTTREG
6.3.6
STATUS REGISTERS
Preliminary
DS70289B-page 61
U-0
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0
DC
bit 15
bit 8
R/W-0(3)
R/W-0(3)
IPL2(2)
(2)
IPL1
R/W-0(3)
R-0
R/W-0
R/W-0
R/W-0
R/W-0
IPL0(2)
RA
OV
bit 7
bit 0
Legend:
C = Clear only bit
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 7-5
Note 1: For complete register details, see Register 2-1: SR: CPU STATUS Register.
2: 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.
3: The IPL<2:0> Status bits are read-only when NSTDIS (INTCON1<15>) = 1.
DS70289B-page 62
Preliminary
U-0
bit 15
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 8
U-0
U-0
R/C-0
IPL3(2)
R/W-0
PSV
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
0 = Bit is cleared
bit 3
-n = Value at POR
1 = Bit is set
U = Unimplemented bit, read as 0
Note 1: For complete register details, see Register 2-2: CORCON: CORE Control Register.
2: The IPL3 bit is concatenated with the IPL<2:0> bits (SR<7:5>) to form the CPU Interrupt Priority Level.
Preliminary
DS70289B-page 63
R/W-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
NSTDIS
bit 15
bit 8
U-0
R/W-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
U-0
DIV0ERR
MATHERR
ADDRERR
STKERR
OSCFAIL
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15
bit 14-7
Unimplemented: Read as 0
bit 6
bit 5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
bit 1
bit 0
Unimplemented: Read as 0
DS70289B-page 64
Preliminary
x = Bit is unknown
R/W-0
R-0
U-0
U-0
U-0
U-0
U-0
U-0
ALTIVT
DISI
bit 15
bit 8
U-0
U-0
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
INT2EP
INT1EP
INT0EP
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15
bit 14
bit 13-3
Unimplemented: Read as 0
bit 2
bit 1
bit 0
Preliminary
x = Bit is unknown
DS70289B-page 65
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
AD1IF
U1TXIF
U1RXIF
SPI1IF
SPI1EIF
T3IF
bit 15
bit 8
R/W-0
R/W-0
R/W-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
T2IF
OC2IF
IC2IF
T1IF
OC1IF
IC1IF
INT0IF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-4
Unimplemented: Read as 0
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
bit 7
bit 6
bit 5
bit 4
Unimplemented: Read as 0
bit 3
bit 2
DS70289B-page 66
Preliminary
x = Bit is unknown
bit 1
bit 0
Preliminary
DS70289B-page 67
U-0
U-0
R/W-0
U-0
U-0
U-0
U-0
U-0
INT2IF
bit 15
bit 8
R/W-0
R/W-0
U-0
R/W-0
R/W-0
U-0
R/W-0
R/W-0
IC8IF
IC7IF
INT1IF
CNIF
MI2C1IF
SI2C1IF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-4
Unimplemented: Read as 0
bit 13
bit 12-8
Unimplemented: Read as 0
bit 7
bit 6
bit 5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
DS70289B-page 68
Preliminary
x = Bit is unknown
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 15
bit 8
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U1EIF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-2
Unimplemented: Read as 0
bit 1
bit 0
Unimplemented: Read as 0
Preliminary
x = Bit is unknown
DS70289B-page 69
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
AD1IE
U1TXIE
U1RXIE
SPI1IE
SPI1EIE
T3IE
bit 15
bit 8
R/W-0
R/W-0
R/W-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
T2IE
OC2IE
IC2IE
T1IE
OC1IE
IC1IE
INT0IE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-4
Unimplemented: Read as 0
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
bit 7
bit 6
bit 5
bit 4
Unimplemented: Read as 0
bit 3
bit 2
DS70289B-page 70
Preliminary
x = Bit is unknown
bit 1
bit 0
Preliminary
DS70289B-page 71
U-0
U-0
R/W-0
U-0
U-0
U-0
U-0
U-0
INT2IE
bit 15
bit 8
R/W-0
R/W-0
U-0
R/W-0
R/W-0
U-0
R/W-0
R/W-0
IC8IE
IC7IE
INT1IE
CNIE
MI2C1IE
SI2C1IE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-14
Unimplemented: Read as 0
bit 13
bit 12-8
Unimplemented: Read as 0
bit 7
bit 6
bit 5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
DS70289B-page 72
Preliminary
x = Bit is unknown
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 15
bit 8
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0
U-0
U1EIE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-2
Unimplemented: Read as 0
bit 1
bit 0
Unimplemented: Read as 0
Preliminary
x = Bit is unknown
DS70289B-page 73
R/W-0
R/W-0
T1IP<2:0>
U-0
R/W-1
R/W-0
R/W-0
OC1IP<2:0>
bit 15
bit 8
U-0
R/W-1
R/W-0
IC1IP<2:0>
R/W-0
U-0
R/W-1
R/W-0
R/W-0
INT0IP<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15
Unimplemented: Read as 0
bit 14-12
bit 11
Unimplemented: Read as 0
bit 10-8
bit 7
Unimplemented: Read as 0
bit 6-4
bit 3
Unimplemented: Read as 0
bit 2-0
DS70289B-page 74
Preliminary
x = Bit is unknown
R/W-0
R/W-0
T2IP<2:0>
U-0
R/W-1
R/W-0
R/W-0
OC2IP<2:0>
bit 15
bit 8
U-0
R/W-1
R/W-0
IC2IP<2:0>
R/W-0
U-0
U-0
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15
Unimplemented: Read as 0
bit 14-12
bit 11
Unimplemented: Read as 0
bit 10-8
bit 7
Unimplemented: Read as 0
bit 6-4
bit 3-0
Unimplemented: Read as 0
Preliminary
x = Bit is unknown
DS70289B-page 75
R/W-0
R/W-0
U1RXIP<2:0>
U-0
R/W-1
R/W-0
R/W-0
SPI1IP<2:0>
bit 15
bit 8
U-0
R/W-1
R/W-0
SPI1EIP<2:0>
R/W-0
U-0
R/W-1
R/W-0
R/W-0
T3IP<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15
Unimplemented: Read as 0
bit 14-12
bit 11
Unimplemented: Read as 0
bit 10-8
bit 7
Unimplemented: Read as 0
bit 6-4
bit 3
Unimplemented: Read as 0
bit 2-0
DS70289B-page 76
Preliminary
x = Bit is unknown
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 15
bit 8
U-0
R/W-1
R/W-0
AD1IP<2:0>
R/W-0
U-0
R/W-1
R/W-0
R/W-0
U1TXIP<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-7
Unimplemented: Read as 0
bit 6-4
bit 3
Unimplemented: Read as 0
bit 2-0
Preliminary
x = Bit is unknown
DS70289B-page 77
R/W-0
R/W-0
CNIP<2:0>
U-0
U-0
U-0
U-0
bit 15
bit 8
U-0
R/W-1
R/W-0
MI2C1IP<2:0>
R/W-0
U-0
R/W-1
R/W-0
R/W-0
SI2C1IP<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15
Unimplemented: Read as 0
bit 14-12
bit 11-7
Unimplemented: Read as 0
bit 6-4
bit 3
Unimplemented: Read as 0
bit 2-0
DS70289B-page 78
Preliminary
x = Bit is unknown
R/W-0
R/W-0
IC8IP<2:0>
U-0
R/W-1
R/W-0
R/W-0
IC7IP<2:0>
bit 15
bit 8
U-0
U-0
U-0
U-0
U-0
R/W-1
R/W-0
R/W-0
INT1IP<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15
Unimplemented: Read as 0
bit 14-12
bit 11
Unimplemented: Read as 0
bit 10-8
bit 7-3
Unimplemented: Read as 0
bit 2-0
Preliminary
x = Bit is unknown
DS70289B-page 79
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 15
bit 8
U-0
R/W-1
R/W-0
INT2IP<2:0>
R/W-0
U-0
U-0
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-7
Unimplemented: Read as 0
bit 6-4
bit 3-0
Unimplemented: Read as 0
DS70289B-page 80
Preliminary
x = Bit is unknown
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 15
bit 8
U-0
R/W-1
R/W-0
U1EIP<2:0>
R/W-0
U-0
U-0
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-7
Unimplemented: Read as 0
bit 6-4
bit 3-0
Unimplemented: Read as 0
Preliminary
x = Bit is unknown
DS70289B-page 81
U-0
U-0
U-0
U-0
R-0
R-0
R-0
R-0
ILR<3:0>
bit 15
bit 8
U-0
R-0
R-0
R-0
R-0
R-0
R-0
R-0
VECNUM<6:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-12
Unimplemented: Read as 0
bit 11-8
bit 7
Unimplemented: Read as 0
bit 6-0
DS70289B-page 82
Preliminary
x = Bit is unknown
6.4.1
6.4.3
INITIALIZATION
3.
4.
6.4.2
6.4.4
INTERRUPT DISABLE
2.
the
the
the
the
Preliminary
DS70289B-page 83
DS70289B-page 84
Preliminary
OSCILLATOR CONFIGURATION
Note:
FIGURE 7-1:
S3
OSCI
PLL(1)
S1
XTPLL, HSPLL,
ECPLL, FRCPLL
DOZE<2:0>
S2
FCY
DOZE
XT, HS, EC
OSCO
S1/S3
FOSC
FRCDIV
FRC
Oscillator
FRCDIVN
S7
FRCDIV<2:0>
TUN<5:0>
16
FRCDIV16
S6
FRC
S0
LPRC
LPRC
Oscillator
Secondary Oscillator
SOSC
SOSCO
S5
S4
LPOSCEN
SOSCI
Clock Fail
S7
Clock Switch
Reset
NOSC<2:0> FNOSC<2:0>
WDT, PWRT,
FSCM
Timer1
Note 1:
Preliminary
DS70289B-page 85
7.1.2
7.1.1
7.1.1.1
Fast RC
Primary
7.1.1.3
Secondary
7.1.1.4
Low-Power RC
7.1.1.5
FRC
DS70289B-page 86
7.1.1.2
EQUATION 7-1:
DEVICE OPERATING
FREQUENCY
FCY = FOSC/2
7.1.3
PLL CONFIGURATION
Preliminary
EQUATION 7-2:
FOSC CALCULATION
M
( N1*N2
)
FOSC = FIN*
EQUATION 7-3:
FIGURE 7-2:
FCY =
FOSC 1 10000000*32
=
= 40 MIPS
2
2
2*2
PLLPRE
100-200 MHz
Here
VCO
12.5-80 MHz
Here
FOSC
PLLPOST
PLLDIV
Divide by
2-33
Divide by
2-513
TABLE 7-1:
Divide by
2, 4, 8
Oscillator Mode
Oscillator Source
POSCMD<1:0>
FNOSC<2:0>
Note
Internal
xx
111
1, 2
Internal
xx
110
Internal
xx
101
Secondary
xx
100
Primary
10
011
Primary
01
011
Primary
00
011
Primary
10
010
Primary
01
010
Primary
00
010
Internal
xx
001
Internal
xx
000
Note 1:
2:
Preliminary
DS70289B-page 87
U-0
R-0
R-0
R-0
COSC<2:0>
U-0
R/W-y
R/W-y
R/W-y
NOSC<2:0>
bit 15
bit 8
R/W-0
R/W-0
R-0
U-0
R/C-0
U-0
R/W-0
R/W-0
CLKLOCK
IOLOCK
LOCK
CF
LPOSCEN
OSWEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15
Unimplemented: Read as 0
bit 14-12
bit 11
Unimplemented: Read as 0
bit 10-8
bit 7
bit 6
bit 5
bit 4
Unimplemented: Read as 0
bit 3
bit 2
Unimplemented: Read as 0
DS70289B-page 88
Preliminary
bit 1
bit 0
Preliminary
DS70289B-page 89
ROI
R/W-1
R/W-1
R/W-0
R/W-0
DOZEN(1)
DOZE<2:0>
R/W-0
R/W-0
FRCDIV<2:0>
bit 15
bit 8
R/W-0
R/W-1
PLLPOST<1:0>
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
PLLPRE<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15
bit 14-12
bit 11
bit 10-8
bit 7-6
PLLPOST<1:0>: PLL VCO Output Divider Select bits (also denoted as N2, PLL postscaler)
00 = Output/2
01 = Output/4 (default)
10 = Reserved
11 = Output/8
bit 5
Unimplemented: Read as 0
bit 4-0
PLLPRE<4:0>: PLL Phase Detector Input Divider bits (also denoted as N1, PLL prescaler)
00000 = Input/2 (default)
00001 = Input/3
11111 = Input/33
Note 1: This bit is cleared when the ROI bit is set and an interrupt occurs.
DS70289B-page 90
Preliminary
U-0
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0
PLLDIV<8>
bit 15
bit 8
R/W-0
R/W-0
R/W-1
R/W-1
R/W-0
R/W-0
R/W-0
R/W-0
PLLDIV<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-9
Unimplemented: Read as 0
bit 8-0
000110000 = 50 (default)
111111111 = 513
Preliminary
DS70289B-page 91
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 15
bit 8
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
TUN<5:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-6
Unimplemented: Read as 0
bit 5-0
DS70289B-page 92
Preliminary
x = Bit is unknown
7.2.1
2.
3.
4.
5.
6.
7.2.2
OSCILLATOR SWITCHING
SEQUENCE
2.
3.
4.
5.
7.3
Preliminary
DS70289B-page 93
DS70289B-page 94
Preliminary
POWER-SAVING FEATURES
8.2
Clock frequency
Instruction-based Sleep and Idle modes
Software-controlled Doze mode
Selective peripheral control in software
8.1
EXAMPLE 8-1:
Instruction-Based Power-Saving
Modes
8.2.1
SLEEP MODE
PWRSAV #SLEEP_MODE
PWRSAV #IDLE_MODE
Preliminary
DS70289B-page 95
IDLE MODE
8.2.3
8.4
8.3
Doze Mode
DS70289B-page 96
Preliminary
U-0
U-0
R/W-0
R/W-0
R/W-0
U-0
U-0
U-0
T3MD
T2MD
T1MD
bit 15
bit 8
R/W-0
U-0
R/W-0
U-0
R/W-0
U-0
U-0
R/W-0
I2C1MD
U1MD
SPI1MD
AD1MD
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-14
Unimplemented: Read as 0
bit 13
bit 12
bit 11
bit 10-8
Unimplemented: Read as 0
bit 7
bit 6
Unimplemented: Read as 0
bit 5
bit 4
Unimplemented: Read as 0
bit 3
bit 2-1
Unimplemented: Read as 0
bit 0
Preliminary
x = Bit is unknown
DS70289B-page 97
R/W-0
R/W-0
U-0
U-0
U-0
U-0
R/W-0
R/W-0
IC8MD
IC7MD
IC2MD
IC1MD
bit 15
bit 8
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0
R/W-0
OC2MD
OC1MD
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15
bit 14
bit 13-10
Unimplemented: Read as 0
bit 9
bit 8
bit 7-2
Unimplemented: Read as 0
bit 1
bit 0
DS70289B-page 98
Preliminary
x = Bit is unknown
I/O PORTS
This data sheet summarizes the features
of the PIC24HJ32GP202/204 and
PIC24HJ16GP304 family of devices.
However, it is not intended to be a
comprehensive reference source. To
complement the information in this data
sheet, refer to the PIC24H Family
Reference Manual, Section 10. I/O
Ports (DS70230), which is available from
the
Microchip
website
(www.microchip.com).
9.1
FIGURE 9-1:
Output Multiplexers
WR TRIS
Output Enable
0
1
Output Data
Read TRIS
Data Bus
I/O
1
I/O Pin
CK
TRIS Latch
D
WR LAT +
WR Port
CK
Data Latch
Read LAT
Input Data
Read Port
Preliminary
DS70289B-page 99
OPEN-DRAIN CONFIGURATION
TABLE 9-1:
DS70289B-page 100
Preliminary
I/O Pin
Digital-Only/5V Tolerant
RA0
No
RA1
No
RA2
No
RA3
No
RA4
No
RA7
Yes
RA8
Yes
RA9
Yes
RA10
Yes
RB0
No
RB1
No
RB2
No
RB3
No
RB4
Yes
RB5
Yes
RB6
Yes
RB7
Yes
RB8
Yes
RB9
Yes
RB10
Yes
RB11
Yes
RB12
No
RB13
No
RB14
No
RB15
No
RC0
No
RC1
No
RC2
No
RC3
Yes
RC4
Yes
RC5
Yes
RC6
Yes
RC7
Yes
RC8
Yes
RC9
Yes
9.3
9.2.1
EXAMPLE 9-1:
MOV
MOV
NOP
btss
0xFF00, W0
W0, TRISBB
PORTB, #13
;
;
;
;
Preliminary
DS70289B-page 101
9.4.2
9.4.1
AVAILABLE PINS
FIGURE 9-2:
9.4.2.1
Input Mapping
1
RP1
U1RX input
to peripheral
RP2
25
RP25
DS70289B-page 102
Preliminary
TABLE 9-2:
Function Name
Register
Configuration
Bits
External Interrupt 1
INT1
RPINR0
INT1R<4:0>
External Interrupt 2
INT2
RPINR1
INT2R<4:0>
T2CK
RPINR3
T2CKR<4:0>
T3CK
RPINR3
T3CKR<4:0>
Input Capture 1
IC1
RPINR7
IC1R<4:0>
Input Capture 2
IC2
RPINR7
IC2R<4:0>
Input Capture 7
IC7
RPINR10
IC7R<4:0>
Input Name
Input Capture 8
IC8
RPINR10
IC8R<4:0>
OCFA
RPINR11
OCFAR<4:0>
UART 1 Receive
U1RX
RPINR18
U1RXR<4:0>
U1CTS
RPINR18
U1CTSR<4:0>
SDI1
RPINR20
SDI1R<4:0>
SCK1IN
RPINR20
SCK1R<4:0>
SS1IN
RPINR21
SS1R<4:0>
Unless otherwise noted, all inputs use the Schmitt input buffers.
Preliminary
DS70289B-page 103
Output Mapping
value of the bit field corresponds to one of the peripherals, and that peripherals output is mapped to the pin
(see Table 9-3 and Figure 9-3).
FIGURE 9-3:
0
3
4
Output enable
default
U1TX Output
U1RTS Output
18
19
0
3
4
RPn
Output Data
OC1 Output
OC2 Output
TABLE 9-3:
18
19
Function
RPnR<4:0>
Output Name
NULL
00000
U1TX
00011
U1RTS
00100
SDO1
00111
SCK1OUT
01000
SS1OUT
01001
OC1
10010
OC2
10011
DS70289B-page 104
Preliminary
CONTROLLING CONFIGURATION
CHANGES
9.4.3.1
9.5
__builtin_write_OSCCONL(value)
__builtin_write_OSCCONH(value)
9.4.3.3
1.
2.
3.
9.4.3.2
Preliminary
DS70289B-page 105
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
INT1R<4:0>
bit 15
bit 8
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
bit 7-0
Unimplemented: Read as 0
DS70289B-page 106
Preliminary
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 15
bit 8
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
INT2R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-5
Unimplemented: Read as 0
bit 4-0
Preliminary
DS70289B-page 107
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
T3CKR<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
T2CKR<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
T3CKR<4:0>: Assign Timer3 External Clock (T3CK) to the Corresponding RPn pin
11111 = Input tied to Vss
11001 = Input tied to RP25
bit 7-5
Unimplemented: Read as 0
bit 4-0
T2CKR<4:0>: Assign Timer2 External Clock (T2CK) to the Corresponding RPn pin
11111 = Input tied to Vss
11001 = Input tied to RP25
DS70289B-page 108
Preliminary
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
IC2R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
IC1R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-13
Unimplemented: Read as 0
bit 12-8
bit 7-5
Unimplemented: Read as 0
bit 4-0
Preliminary
x = Bit is unknown
DS70289B-page 109
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
IC8R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
IC7R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
IC8R<4:0>: Assign Input Capture 8 (IC8) to the corresponding pin RPn pin
11111 = Input tied to Vss
11001 = Input tied to RP25
bit 7-5
Unimplemented: Read as 0
bit 4-0
IC7R<4:0>: Assign Input Capture 7 (IC7) to the corresponding pin RPn pin
11111 = Input tied to Vss
11001 = Input tied to RP25
DS70289B-page 110
Preliminary
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 15
bit 8
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
OCFAR<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-5
Unimplemented: Read as 0
bit 4-0
Preliminary
DS70289B-page 111
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
U1CTSR<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
U1RXR<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
U1CTSR<4:0>: Assign UART 1 Clear to Send (U1CTS) to the corresponding RPn pin
11111 = Input tied to Vss
11001 = Input tied to RP25
bit 7-5
Unimplemented: Read as 0
bit 4-0
DS70289B-page 112
Preliminary
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
SCK1R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
SDI1R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
SCK1R<4:0>: Assign SPI 1 Clock Input (SCK1IN) to the corresponding RPn pin
11111 = Input tied to Vss
11001 = Input tied to RP25
bit 7-5
Unimplemented: Read as 0
bit 4-0
SDI1R<4:0>: Assign SPI 1 Data Input (SDI1) to the corresponding RPn pin
11111 = Input tied to Vss
11001 = Input tied to RP25
Preliminary
DS70289B-page 113
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 15
bit 8
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
SS1R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-5
Unimplemented: Read as 0
bit 4-0
SS1R<4:0>: Assign SPI1 Slave Select Input (SS1IN) to the Corresponding RPn pin
11111 = Input tied to Vss
11001 = Input tied to RP25
DS70289B-page 114
Preliminary
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP1R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP0R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
RP1R<4:0>: Peripheral Output Function is Assigned to RP1 Output Pin (see Table 9-3 for peripheral
function numbers)
bit 7-5
Unimplemented: Read as 0
bit 4-0
RP0R<4:0>: Peripheral Output Function is Assigned to RP0 Output Pin (see Table 9-3 for peripheral
function numbers)
REGISTER 9-11:
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP3R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP2R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
RP3R<4:0>: Peripheral Output Function is Assigned to RP3 Output Pin (see Table 9-3 for peripheral
function numbers)
bit 7-5
Unimplemented: Read as 0
bit 4-0
RP2R<4:0>: Peripheral Output Function is Assigned to RP2 Output Pin (see Table 9-3 for peripheral
function numbers)
Preliminary
DS70289B-page 115
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP5R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP4R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
RP5R<4:0>: Peripheral Output Function is Assigned to RP5 Output Pin (see Table 9-3 for peripheral
function numbers)
bit 7-5
Unimplemented: Read as 0
bit 4-0
RP4R<4:0>: Peripheral Output Function is Assigned to RP4 Output Pin (see Table 9-3 for peripheral
function numbers)
REGISTER 9-13:
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP7R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP6R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
RP7R<4:0>: Peripheral Output Function is Assigned to RP7 Output Pin (see Table 9-3 for peripheral
function numbers)
bit 7-5
Unimplemented: Read as 0
bit 4-0
RP6R<4:0>: Peripheral Output Function is Assigned to RP6 Output Pin (see Table 9-3 for peripheral
function numbers)
DS70289B-page 116
Preliminary
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP9R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP8R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
RP9R<4:0>: Peripheral Output Function is Assigned to RP9 Output Pin (see Table 9-3 for peripheral
function numbers)
bit 7-5
Unimplemented: Read as 0
bit 4-0
RP8R<4:0>: Peripheral Output Function is Assigned to RP8 Output Pin (see Table 9-3 for peripheral
function numbers)
REGISTER 9-15:
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP11R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP10R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
RP11R<4:0>: Peripheral Output Function is Assigned to RP11 Output Pin (see Table 9-3 for peripheral
function numbers)
bit 7-5
Unimplemented: Read as 0
bit 4-0
RP10R<4:0>: Peripheral Output Function is Assigned to RP10 Output Pin (see Table 9-3 for
peripheral function numbers)
Preliminary
DS70289B-page 117
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP13R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP12R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
RP13R<4:0>: Peripheral Output Function is Assigned to RP13 Output Pin (see Table 9-3 for
peripheral function numbers)
bit 7-5
Unimplemented: Read as 0
bit 4-0
RP12R<4:0>: Peripheral Output Function is Assigned to RP12 Output Pin (see Table 9-3 for
peripheral function numbers)
REGISTER 9-17:
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP15R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP14R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
RP15R<4:0>: Peripheral Output Function is Assigned to RP15 Output Pin (see Table 9-3 for
peripheral function numbers)
bit 7-5
Unimplemented: Read as 0
bit 4-0
RP14R<4:0>: Peripheral Output Function is Assigned to RP14 Output Pin (see Table 9-3 for
peripheral function numbers)
DS70289B-page 118
Preliminary
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP17R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP16R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
RP17R<4:0>: Peripheral Output Function is Assigned to RP15 Output Pin (see Table 9-3 for
peripheral function numbers)
bit 7-5
Unimplemented: Read as 0
bit 4-0
RP16R<4:0>: Peripheral Output Function is Assigned to RP14 Output Pin (see Table 9-3 for
peripheral function numbers)
REGISTER 9-19:
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP19R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP18R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
RP19R<4:0>: Peripheral Output Function is Assigned to RP19 Output Pin (see Table 9-3 for
peripheral function numbers)
bit 7-5
Unimplemented: Read as 0
bit 4-0
RP18R<4:0>: Peripheral Output Function is Assigned to RP18 Output Pin (see Table 9-3 for
peripheral function numbers)
Preliminary
DS70289B-page 119
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP21R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP20R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
RP21R<4:0>: Peripheral Output Function is Assigned to RP21 Output Pin (see Table 9-3 for
peripheral function numbers)
bit 7-5
Unimplemented: Read as 0
bit 4-0
RP20R<4:0>: Peripheral Output Function is Assigned to RP20 Output Pin (see Table 9-3 for
peripheral function numbers)
REGISTER 9-21:
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP23R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP22R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
RP23R<4:0>: Peripheral Output Function is Assigned to RP23 Output Pin (see Table 9-3 for
peripheral function numbers)
bit 7-5
Unimplemented: Read as 0
bit 4-0
RP22R<4:0>: Peripheral Output Function is Assigned to RP22 Output Pin (see Table 9-3 for
peripheral function numbers)
DS70289B-page 120
Preliminary
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP25R<4:0>
bit 15
bit 8
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
RP24R<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-8
RP25R<4:0>: Peripheral Output Function is Assigned to RP25 Output Pin (see Table 9-3 for
peripheral function numbers)
bit 7-5
Unimplemented: Read as 0
bit 4-0
RP24R<4:0>: Peripheral Output Function is Assigned to RP24 Output Pin (see Table 9-3 for
peripheral function numbers)
Preliminary
DS70289B-page 121
DS70289B-page 122
Preliminary
TIMER1
3.
16-bit Timer
16-bit Synchronous Counter
16-bit Asynchronous Counter
5.
4.
6.
FIGURE 10-1:
SOSCO/
T1CK
1x
SOSCEN
SOSCI
Gate
Sync
01
TCY
00
Prescaler
1, 8, 64, 256
TGATE
TCS
TGATE
Set T1IF
TON
CK
Reset
0
TMR1
1
Equal
Comparator
Sync
TSYNC
PR1
Preliminary
DS70289B-page 123
R/W-0
U-0
R/W-0
U-0
U-0
U-0
U-0
U-0
TON
TSIDL
bit 15
bit 8
U-0
R/W-0
TGATE
R/W-0
R/W-0
TCKPS<1:0>
U-0
R/W-0
R/W-0
U-0
TSYNC
TCS
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15
bit 14
Unimplemented: Read as 0
bit 13
bit 12-7
Unimplemented: Read as 0
bit 6
bit 5-4
bit 3
Unimplemented: Read as 0
bit 2
bit 1
bit 0
Unimplemented: Read as 0
DS70289B-page 124
Preliminary
x = Bit is unknown
TIMER2/3 FEATURE
11.1
32-bit Operation
5.
6.
1.
2.
3.
4.
5.
6.
Preliminary
DS70289B-page 125
FIGURE 11-1:
1x
T2CK
Gate
Sync
01
TCY
00
Prescaler
1, 8, 64, 256
TGATE
TCS
TGATE
Set T3IF
Equal
D
CK
PR2
PR3
ADC Event Trigger(2)
TCKPS<1:0>
2
TON
Comparator
MSb
LSb
TMR3
Reset
TMR2
Sync
16
Read TMR2
Write TMR2
16
TMR3HLD
16
16
Data Bus<15:0>
Note 1:
2:
The 32-bit timer control bit, T32, must be set for 32-bit timer/counter operation. All control bits are respective
to the T2CON register.
The ADC event trigger is available only on Timer2/3.
DS70289B-page 126
Preliminary
T2CK
1x
Gate
Sync
TON
TCKPS<1:0>
2
Prescaler
1, 8, 64, 256
01
00
TGATE
TCS
TCY
1
Set T2IF
0
Reset
Equal
CK
TGATE
Sync
TMR2
Comparator
PR2
Preliminary
DS70289B-page 127
R/W-0
U-0
R/W-0
U-0
U-0
U-0
U-0
U-0
TON
TSIDL
bit 15
bit 8
U-0
R/W-0
TGATE
R/W-0
R/W-0
TCKPS<1:0>
R/W-0
U-0
R/W-0
U-0
T32(1)
TCS
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15
bit 14
Unimplemented: Read as 0
bit 13
bit 12-7
Unimplemented: Read as 0
bit 6
bit 5-4
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
Unimplemented: Read as 0
x = Bit is unknown
Note 1: In 32-bit mode, T3CON control bits do not affect 32-bit timer operation.
DS70289B-page 128
Preliminary
R/W-0
U-0
R/W-0
U-0
U-0
U-0
U-0
U-0
TON(1)
TSIDL(1)
bit 15
bit 8
U-0
R/W-0
TGATE(1)
R/W-0
R/W-0
TCKPS<1:0>(1)
U-0
U-0
R/W-0
U-0
TCS(1)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15
bit 14
Unimplemented: Read as 0
bit 13
bit 12-7
Unimplemented: Read as 0
bit 6
bit 5-4
bit 3-2
Unimplemented: Read as 0
bit 1
bit 0
Unimplemented: Read as 0
x = Bit is unknown
Note 1: When 32-bit operation is enabled (T2CON<3> = 1), these bits have no effect on Timer3 operation; all timer
functions are set through T2CON.
Preliminary
DS70289B-page 129
DS70289B-page 130
Preliminary
INPUT CAPTURE
Note:
FIGURE 12-1:
16
16
1
Edge Detection Logic
and
Clock Synchronizer
Prescaler
Counter
(1, 4, 16)
ICx Pin
FIFO
R/W
Logic
ICM<2:0> (ICxCON<2:0>)
Mode Select
ICTMR
(ICxCON<7>)
FIFO
System Bus
Interrupt
Logic
Note: An x in a signal, register or bit name denotes the number of the capture channel.
Preliminary
DS70289B-page 131
REGISTER 12-1:
U-0
U-0
R/W-0
U-0
U-0
U-0
U-0
U-0
ICSIDL
bit 15
bit 8
R/W-0
R/W-0
ICTMR
R/W-0
ICI<1:0>
R-0, HC
R-0, HC
ICOV
ICBNE
R/W-0
R/W-0
R/W-0
ICM<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-14
Unimplemented: Read as 0
bit 13
bit 12-8
Unimplemented: Read as 0
bit 7
bit 6-5
bit 4
bit 3
bit 2-0
DS70289B-page 132
Preliminary
OUTPUT COMPARE
FIGURE 13-1:
OCxRS
Output
Logic
OCxR
3
OCM<2:0>
Mode Select
Comparator
0
16
OCx
Output Enable
OCFA
16
TMR2 TMR3
OCTSEL
S Q
R
TMR2
Rollover
TMR3
Rollover
Preliminary
DS70289B-page 133
TABLE 13-1:
OCM<2:0>
Mode
000
Module Disabled
001
Active-Low One-Shot
010
Active-High One-Shot
011
Toggle Mode
100
Delayed One-Shot
101
110
111
FIGURE 13-2:
0, if OCxR is zero
1, if OCxR is non-zero
No interrupt
OCFA Falling edge for OC1 to OC4
Timer is reset on
period match
OCxRS
TMRy
OCxR
Active-Low One-Shot
(OCM = 001)
Active-High One-Shot
(OCM = 010)
Toggle Mode
(OCM = 011)
Delayed One-Shot
(OCM = 100)
Continuous Pulse Mode
(OCM = 101)
PWM Mode
(OCM = 110 or 111)
DS70289B-page 134
Preliminary
REGISTER 13-1:
U-0
U-0
R/W-0
U-0
U-0
U-0
U-0
U-0
OCSIDL
bit 15
bit 8
U-0
U-0
U-0
R-0 HC
R/W-0
OCFLT
OCTSEL
R/W-0
R/W-0
R/W-0
OCM<2:0>
bit 7
bit 0
Legend:
HC = Cleared in Hardware
HS = Set in Hardware
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-14
Unimplemented: Read as 0
bit 13
x = Bit is unknown
bit 12-5
Unimplemented: Read as 0
bit 4
bit 3
bit 2-0
Preliminary
DS70289B-page 135
DS70289B-page 136
Preliminary
SERIAL PERIPHERAL
INTERFACE (SPI)
Note:
FIGURE 14-1:
SCKx
SSx
1:1 to 1:8
Secondary
Prescaler
Sync
Control
1:1/4/16/64
Primary
Prescaler
Select
Edge
Control
Clock
SPIxCON1<1:0>
Shift Control
SPIxCON1<4:2>
SDOx
Enable
Master Clock
bit 0
SDIx
FCY
SPIxSR
Transfer
Transfer
SPIxRXB
SPIxTXB
SPIxBUF
Read SPIxBUF
Write SPIxBUF
16
Internal Data Bus
Preliminary
DS70289B-page 137
R/W-0
U-0
R/W-0
U-0
U-0
U-0
U-0
U-0
SPIEN
SPISIDL
bit 15
bit 8
U-0
R/C-0
U-0
U-0
U-0
U-0
R-0
R-0
SPIROV
SPITBF
SPIRBF
bit 7
bit 0
Legend:
C = Clearable bit
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15
bit 14
Unimplemented: Read as 0
bit 13
bit 12-7
Unimplemented: Read as 0
bit 6
bit 5-2
Unimplemented: Read as 0
bit 1
bit 0
DS70289B-page 138
Preliminary
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
DISSCK
DISSDO
MODE16
SMP
CKE(1)
bit 15
bit 8
R/W-0
R/W-0
R/W-0
SSEN
CKP
MSTEN
R/W-0
R/W-0
R/W-0
R/W-0
SPRE<2:0>
R/W-0
PPRE<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12
bit 11
bit 10
bit 9
bit 8
bit 7
bit 6
bit 5
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).
Preliminary
DS70289B-page 139
bit 4-2
bit 1-0
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).
DS70289B-page 140
Preliminary
R/W-0
R/W-0
R/W-0
U-0
U-0
U-0
U-0
U-0
FRMEN
SPIFSD
FRMPOL
bit 15
bit 8
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0
U-0
FRMDLY
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15
bit 14
bit 13
bit 12-2
Unimplemented: Read as 0
bit 1
bit 0
Preliminary
DS70289B-page 141
DS70289B-page 142
Preliminary
INTER-INTEGRATED CIRCUIT
(I2C)
This data sheet summarizes the features
of the PIC24HJ32GP202/204 and
PIC24HJ16GP304 family of devices.
However, it is not intended to be a
comprehensive reference source. To
complement the information in this data
sheet, refer to the PIC24H Family
Reference
Manual,
Section
19.
Inter-Integrated
Circuit
(I2C)
(DS70235), which is available from the
Microchip website (www.microchip.com).
15.1
Operating Modes
15.2
I2C Registers
Preliminary
DS70289B-page 143
SCLx
Read
Shift
Clock
I2CxRSR
LSb
SDAx
Address Match
Match Detect
Write
I2CxMSK
Write
Read
I2CxADD
Read
Start and Stop
Bit Detect
Write
I2CxSTAT
Collision
Detect
Read
Write
I2CxCON
Acknowledge
Generation
Read
Clock
Stretching
Write
I2CxTRN
LSb
Read
Shift Clock
Reload
Control
Write
I2CxBRG
Read
TCY/2
DS70289B-page 144
Preliminary
R/W-0
U-0
R/W-0
R/W-1 HC
R/W-0
R/W-0
R/W-0
R/W-0
I2CEN
I2CSIDL
SCLREL
IPMIEN
A10M
DISSLW
SMEN
bit 15
bit 8
R/W-0
R/W-0
R/W-0
R/W-0 HC
R/W-0 HC
R/W-0 HC
R/W-0 HC
R/W-0 HC
GCEN
STREN
ACKDT
ACKEN
RCEN
PEN
RSEN
SEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
HS = Set in hardware
HC = Cleared in hardware
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15
bit 14
Unimplemented: Read as 0
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
bit 7
bit 6
STREN: SCLx Clock Stretch Enable bit (when operating as I2C slave)
Used in conjunction with SCLREL bit.
1 = Enable software or receive clock stretching
0 = Disable software or receive clock stretching
Preliminary
DS70289B-page 145
bit 5
ACKDT: Acknowledge Data bit (when operating as I2C master, applicable during master receive)
Value that will be transmitted when the software initiates an Acknowledge sequence.
1 = Send NACK during Acknowledge
0 = Send ACK during Acknowledge
bit 4
bit 3
bit 2
bit 1
RSEN: Repeated Start Condition Enable bit (when operating as I2C master)
1 = Initiate Repeated Start condition on SDAx and SCLx pins. Hardware clear at end of
master Repeated Start sequence
0 = Repeated Start condition not in progress
bit 0
DS70289B-page 146
Preliminary
R-0 HSC
R-0 HSC
U-0
U-0
U-0
R/C-0 HS
R-0 HSC
R-0 HSC
ACKSTAT
TRSTAT
BCL
GCSTAT
ADD10
bit 15
bit 8
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
R_W
RBF
TBF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
HS = Set in hardware
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15
bit 14
TRSTAT: Transmit Status bit (when operating as I2C master, applicable to master transmit operation)
1 = Master transmit is in progress (8 bits + ACK)
0 = Master transmit is not in progress
Hardware set at beginning of master transmission. Hardware clear at end of slave Acknowledge.
bit 13-11
Unimplemented: Read as 0
bit 10
bit 9
bit 8
bit 7
bit 6
bit 5
bit 4
P: Stop bit
1 = Indicates that a Stop bit has been detected last
0 = Stop bit was not detected last
Hardware set or clear when Start, Repeated Start or Stop detected.
Preliminary
DS70289B-page 147
bit 3
S: Start bit
1 = Indicates that a Start (or Repeated Start) bit has been detected last
0 = Start bit was not detected last
Hardware set or clear when Start, Repeated Start or Stop detected.
bit 2
bit 1
bit 0
DS70289B-page 148
Preliminary
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0
R/W-0
AMSK9
AMSK8
bit 15
bit 8
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
AMSK7
AMSK6
AMSK5
AMSK4
AMSK3
AMSK2
AMSK1
AMSK0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-10
Unimplemented: Read as 0
bit 9-0
Preliminary
DS70289B-page 149
DS70289B-page 150
Preliminary
Note:
UNIVERSAL ASYNCHRONOUS
RECEIVER TRANSMITTER
(UART)
This data sheet summarizes the features
of the PIC24HJ32GP202/204 and
PIC24HJ16GP304 family of devices.
However, it is not intended to be a
comprehensive reference source. To
complement the information in this data
sheet, refer to the PIC24H Family
Reference Manual, Section 17. UART
(DS70232), which is available from the
Microchip website (www.microchip.com).
FIGURE 16-1:
IrDA
BCLK
UxRTS
UxCTS
UART Receiver
UxRX
UART Transmitter
UxTX
Preliminary
DS70289B-page 151
R/W-0
U-0
R/W-0
R/W-0
R/W-0
U-0
UARTEN
USIDL
IREN(1)
RTSMD
R/W-0
R/W-0
UEN<1:0>
bit 15
bit 8
R/W-0 HC
R/W-0
R/W-0 HC
R/W-0
R/W-0
WAKE
LPBACK
ABAUD
URXINV
BRGH
R/W-0
R/W-0
PDSEL<1:0>
R/W-0
STSEL
bit 7
bit 0
Legend:
HC = Hardware cleared
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15
bit 14
Unimplemented: Read as 0
bit 13
bit 12
bit 11
bit 10
Unimplemented: Read as 0
bit 9-8
bit 7
WAKE: Wake-up on Start bit Detect During Sleep Mode Enable bit
1 = UARTx will continue to sample the UxRX pin; interrupt generated on falling edge; bit cleared
in hardware on following rising edge
0 = No wake-up enabled
bit 6
bit 5
bit 4
Note 1: This feature is only available for the 16x BRG mode (BRGH = 0).
DS70289B-page 152
Preliminary
bit 3
bit 2-1
bit 0
Note 1: This feature is only available for the 16x BRG mode (BRGH = 0).
Preliminary
DS70289B-page 153
R/W-0
R/W-0
R/W-0
U-0
R/W-0 HC
R/W-0
R-0
R-1
UTXISEL1
UTXINV(1)
UTXISEL0
UTXBRK
UTXEN
UTXBF
TRMT
bit 15
bit 8
R/W-0
R/W-0
URXISEL<1:0>
R/W-0
R-1
R-0
R-0
R/C-0
R-0
ADDEN
RIDLE
PERR
FERR
OERR
URXDA
bit 7
bit 0
Legend:
HC = Hardware cleared
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15,13
bit 14
bit 12
Unimplemented: Read as 0
bit 11
bit 10
bit 9
bit 8
bit 7-6
bit 5
Note 1: Value of bit only affects the transmit properties of the module when the IrDA encoder is enabled
(IREN = 1).
DS70289B-page 154
Preliminary
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1: Value of bit only affects the transmit properties of the module when the IrDA encoder is enabled
(IREN = 1).
Preliminary
DS70289B-page 155
DS70289B-page 156
Preliminary
Note:
10-BIT/12-BIT
ANALOG-TO-DIGITAL
CONVERTER (ADC)
This data sheet summarizes the features
of the PIC24HJ32GP202/204 and
PIC24HJ16GP304 family of devices.
However, it is not intended to be a
comprehensive reference source. To
complement the information in this data
sheet, refer to the PIC24H Family
Reference
Manual,
Section
16.
Analog-to-Digital Converter (ADC) with
DMA (DS70225), which is available from
the
Microchip
website
(www.microchip.com).
17.1
17.2
ADC Initialization
3.
4.
Key Features
5.
6.
7.
8.
Select
port
pins
as
analog
inputs
(AD1PCFGH<15:0> or AD1PCFGL<15:0>).
Select voltage reference source to match
expected
range
on
analog
inputs
(AD1CON2<15:13>).
Select the analog conversion clock to match
desired data rate with processor clock
(AD1CON3<7:0>).
Determine
how
many
sample-and-hold
channels will be used (AD1CON2<9:8> and
AD1PCFGH<15:0> or AD1PCFGL<15:0>).
Select the appropriate sample/conversion
sequence
(AD1CON1<7:5>
and
AD1CON3<12:8>).
Select the way conversion results are presented
in the buffer (AD1CON1<9:8>).
Turn on the ADC module (AD1CON1<15>).
Configure ADC interrupt (if required):
a) Clear the AD1IF bit.
b) Select ADC interrupt priority.
Preliminary
DS70289B-page 157
S/H0
CHANNEL
SCAN
CH0SA<4:0>
CH0
CH0SB<4:0>
CSCNA
AN1
VREF-
CH0NA CH0NB
AN0
AN3
S/H1
+
-
CH123SA CH123SB
CH1(2)
AN6
AN9
ADC1BUF0
VREF-
ADC1BUF1
ADC1BUF2
VREFH
CH123NA CH123NB
VREFL
SAR ADC
AN1
AN4
S/H2
CH123SA CH123SB
CH2(2)
ADC1BUFE
ADC1BUFF
AN7
AN10
VREF-
CH123NA CH123NB
AN2
AN5
S/H3
+
CH123SA CH123SB
CH3(2)
AN8
AN11
VREF-
CH123NA CH123NB
Alternate
Input Selection
Note
1:
2:
DS70289B-page 158
Preliminary
S/H0
CHANNEL
SCAN
CH0SA<4:0>
CH0
CH0SB<4:0>
CSCNA
AN1
VREF-
CH0NA CH0NB
AN0
AN3
S/H1
+
-
CH123SA CH123SB
CH1(2)
AN9
ADC1BUF0
VREF-
ADC1BUF1
ADC1BUF2
VREFH
CH123NA CH123NB
VREFL
SAR ADC
AN1
AN4
S/H2
CH123SA CH123SB
CH2
ADC1BUFE
ADC1BUFF
(2)
AN10
VREF-
CH123NA CH123NB
AN2
AN5
S/H3
+
CH123SA CH123SB
CH3(2)
AN11
VREF-
CH123NA CH123NB
Alternate
Input Selection
Note
1:
2:
Preliminary
DS70289B-page 159
ADC Internal
RC Clock(2)
TAD
AD1CON3<5:0>
TOSC(1)
X2
TCY
ADC Conversion
Clock Multiplier
1, 2, 3, 4, 5,..., 64
Note 1:
2:
Refer to Figure 7-2 for the derivation of FOSC when the PLL is enabled. If the PLL is not used, FOSC is equal
to the clock frequency. TOSC = 1/FOSC.
See the ADC Electrical Characteristics for the exact RC Clock value.
DS70289B-page 160
Preliminary
R/W-0
U-0
R/W-0
U-0
U-0
R/W-0
ADON
ADSIDL
AD12B
R/W-0
R/W-0
FORM<1:0>
bit 15
bit 8
R/W-0
R/W-0
R/W-0
SSRC<2:0>
U-0
R/W-0
R/W-0
R/W-0
HC,HS
R/C-0
HC, HS
SIMSAM
ASAM
SAMP
DONE
bit 7
bit 0
Legend:
HC = Cleared by hardware
HS = Set by hardware
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15
bit 14
Unimplemented: Read as 0
bit 13
bit 12-11
Unimplemented: Read as 0
bit 10
bit 9-8
bit 7-5
bit 4
Unimplemented: Read as 0
bit 3
SIMSAM: Simultaneous Sample Select bit (applicable only when CHPS<1:0> = 01 or 1x)
When AD12B = 1, SIMSAM is: U-0, Unimplemented, Read as 0
1 = Samples CH0, CH1, CH2, CH3 simultaneously (when CHPS<1:0> = 1x); or
Samples CH0 and CH1 simultaneously (when CHPS<1:0> = 01)
0 = Samples multiple channels individually in sequence
Preliminary
DS70289B-page 161
bit 2
bit 1
bit 0
DS70289B-page 162
Preliminary
R/W-0
VCFG<2:0>
U-0
U-0
R/W-0
CSCNA
R/W-0
R/W-0
CHPS<1:0>
bit 15
bit 8
R-0
U-0
BUFS
R/W-0
R/W-0
R/W-0
R/W-0
SMPI<3:0>
R/W-0
R/W-0
BUFM
ALTS
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-13
x = Bit is unknown
000
001
010
011
1xx
ADREF+
ADREF-
AVDD
External VREF+
AVDD
External VREF+
AVDD
AVSS
AVSS
External VREFExternal VREFAvss
bit 12-11
Unimplemented: Read as 0
bit 10
bit 9-8
bit 7
bit 6
Unimplemented: Read as 0
bit 5-2
0001 = Interrupts at the completion of conversion for each 2nd sample/convert sequence
0000 = Interrupts at the completion of conversion for each sample/convert sequence
bit 1
bit 0
Preliminary
DS70289B-page 163
R/W-0
U-0
U-0
ADRC
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
SAMC<4:0>
bit 15
bit 8
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
ADCS<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15
bit 14-13
Unimplemented: Read as 0
bit 12-8
00001 = 1 TAD
00000 = 0 TAD
bit 7-0
DS70289B-page 164
Preliminary
x = Bit is unknown
U-0
U-0
U-0
U-0
U-0
R/W-0
R/W-0
CH123NB<1:0>
R/W-0
CH123SB
bit 15
bit 8
U-0
U-0
U-0
U-0
U-0
R/W-0
R/W-0
CH123NA<1:0>
R/W-0
CH123SA
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-11
Unimplemented: Read as 0
bit 10-9
x = Bit is unknown
If AD12B = 0:
11 = CH1 negative input is AN9, CH2 negative input is AN10, CH3 negative input is AN11
10 = Reserved
01 = CH1, CH2, CH3 negative input is VREF00 = CH1, CH2, CH3 negative input is VREFPIC24HJ32GP204 and PIC24HJ16GP304 devices only:
If AD12B = 1:
11 = Reserved
10 = Reserved
01 = Reserved
00 = Reserved
If AD12B = 0:
11 = CH1 negative input is AN9, CH2 negative input is AN10, CH3 negative input is AN11
10 = CH1 negative input is AN6, CH2 negative input is AN7, CH3 negative input is AN8
01 = CH1, CH2, CH3 negative input is VREF00 = CH1, CH2, CH3 negative input is VREFbit 8
bit 7-3
Unimplemented: Read as 0
Preliminary
DS70289B-page 165
bit 0
DS70289B-page 166
Preliminary
R/W-0
U-0
U-0
CH0NB
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
CH0SB<4:0>
bit 15
bit 8
R/W-0
U-0
U-0
CH0NA
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
CH0SA<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15
bit 14-13
Unimplemented: Read as 0
bit 12-8
x = Bit is unknown
01000 = Reserved
00111 = Reserved
00110 = Reserved
bit 6-5
Unimplemented: Read as 0
Preliminary
DS70289B-page 167
01000 = Reserved
00111 = Reserved
00110 = Reserved
DS70289B-page 168
Preliminary
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
CSS12
CSS11
CSS10
CSS9
CSS8
bit 15
bit 8
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
CSS7
CSS6
CSS5
CSS4
CSS3
CSS2
CSS1
CSS0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
bit 15-13
Unimplemented: Read as 0
bit 12-0
x = Bit is unknown
Note 1: On PIC24HJ32GP202 devices, all AD1CSSL bits can be selected. However, inputs selected for scan without a corresponding input on device will convert ADREF-.
REGISTER 17-7:
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
PCFG12
PCFG11
PCFG10
PCFG9
PCFG8
bit 15
bit 8
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
PCFG7
PCFG6
PCFG5
PCFG4
PCFG3
PCFG2
PCFG1
PCFG0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15-13
Unimplemented: Read as 0
bit 12-0
Note 1: On PIC24HJ32GP202 devices, all PCFG bits are R/W. However, PCFG bits are ignored on ports without
a corresponding input on device.
Preliminary
DS70289B-page 169
DS70289B-page 170
Preliminary
SPECIAL FEATURES
Note:
18.1
PIC24HJ32GP202/204
and
PIC24HJ16GP304
devices include several features that are intended to
maximize application flexibility and reliability, and
minimize cost through elimination of external
components. These are:
Configuration Bits
Flexible configuration
Watchdog Timer (WDT)
Code Protection and CodeGuard Security
JTAG Boundary Scan Interface
In-Circuit Serial Programming (ICSP)
In-Circuit emulation
TABLE 18-1:
Address
0xF80000
Bit 7
Bit 6
Bit 5
Bit 4
FBS
0xF80002
Reserved
0xF80004
FGS
0xF80006
FOSCSEL
0xF80008
FOSC
Bit 3
IESO
FCKSM<1:0>
0xF8000A
FWDT
FWDTEN
WINDIS
WDTPRE
FPOR
ALTI2C
GSS<1:0>
GWRP
BKBUG
COE
JTAGEN
OSCIOFNC POSCMD<1:0>
WDTPOST<3:0>
0xF8000E
FICD
0xF80010
FUID0
0xF80012
FUID1
0xF80014
FUID2
FUID3
Note 1:
BWRP
FNOSC<2:0>
0xF8000C
0xF80016
Bit 0
(1)
IOL1WAY
Bit 1
BSS<2:0>
Reserved
Bit 2
FPWRT<2:0>
ICS<1:0>
Preliminary
DS70289B-page 171
Bit Field
Register
Description
BWRP
FBS
BSS<2:0>
FBS
BSS<2:0>
FBS
GSS<1:0>
FGS
GWRP
FGS
IESO
FOSCSEL
FNOSC<2:0>
FOSCSEL
DS70289B-page 172
Preliminary
Bit Field
Register
FCKSM<1:0>
FOSC
IOL1WAY
FOSC
OSCIOFNC
FOSC
POSCMD<1:0>
FOSC
FWDTEN
FWDT
WINDIS
FWDT
WDTPRE
FWDT
WDTPOST<3:0>
FWDT
ALTI2C
FPOR
FPWRT<2:0>
FPOR
BKBUG
FICD
COE
FICD
Description
Preliminary
DS70289B-page 173
Bit Field
Register
JTAGEN
FICD
ICS<1:0>
FICD
DS70289B-page 174
Description
Preliminary
18.3
All
of
the
PIC24HJ32GP202/204
and
PIC24HJ16GP304 devices power their core digital
logic at a nominal 2.5V. This can create a conflict for
designs that are required to operate at a higher typical
voltage, such as 3.3V. To simplify system design, all
devices
in
the
PIC24HJ32GP202/204
and
PIC24HJ16GP304 family incorporate an on-chip regulator that allows the device to run its core logic from
VDD.
The regulator provides power to the core from the other
VDD pins. When the regulator is enabled, a low-ESR
(less than 5 ohms) capacitor (such as tantalum or
ceramic) must be connected to the VDDCORE/VCAP pin
(Figure 18-1). This helps to maintain the stability of the
regulator. The recommended value for the filter capacitor is provided in Table 21-13 located in Section 21.1
DC Characteristics.
Note:
FIGURE 18-1:
3.3V
PIC24H
VDD
VDDCORE/VCAP
CF
Note 1:
2:
VSS
Preliminary
DS70289B-page 175
18.4.2
18.4.1
PRESCALER/POSTSCALER
18.4.3
ENABLING WDT
FIGURE 18-2:
Watchdog Timer
Sleep/Idle
WDTPRE
SWDTEN
FWDTEN
WDTPOST<3:0>
RS
Prescaler
(divide by N1)
LPRC Clock
WDT
Wake-up
1
RS
Postscaler
(divide by N2)
0
WINDIS
WDT
Reset
CLRWDT Instruction
DS70289B-page 176
Preliminary
JTAG Interface
PIC24HJ32GP202/204
and
PIC24HJ16GP304
devices implement a JTAG interface, which supports
boundary scan device testing, as well as in-circuit
programming. Detailed information on this interface will
be provided in future revisions of the document.
18.6
CONFIG BITS
Note:
TABLE 18-4:
CONFIG BITS
VS = 256 IW
BSS<2:0>=x11
0K
TABLE 18-3:
GS = 11008 IW
000000h
0001FEh
000200h
0007FEh
000800h
001FFEh
002000h
003FFEh
004000h
VS = 256 IW
BSS<2:0>=x11
0K
GS = 5376 IW
0057FEh
VS = 256 IW
BSS<2:0>=x10
BS = 768 IW
256
GS = 10240 IW
VS = 256 IW
BSS<2:0>=x01
BS = 3840 IW
768
GS = 7168 IW
VS = 256 IW
BSS<2:0>=x00
BS = 7936 IW
1792
GS = 3072 IW
000000h
0001FEh
000200h
0007FEh
000800h
001FFEh
002000h
003FFEh
004000h
002BFEh
VS = 256 IW
BSS<2:0>=x10
GS = 4608 IW
VS = 256 IW
BSS<2:0>=x01
BS = 3840 IW
768
GS = 1536 IW
0057FEh
000000h
0001FEh
000200h
0007FEh
000800h
001FFEh
002000h
003FFEh
004000h
BS = 768 IW
256
0057FEh
000000h
0001FEh
000200h
0007FEh
000800h
001FFEh
002000h
003FFEh
004000h
000000h
0001FEh
000200h
0007FEh
000800h
001FFEh
002000h
VS = 256 IW
BSS<2:0>=x00
1792
0057FEh
BS = 5376 IW
000000h
0001FEh
000200h
0007FEh
000800h
001FFEh
002000h
002BFEh
000000h
0001FEh
000200h
0007FEh
000800h
001FFEh
002000h
002BFEh
000000h
0001FEh
000200h
0007FEh
000800h
001FFEh
002000h
002BFEh
Preliminary
DS70289B-page 177
18.8
DS70289B-page 178
In-Circuit Debugger
Preliminary
Preliminary
DS70289B-page 179
Field
Description
#text
(text)
[text]
{ }
<n:m>
.b
.d
.S
.w
bit4
C, DC, N, OV, Z
MCU Status bits: Carry, Digit Carry, Negative, Overflow, Sticky Zero
Expr
lit1
lit4
lit5
lit8
lit10
10-bit unsigned literal {0...255} for Byte mode, {0:1023} for Word mode
lit14
lit16
lit23
None
PC
Program Counter
Slit10
Slit16
Slit6
Wb
Wd
Wdo
Destination W register
{ Wnd, [Wnd], [Wnd++], [Wnd--], [++Wnd], [--Wnd], [Wnd+Wb] }
Wm,Wn
Wm*Wm
Wn
Wnd
Wns
WREG
Ws
Wso
Source W register
{ Wns, [Wns], [Wns++], [Wns--], [++Wns], [--Wns], [Wns+Wb] }
DS70289B-page 180
Preliminary
Assembly
Mnemonic
ADD
ADDC
AND
ASR
BCLR
BRA
7
8
9
10
11
BSET
BSW
BTG
BTSC
BTSS
Assembly Syntax
Description
# of
# of
Words Cycles
Status Flags
Affected
f = f + WREG
ADD
f,WREG
WREG = f + WREG
C,DC,N,OV,Z
ADD
#lit10,Wn
Wd = lit10 + Wd
C,DC,N,OV,Z
ADD
Wb,Ws,Wd
Wd = Wb + Ws
C,DC,N,OV,Z
ADD
Wb,#lit5,Wd
Wd = Wb + lit5
C,DC,N,OV,Z
ADD
C,DC,N,OV,Z
ADDC
f = f + WREG + (C)
C,DC,N,OV,Z
ADDC
f,WREG
C,DC,N,OV,Z
ADDC
#lit10,Wn
Wd = lit10 + Wd + (C)
C,DC,N,OV,Z
ADDC
Wb,Ws,Wd
Wd = Wb + Ws + (C)
C,DC,N,OV,Z
ADDC
Wb,#lit5,Wd
Wd = Wb + lit5 + (C)
C,DC,N,OV,Z
AND
f = f .AND. WREG
N,Z
AND
f,WREG
N,Z
AND
#lit10,Wn
Wd = lit10 .AND. Wd
N,Z
AND
Wb,Ws,Wd
Wd = Wb .AND. Ws
N,Z
AND
Wb,#lit5,Wd
Wd = Wb .AND. lit5
N,Z
ASR
C,N,OV,Z
ASR
f,WREG
C,N,OV,Z
ASR
Ws,Wd
C,N,OV,Z
ASR
Wb,Wns,Wnd
N,Z
ASR
Wb,#lit5,Wnd
N,Z
BCLR
f,#bit4
Bit Clear f
None
BCLR
Ws,#bit4
Bit Clear Ws
None
BRA
C,Expr
Branch if Carry
1 (2)
None
BRA
GE,Expr
1 (2)
None
BRA
GEU,Expr
1 (2)
None
BRA
GT,Expr
1 (2)
None
BRA
GTU,Expr
1 (2)
None
BRA
LE,Expr
1 (2)
None
BRA
LEU,Expr
1 (2)
None
BRA
LT,Expr
1 (2)
None
BRA
LTU,Expr
1 (2)
None
BRA
N,Expr
Branch if Negative
1 (2)
None
BRA
NC,Expr
1 (2)
None
BRA
NN,Expr
1 (2)
None
BRA
NZ,Expr
1 (2)
None
BRA
Expr
Branch Unconditionally
None
BRA
Z,Expr
Branch if Zero
1 (2)
None
BRA
Wn
Computed Branch
None
BSET
f,#bit4
Bit Set f
None
BSET
Ws,#bit4
Bit Set Ws
None
BSW.C
Ws,Wb
None
BSW.Z
Ws,Wb
None
BTG
f,#bit4
Bit Toggle f
None
BTG
Ws,#bit4
Bit Toggle Ws
None
BTSC
f,#bit4
1
(2 or 3)
None
BTSC
Ws,#bit4
1
(2 or 3)
None
BTSS
f,#bit4
1
(2 or 3)
None
BTSS
Ws,#bit4
1
(2 or 3)
None
Preliminary
DS70289B-page 181
13
Assembly
Mnemonic
BTST
BTSTS
14
CALL
15
CLR
16
CLRWDT
17
COM
18
19
20
CP
CP0
CPB
Assembly Syntax
Description
# of
# of
Words Cycles
Status Flags
Affected
BTST
f,#bit4
Bit Test f
BTST.C
Ws,#bit4
Bit Test Ws to C
BTST.Z
Ws,#bit4
Bit Test Ws to Z
BTST.C
Ws,Wb
BTST.Z
Ws,Wb
BTSTS
f,#bit4
BTSTS.C
Ws,#bit4
BTSTS.Z
Ws,#bit4
CALL
lit23
Call subroutine
None
CALL
Wn
None
CLR
f = 0x0000
None
CLR
WREG
WREG = 0x0000
None
CLR
Ws
Ws = 0x0000
None
WDTO,Sleep
CLRWDT
COM
f=f
N,Z
COM
f,WREG
WREG = f
N,Z
COM
Ws,Wd
Wd = Ws
N,Z
CP
C,DC,N,OV,Z
CP
Wb,#lit5
C,DC,N,OV,Z
CP
Wb,Ws
C,DC,N,OV,Z
CP0
C,DC,N,OV,Z
CP0
Ws
C,DC,N,OV,Z
CPB
C,DC,N,OV,Z
CPB
Wb,#lit5
C,DC,N,OV,Z
CPB
Wb,Ws
C,DC,N,OV,Z
21
CPSEQ
CPSEQ
Wb, Wn
1
(2 or 3)
None
22
CPSGT
CPSGT
Wb, Wn
1
(2 or 3)
None
23
CPSLT
CPSLT
Wb, Wn
1
(2 or 3)
None
24
CPSNE
CPSNE
Wb, Wn
1
(2 or 3)
None
25
DAW
DAW
Wn
Wn = decimal adjust Wn
26
DEC
DEC
f=f-1
C,DC,N,OV,Z
DEC
f,WREG
WREG = f - 1
C,DC,N,OV,Z
DEC
Ws,Wd
Wd = Ws - 1
C,DC,N,OV,Z
DEC2
f=f-2
C,DC,N,OV,Z
DEC2
f,WREG
WREG = f - 2
C,DC,N,OV,Z
C,DC,N,OV,Z
27
DEC2
DEC2
Ws,Wd
Wd = Ws - 2
28
DISI
DISI
#lit14
None
29
DIV
DIV.S
Wm,Wn
18
N,Z,C,OV
DIV.SD
Wm,Wn
18
N,Z,C,OV
DIV.U
Wm,Wn
18
N,Z,C,OV
DIV.UD
Wm,Wn
18
N,Z,C,OV
30
EXCH
EXCH
Wns,Wnd
None
31
FBCL
FBCL
Ws,Wnd
32
FF1L
FF1L
Ws,Wnd
33
FF1R
FF1R
Ws,Wnd
34
GOTO
GOTO
Expr
Go to address
None
GOTO
Wn
Go to indirect
None
DS70289B-page 182
Preliminary
36
37
Assembly
Mnemonic
INC
INC2
IOR
38
LNK
39
LSR
40
MOV
Assembly Syntax
42
43
44
NEG
NOP
POP
f=f+1
f,WREG
WREG = f + 1
C,DC,N,OV,Z
INC
Ws,Wd
Wd = Ws + 1
C,DC,N,OV,Z
INC2
f=f+2
C,DC,N,OV,Z
INC2
f,WREG
WREG = f + 2
C,DC,N,OV,Z
INC2
Ws,Wd
Wd = Ws + 2
C,DC,N,OV,Z
PUSH
N,Z
IOR
f = f .IOR. WREG
f,WREG
N,Z
IOR
#lit10,Wn
Wd = lit10 .IOR. Wd
N,Z
IOR
Wb,Ws,Wd
Wd = Wb .IOR. Ws
N,Z
IOR
Wb,#lit5,Wd
Wd = Wb .IOR. lit5
N,Z
LNK
#lit14
None
C,N,OV,Z
LSR
LSR
f,WREG
C,N,OV,Z
LSR
Ws,Wd
C,N,OV,Z
LSR
Wb,Wns,Wnd
N,Z
LSR
Wb,#lit5,Wnd
N,Z
MOV
f,Wn
Move f to Wn
None
MOV
Move f to f
N,Z
MOV
f,WREG
Move f to WREG
N,Z
MOV
#lit16,Wn
None
MOV.b
#lit8,Wn
None
MOV
Wn,f
Move Wn to f
None
MOV
Wso,Wdo
Move Ws to Wd
None
MOV
WREG,f
Move WREG to f
N,Z
Wns,Wd
None
Ws,Wnd
None
MUL.SS
Wb,Ws,Wnd
None
MUL.SU
Wb,Ws,Wnd
None
MUL.US
Wb,Ws,Wnd
None
MUL.UU
Wb,Ws,Wnd
None
MUL.SU
Wb,#lit5,Wnd
None
MUL.UU
Wb,#lit5,Wnd
None
MUL
W3:W2 = f * WREG
None
NEG
f=f+1
C,DC,N,OV,Z
NEG
f,WREG
WREG = f + 1
C,DC,N,OV,Z
NEG
Ws,Wd
Wd = Ws + 1
C,DC,N,OV,Z
NOP
No Operation
None
NOPR
No Operation
None
POP
None
POP
Wdo
None
POP.D
Wnd
None
All
None
PUSH
Wso
None
PUSH.D
Wns
None
PUSH
PUSH.S
46
PWRSAV
C,DC,N,OV,Z
IOR
POP.S
45
Status Flags
Affected
INC
MOV.D
MUL
# of
# of
Words Cycles
INC
MOV.D
41
Description
PWRSAV
#lit1
None
WDTO,Sleep
Preliminary
DS70289B-page 183
Assembly
Mnemonic
RCALL
REPEAT
Assembly Syntax
Description
# of
# of
Words Cycles
Status Flags
Affected
RCALL
Expr
Relative Call
None
RCALL
Wn
Computed Call
None
REPEAT
#lit14
None
REPEAT
Wn
None
49
RESET
RESET
None
50
RETFIE
RETFIE
3 (2)
None
51
RETLW
RETLW
52
RETURN
RETURN
53
RLC
RLC
RLC
RLC
54
55
56
RLNC
RRC
RRNC
3 (2)
None
3 (2)
None
C,N,Z
f,WREG
C,N,Z
Ws,Wd
C,N,Z
N,Z
#lit10,Wn
RLNC
RLNC
f,WREG
N,Z
RLNC
Ws,Wd
N,Z
RRC
C,N,Z
RRC
f,WREG
C,N,Z
RRC
Ws,Wd
C,N,Z
RRNC
N,Z
RRNC
f,WREG
N,Z
RRNC
Ws,Wd
N,Z
57
SE
SE
Ws,Wnd
Wnd = sign-extended Ws
C,N,Z
58
SETM
SETM
f = 0xFFFF
None
SETM
WREG
WREG = 0xFFFF
None
SETM
Ws
Ws = 0xFFFF
None
SL
f = Left Shift f
C,N,OV,Z
SL
f,WREG
C,N,OV,Z
SL
Ws,Wd
Wd = Left Shift Ws
C,N,OV,Z
SL
Wb,Wns,Wnd
N,Z
SL
Wb,#lit5,Wnd
N,Z
59
60
61
62
63
64
65
SL
SUB
SUBB
SUBR
SUBBR
SWAP
TBLRDH
SUB
f = f - WREG
C,DC,N,OV,Z
SUB
f,WREG
WREG = f - WREG
C,DC,N,OV,Z
SUB
#lit10,Wn
Wn = Wn - lit10
C,DC,N,OV,Z
SUB
Wb,Ws,Wd
Wd = Wb - Ws
C,DC,N,OV,Z
SUB
Wb,#lit5,Wd
Wd = Wb - lit5
C,DC,N,OV,Z
SUBB
f = f - WREG - (C)
C,DC,N,OV,Z
SUBB
f,WREG
C,DC,N,OV,Z
SUBB
#lit10,Wn
Wn = Wn - lit10 - (C)
C,DC,N,OV,Z
C,DC,N,OV,Z
SUBB
Wb,Ws,Wd
Wd = Wb - Ws - (C)
SUBB
Wb,#lit5,Wd
Wd = Wb - lit5 - (C)
SUBR
f = WREG - f
SUBR
f,WREG
WREG = WREG - f
C,DC,N,OV,Z
SUBR
Wb,Ws,Wd
Wd = Ws - Wb
C,DC,N,OV,Z
SUBR
Wb,#lit5,Wd
Wd = lit5 - Wb
C,DC,N,OV,Z
C,DC,N,OV,Z
C,DC,N,OV,Z
SUBBR
f = WREG - f - (C)
C,DC,N,OV,Z
SUBBR
f,WREG
C,DC,N,OV,Z
SUBBR
Wb,Ws,Wd
Wd = Ws - Wb - (C)
C,DC,N,OV,Z
SUBBR
Wb,#lit5,Wd
Wd = lit5 - Wb - (C)
C,DC,N,OV,Z
SWAP.b
Wn
Wn = nibble swap Wn
None
SWAP
Wn
Wn = byte swap Wn
None
TBLRDH
Ws,Wd
None
DS70289B-page 184
Preliminary
Assembly
Mnemonic
Assembly Syntax
Description
# of
# of
Words Cycles
Status Flags
Affected
66
TBLRDL
TBLRDL
Ws,Wd
Read Prog<15:0> to Wd
None
67
TBLWTH
TBLWTH
Ws,Wd
None
68
TBLWTL
TBLWTL
Ws,Wd
Write Ws to Prog<15:0>
None
69
ULNK
ULNK
None
70
XOR
XOR
f = f .XOR. WREG
N,Z
XOR
f,WREG
N,Z
XOR
#lit10,Wn
Wd = lit10 .XOR. Wd
N,Z
XOR
Wb,Ws,Wd
Wd = Wb .XOR. Ws
N,Z
XOR
Wb,#lit5,Wd
Wd = Wb .XOR. lit5
N,Z
ZE
Ws,Wnd
Wnd = Zero-extend Ws
C,Z,N
71
ZE
Preliminary
DS70289B-page 185
DS70289B-page 186
Preliminary
DEVELOPMENT SUPPORT
20.1
Preliminary
DS70289B-page 187
MPASM Assembler
20.5
20.3
20.6
20.4
DS70289B-page 188
Preliminary
20.9
20.8
Preliminary
DS70289B-page 189
DS70289B-page 190
Preliminary
ELECTRICAL CHARACTERISTICS
Preliminary
DS70289B-page 191
DC Characteristics
TABLE 21-1:
Characteristic
TABLE 21-2:
Max MIPS
VDD Range
(in Volts)
Temp Range
(in C)
3.0-3.6V
-40C to +85C
40
3.0-3.6V
-40C to +125C
40
PIC24HJ32GP202/204 and
PIC24HJ16GP304
Symbol
Min
Typ
Max
Unit
TJ
-40
+125
TA
-40
+85
TJ
-40
+140
TA
-40
+125
Power Dissipation:
Internal chip power dissipation:
PINT = VDD x (IDD - IOH)
PD
PINT + PI/O
PDMAX
(TJ - TA)/JA
TABLE 21-3:
Symbol
Typ
Max
Unit
Notes
JA
JA
JA
JA
JA
32
C/W
45
C/W
45
C/W
50
C/W
35
C/W
Junction to ambient thermal resistance, Theta-JA (JA) numbers are achieved by package simulations.
DS70289B-page 192
Preliminary
DC CHARACTERISTICS
Param
Symbol
No.
Characteristic
Min
Typ(1)
Max
Units
3.0
3.6
Conditions
Operating Voltage
DC10
Supply Voltage
VDD
(2)
DC12
VDR
1.1
1.8
DC16
VPOR
VSS
DC17
SVDD
0.03
DC18
VCORE
VDD Core(3)
Internal regulator voltage
2.25
2.75
Note 1:
2:
3:
Voltage is dependent on
load, temperature and
VDD
Preliminary
DS70289B-page 193
DC CHARACTERISTICS
Parameter
No.
Typical(1)
Max
Units
Conditions
24
30
mA
-40C
DC20a
27
30
mA
+25C
DC20b
27
30
mA
+85C
DC20c
27
35
mA
+125C
DC21d
30
40
mA
-40C
DC21a
37
40
mA
+25C
DC21b
32
45
mA
+85C
DC21c
33
45
mA
+125C
DC22d
35
50
mA
-40C
DC22a
38
50
mA
+25C
DC22b
38
55
mA
+85C
DC22c
39
55
mA
+125C
DC23d
47
70
mA
-40C
DC23a
48
70
mA
+25C
DC23b
48
70
mA
+85C
DC23c
48
70
mA
+125C
DC24d
56
90
mA
-40C
DC24a
56
90
mA
+25C
DC24b
54
90
mA
+85C
DC24c
54
90
mA
+125C
Note 1:
2:
3.3V
10 MIPS
3.3V
16 MIPS
3.3V
20 MIPS
3.3V
30 MIPS
3.3V
40 MIPS
DS70289B-page 194
Preliminary
DC CHARACTERISTICS
Parameter
No.
Typical(1)
Max
Units
Conditions
25
mA
-40C
DC40a
25
mA
+25C
DC40b
25
mA
+85C
DC40c
25
mA
+125C
DC41d
25
mA
-40C
DC41a
25
mA
+25C
DC41b
25
mA
+85C
DC41c
25
mA
+125C
DC42d
25
mA
-40C
DC42a
25
mA
+25C
DC42b
25
mA
+85C
DC42c
25
mA
+125C
DC43d
25
mA
-40C
DC43a
25
mA
+25C
DC43b
25
mA
+85C
DC43c
25
mA
+125C
DC44d
10
25
mA
-40C
DC44a
10
25
mA
+25C
DC44b
16
25
mA
+85C
DC44c
10
25
mA
+125C
Note 1:
2:
3.3V
10 MIPS
3.3V
16 MIPS
3.3V
20 MIPS
3.3V
30 MIPS
3.3V
40 MIPS
Preliminary
DS70289B-page 195
DC CHARACTERISTICS
Parameter
No.
Typical(1)
Max
Units
Conditions
55
500
-40C
DC60a
63
500
+25C
DC60b
85
500
+85C
DC60c
146
mA
+125C
DC61d
12
-40C
DC61a
10
15
+25C
DC61b
12
20
+85C
DC61c
13
25
+125C
Note 1:
2:
3:
4:
3.3V
3.3V
TABLE 21-8:
DC CHARACTERISTICS
Doze
Ratio
Units
32
1:2
mA
27
1:64
mA
Parameter No.
Typical(1)
Max
DC73a
25
DC73f
23
DC73g
23
26
1:128
mA
DC70a
42
47
1:2
mA
DC70f
26
27
1:64
mA
DC70g
25
27
1:128
mA
DC71a
41
48
1:2
mA
DC71f
25
28
1:64
mA
DC71g
24
28
1:128
mA
DC72a
42
49
1:2
mA
DC72f
26
29
1:64
mA
DC72g
25
28
1:128
mA
Note 1:
Conditions
-40C
3.3V
40 MIPS
+25C
3.3V
40 MIPS
+85C
3.3V
40 MIPS
+125C
3.3V
40 MIPS
DS70289B-page 196
Preliminary
DC CHARACTERISTICS
Param
Symbol
No.
VIL
Characteristic
Min
Typ(1)
Max
Units
Conditions
DI10
I/O pins
VSS
0.2 VDD
DI15
MCLR
VSS
0.2 VDD
DI16
VSS
0.2 VDD
DI17
VSS
0.2 VDD
DI18
SDAx, SCLx
VSS
0.3 VDD
SMBus disabled
DI19
SDAx, SCLx
VSS
0.2 VDD
SMBus enabled
I/O pins:
with analog functions(4)
digital-only(4)
0.8 VDD
0.8 VDD
VDD
5.5
V
V
DI25
MCLR
0.8 VDD
VDD
DI26
0.7 VDD
VDD
VIH
DI20
DI27
0.7 VDD
VDD
DI28
SDAx, SCLx
0.7 VDD
VDD
SMBus disabled
SDAx, SCLx
0.8 VDD
VDD
SMBus enabled
50
250
400
DI29
ICNPU
IIL
DI30
DI50
I/O ports
DI51
DI51a
DI51b
3.5
DI51c
DI55
MCLR
DI56
OSC1
Note 1:
2:
3:
4:
Preliminary
DS70289B-page 197
DC CHARACTERISTICS
Param
Symbol
No.
VOL
Characteristic
Min
Typ
Max
Units
Conditions
DO10
I/O ports
0.4
DO16
OSC2/CLKO
0.4
VOH
DO20
I/O ports
2.40
DO26
OSC2/CLKO
2.41
Symbol
Min(1)
Typ
Max
Units
Conditions
2.40
2.55
BO10
VBOR
Note 1:
Parameters are for design guidance only and are not tested in manufacturing.
DS70289B-page 198
Preliminary
DC CHARACTERISTICS
Param
Symbol
No.
Characteristic
Min
Typ(1)
Max
10,000
Units
Conditions
EP
Cell Endurance
D131
VPR
VMIN
3.6
D132B
VPEW
VMIN
3.6
D134
TRETD
Characteristic Retention
20
D135
IDDP
10
mA
D136a
TRW
1.32
1.74
ms
D136b
TRW
1.28
1.79
ms
D137a
TPE
20.1
26.5
ms
D137b
TPE
19.5
27.3
ms
D138a
TWW
42.3
55.9
D138b
TWW
41.1
57.6
Note 1:
2:
Symbol
CEFC
Characteristics
External Filter Capacitor
Value
Min
Typ
Max
Units
10
Preliminary
Comments
Capacitor must be low
series resistance
(< 5 ohms)
DS70289B-page 199
AC CHARACTERISTICS
FIGURE 21-1:
VDD/2
CL
Pin
RL
VSS
CL
Pin
RL = 464
CL = 50 pF for all pins except OSC2
15 pF for OSC2 output
VSS
Characteristic
Min
Typ
Max
Units
Conditions
DO50
COSC2
OSC2/SOSC2 pin
15
pF
DO56
CIO
50
pF
EC mode
DO58
CB
SCLx, SDAx
400
pF
In I2C mode
DS70289B-page 200
Preliminary
Q2
Q3
Q4
Q1
Q2
Q3
Q4
OSC1
OS20
OS30
OS25
OS30
OS31
OS31
CLKO
OS41
OS40
AC CHARACTERISTICS
Param
No.
OS10
Symb
FIN
Min
Typ(1)
Max
Units
DC
40
MHz
EC
3.5
10
10
40
33
MHz
MHz
kHz
XT
HS
SOSC
Characteristic
Conditions
OS20
TOSC
TOSC = 1/FOSC
12.5
DC
ns
OS25
TCY
25
DC
ns
OS30
TosL,
TosH
0.375 x TOSC
0.625 x TOSC
ns
EC
OS31
TosR,
TosF
20
ns
EC
OS40
TckR
5.2
ns
5.2
ns
OS41
TckF
Note 1:
2:
3:
CLKO Fall
Time(3)
Preliminary
DS70289B-page 201
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic
Min
Typ(1)
Max
Units
Conditions
OS50
FPLLI
0.8
MHz
OS51
FSYS
100
200
MHz
OS52
TLOCK
0.9
1.5
3.1
ms
OS53
DCLK
-3
0.5
Note 1:
Characteristic
Typ
Max
Units
Conditions
FRC
-2
+2
-40C TA +85C
VDD = 3.0-3.6V
FRC
-5
+5
-40C TA +125C
VDD = 3.0-3.6V
Frequency calibrated at 25C and 3.3V. TUN bits can be used to compensate for temperature drift.
FRC is set to initial frequency of 7.37 MHz (2%) at 25C.
Characteristic
Typ
Max
Units
LPRC
-20
LPRC
-70
Conditions
+20
-40C TA +85C
VDD = 3.0-3.6V
+70
-40C TA +125C
VDD = 3.0-3.6V
DS70289B-page 202
Preliminary
I/O Pin
(Input)
DI35
DI40
I/O Pin
(Output)
New Value
Old Value
DO31
DO32
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic
Typ(1)
Max
Units
Conditions
10
25
ns
DO31
TIOR
DO32
TIOF
10
25
ns
DI35
TINP
20
ns
TRBP
TCY
DI40
Note 1:
Min
Preliminary
DS70289B-page 203
VDD
SY12
MCLR
SY10
Internal
POR
PWRT
Time-out
OSC
Time-out
SY11
SY30
Internal
Reset
Watchdog
Timer
Reset
SY13
SY20
SY13
I/O Pins
SY35
FSCM
Delay
Note: Refer to Figure 21-1 for load conditions.
DS70289B-page 204
Preliminary
AC CHARACTERISTICS
Param
Symbol
No.
Characteristic(1)
Min
Typ(2)
Max
Units
Conditions
SY10
TMCL
-40C to +85C
SY11
TPWRT
2
4
8
16
32
64
128
ms
-40C to +85C
User programmable
SY12
TPOR
10
30
-40C to +85C
SY13
TIOZ
0.68
0.72
1.2
SY20
TWDT1
ms
SY30
TOST
1024
TOSC
SY35
TFSCM
500
900
-40C to +85C
Note 1:
2:
Preliminary
DS70289B-page 205
TxCK
Tx11
Tx10
Tx15
OS60
Tx20
TMRx
AC CHARACTERISTICS
Param
No.
TA10
TA11
TA15
Symbol
TTXH
TTXL
TTXP
Characteristic
TxCK High Time
Min
Typ
Max
Units
Conditions
Synchronous,
no prescaler
0.5 TCY + 20
ns
Synchronous,
with prescaler
10
ns
Asynchronous
10
ns
Synchronous,
no prescaler
0.5 TCY + 20
ns
Synchronous,
with prescaler
10
ns
Asynchronous
10
ns
TCY + 40
ns
Synchronous,
with prescaler
Greater of:
20 ns or
(TCY + 40)/N
Asynchronous
20
ns
DC
50
kHz
1.5 TCY
OS60
Ft1
TA20
Note 1:
0.5 TCY
N = prescale
value
(1, 8, 64, 256)
Timer1 is a Type A.
DS70289B-page 206
Preliminary
AC CHARACTERISTICS
Param
No.
TB10
TB11
TB15
TB20
Symbol
TtxH
TtxL
TtxP
TCKEXTMRL
Characteristic
TxCK High Time
TxCK Input
Period
Min
Typ
Max
Units
Conditions
Synchronous,
no prescaler
0.5 TCY + 20
ns
Synchronous,
with prescaler
10
ns
Synchronous,
no prescaler
0.5 TCY + 20
ns
Synchronous,
with prescaler
10
ns
Synchronous,
no prescaler
TCY + 40
ns
Synchronous,
with prescaler
Greater of:
20 ns or
(TCY + 40)/N
1.5 TCY
0.5 TCY
N = prescale
value
(1, 8, 64, 256)
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic
Min
Typ
Max
Units
Conditions
TC10
TtxH
Synchronous
0.5 TCY + 20
ns
TC11
TtxL
Synchronous
0.5 TCY + 20
ns
TC15
TtxP
TCY + 40
ns
N = prescale
value
(1, 8, 64, 256)
1.5
TCY
Synchronous,
with prescaler
TC20
Greater of:
20 ns or
(TCY + 40)/N
0.5 TCY
Preliminary
DS70289B-page 207
IC10
IC11
IC15
AC CHARACTERISTICS
Param
No.
Symbol
IC10
TccL
No Prescaler
IC11
TccH
No Prescaler
IC15
TccP
Characteristic(1)
Min
Max
Units
Conditions
0.5 TCY + 20
ns
With Prescaler
10
ns
0.5 TCY + 20
ns
10
ns
(TCY + 40)/N
ns
With Prescaler
Note 1:
N = prescale
value (1, 4, 16)
FIGURE 21-7:
OCx
(Output Compare
or PWM Mode)
OC10
OC11
Characteristic(1)
Typ
Max
Units
Conditions
OC10
TccF
ns
OC11
TccR
ns
Note 1:
DS70289B-page 208
Preliminary
OCFA/OCFB
OC15
OCx
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic(1)
Min
Typ
Max
Units
Conditions
OC15
TFD
50
ns
OC20
TFLT
50
ns
Note 1:
Preliminary
DS70289B-page 209
SCKx
(CKP = 0)
SP11
SP10
SP21
SP20
SP20
SP21
SCKx
(CKP = 1)
SP35
Bit 14 - - - - - -1
MSb
SDOx
SP31
SDIx
LSb
SP30
MSb In
LSb In
Bit 14 - - - -1
SP40 SP41
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic(1)
Min
Typ(2)
Max
Units
Conditions
SP10
TscL
TCY/2
ns
See Note 3
SP11
TscH
TCY/2
ns
See Note 3
SP20
TscF
ns
SP21
TscR
ns
SP30
TdoF
ns
SP31
TdoR
ns
SP35
TscH2doV,
TscL2doV
20
ns
SP40
TdiV2scH,
TdiV2scL
23
ns
SP41
TscH2diL,
TscL2diL
30
ns
Note 1:
2:
3:
4:
DS70289B-page 210
Preliminary
SCKX
(CKP = 0)
SP11
SCKX
(CKP = 1)
SP10
SP21
SP20
SP20
SP21
SP35
SP40
SDIX
LSb
Bit 14 - - - - - -1
MSb
SDOX
SP30,SP31
MSb In
Bit 14 - - - -1
LSb In
SP41
Note: Refer to Figure 21-1 for load conditions.
AC CHARACTERISTICS
Param
No.
SP10
Symbol
TscL
Characteristic(1)
Min
Typ(2)
Max
Units
TCY/2
ns
Conditions
See Note 3
SP11
TscH
TCY/2
ns
See Note 3
SP20
TscF
ns
SP21
TscR
ns
SP30
TdoF
ns
SP31
TdoR
ns
SP35
20
ns
SP36
30
ns
SP40
23
ns
SP41
TscH2diL,
TscL2diL
30
ns
Note 1:
2:
3:
4:
Preliminary
DS70289B-page 211
SSX
SP52
SP50
SCKX
(CKP = 0)
SP71
SP70
SP73
SP72
SP72
SP73
SCKX
(CKP = 1)
SP35
MSb
SDOX
LSb
Bit 14 - - - - - -1
SP51
SP30,SP31
SDIX
Bit 14 - - - -1
MSb In
LSb In
SP41
SP40
Note: Refer to Figure 21-1 for load conditions.
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic(1)
Min
Typ(2)
Max
Units
Conditions
SP70
TscL
30
ns
SP71
TscH
30
ns
SP72
TscF
10
25
ns
See Note 3
SP73
TscR
10
25
ns
See Note 3
SP30
TdoF
ns
SP31
TdoR
ns
SP35
30
ns
SP40
TdiV2scH,
TdiV2scL
20
ns
SP41
TscH2diL,
TscL2diL
20
ns
SP50
TssL2scH,
TssL2scL
120
ns
SP51
TssH2doZ
10
50
ns
See Note 3
SP52
ns
Note 1:
2:
3:
DS70289B-page 212
Preliminary
SSx
SP52
SP50
SCKx
(CKP = 0)
SP71
SP70
SP73
SP72
SP72
SP73
SCKx
(CKP = 1)
SP35
SP52
MSb
SDOx
Bit 14 - - - - - -1
LSb
SP30,SP31
SDI
SDIx
MSb In
SP51
Bit 14 - - - -1
LSb In
SP41
SP40
Note: Refer to Figure 21-1 for load conditions.
Preliminary
DS70289B-page 213
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic(1)
Min
Typ(2)
Max
Units
Conditions
SP70
TscL
30
ns
SP71
TscH
30
ns
SP72
TscF
10
25
ns
See Note 3
SP73
TscR
10
25
ns
See Note 3
SP30
TdoF
ns
SP31
TdoR
ns
SP35
30
ns
SP40
20
ns
SP41
TscH2diL,
TscL2diL
20
ns
SP50
120
ns
SP51
TssH2doZ
10
50
ns
See Note 4
SP52
TscH2ssH
TscL2ssH
1.5 TCY + 40
ns
SP60
TssL2doV
50
ns
Note 1:
2:
3:
4:
DS70289B-page 214
Preliminary
SCLx
IM31
IM34
IM30
IM33
SDAx
Stop
Condition
Start
Condition
Note: Refer to Figure 21-1 for load conditions.
FIGURE 21-14:
IM21
IM11
IM10
SCLx
IM11
IM26
IM10
IM25
IM33
SDAx
In
IM40
IM40
IM45
SDAx
Out
Note: Refer to Figure 21-1 for load conditions.
Preliminary
DS70289B-page 215
AC CHARACTERISTICS
Param
Symbol
No.
IM10
Min(1)
Max
Units
Conditions
TCY/2 (BRG + 1)
TCY/2 (BRG + 1)
mode(2)
TCY/2 (BRG + 1)
TCY/2 (BRG + 1)
TCY/2 (BRG + 1)
1 MHz mode(2)
TCY/2 (BRG + 1)
300
ns
20 + 0.1 CB
300
ns
Characteristic
1 MHz
IM11
THI:SCL
IM20
TF:SCL
IM21
TR:SCL
IM25
100
ns
1000
ns
IM26
IM30
TSU:STA
IM31
Start Condition
Setup Time
IM33
IM34
IM40
TAA:SCL
Output Valid
From Clock
20 + 0.1 CB
300
ns
1 MHz mode(2)
300
ns
250
ns
100
ns
1 MHz mode(2)
40
ns
0.9
1 MHz mode(2)
0.2
TCY/2 (BRG + 1)
TCY/2 (BRG + 1)
1 MHz mode(2)
TCY/2 (BRG + 1)
TCY/2 (BRG + 1)
TCY/2 (BRG + 1)
1 MHz mode(2)
TCY/2 (BRG + 1)
TCY/2 (BRG + 1)
TCY/2 (BRG + 1)
1 MHz mode(2)
TCY/2 (BRG + 1)
TCY/2 (BRG + 1)
ns
IM50
CB
Note 1:
2:
CB is specified to be
from 10 to 400 pF
TCY/2 (BRG + 1)
ns
1 MHz mode(2)
TCY/2 (BRG + 1)
ns
3500
ns
1000
ns
mode(2)
400
ns
4.7
1.3
1 MHz mode(2)
0.5
400
pF
1 MHz
IM45
CB is specified to be
from 10 to 400 pF
BRG is the value of the I2C Baud Rate Generator. Refer to Section 19. Inter-Integrated Circuit (I2C)
in the PIC24H Family Reference Manual.
Maximum pin capacitance = 10 pF for all I2Cx pins (for 1 MHz mode only).
DS70289B-page 216
Preliminary
SCLx
IS34
IS31
IS30
IS33
SDAx
Stop
Condition
Start
Condition
FIGURE 21-16:
IS21
IS11
IS10
SCLx
IS30
IS26
IS31
IS25
IS33
SDAx
In
IS40
IS40
IS45
SDAx
Out
Preliminary
DS70289B-page 217
AC CHARACTERISTICS
Param Symbol
IS10
IS11
IS20
IS21
IS25
IS26
IS30
IS31
IS33
IS34
THI:SCL
TF:SCL
TR:SCL
IS45
IS50
Note 1:
IS40
Characteristic
Stop Condition
Hold Time
CB
Min
Max
Units
4.7
1.3
1 MHz mode(1)
0.5
4.0
0.6
1 MHz mode(1)
0.5
300
ns
ns
20 + 0.1 CB
300
1 MHz mode(1)
100
ns
1000
ns
ns
20 + 0.1 CB
300
1 MHz mode(1)
300
ns
250
ns
100
ns
1 MHz mode(1)
100
ns
0.9
1 MHz mode(1)
0.3
4.7
s
s
0.6
1 MHz mode(1)
0.25
4.0
0.6
1 MHz mode(1)
0.25
4.7
0.6
1 MHz mode(1)
0.6
4000
ns
600
ns
1 MHz mode(1)
250
3500
ns
1000
ns
1 MHz mode(1)
350
ns
CB is specified to be from
10 to 400 pF
CB is specified to be from
10 to 400 pF
ns
4.7
1.3
1 MHz mode(1)
0.5
400
pF
Conditions
Maximum pin capacitance = 10 pF for all I2Cx pins (for 1 MHz mode only).
DS70289B-page 218
Preliminary
Characteristic
Typ
Max.
Units
Lesser of
VDD + 0.3
or 3.6
VSS + 0.3
Conditions
Device Supply
AD01
AVDD
AD02
AVSS
AD05
VREFH
Greater of
VDD 0.3
or 3.0
VSS 0.3
Reference Inputs
AD05a
AD06
VREFL
AD06a
AVSS + 2.7
AVDD
See Note 1
3.0
3.6
VREFH = AVDD
VREFL = AVSS = 0
AVSS
AVDD 2.7
See Note 1
VREFH = AVDD
VREFL = AVSS = 0
AD07
VREF
2.7
3.6
AD08
IREF
Current Drain
400
550
10
A
A
ADC operating
ADC off
Analog Input
AD12
VINH
VINL
VREFH
AD13
VINL
VREFL
AVSS + 1V
AD17
RIN
Recommended Impedance
of Analog Voltage Source
200
200
10-bit ADC
12-bit ADC
Note 1:
Preliminary
DS70289B-page 219
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic
Min.
Typ
Max.
Units
Conditions
Nr
Resolution
AD21a
INL
Integral Nonlinearity
-2
+2
LSb
AD22a
DNL
Differential Nonlinearity
>-1
<1
LSb
AD23a
GERR
Gain Error
1.25
1.5
LSb
AD24a
EOFF
Offset Error
1.25
1.52
LSb
Monotonicity
AD25a
12 data bits
bits
Guaranteed(1)
Nr
Resolution
bits
AD21a
INL
Integral Nonlinearity
-2
+2
LSb
AD22a
DNL
Differential Nonlinearity
>-1
<1
LSb
AD23a
GERR
Gain Error
LSb
AD24a
EOFF
AD25a
12 data bits
Offset Error
LSb
Monotonicity
THD
-77
-69
-61
dB
AD31a
SINAD
59
63
64
dB
AD32a
SFDR
63
72
74
dB
AD33a
FNYQ
250
kHz
AD34a
ENOB
10.95
11.1
bits
Note 1:
The A/D conversion result never decreases with an increase in the input voltage, and has no missing
codes.
DS70289B-page 220
Preliminary
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic
Min.
Typ
Max.
Units
Conditions
Nr
Resolution
AD21b
INL
Integral Nonlinearity
-1.5
10 data bits
+1.5
LSb
bits
AD22b
DNL
Differential Nonlinearity
>-1
<1
LSb
AD23b
GERR
Gain Error
LSb
AD24b
EOFF
Offset Error
LSb
AD25b
Monotonicity
Guaranteed(1)
Nr
Resolution
bits
AD21b
INL
Integral Nonlinearity
-1
10 data bits
+1
LSb
AD22b
DNL
Differential Nonlinearity
>-1
<1
LSb
AD23b
GERR
Gain Error
LSb
AD24b
EOFF
Offset Error
LSb
AD25b
Monotonicity
AD30b
THD
-64
-67
dB
AD31b
SINAD
57
58
dB
AD32b
SFDR
60
62
dB
AD33b
FNYQ
550
kHz
AD34b
ENOB
9.1
9.7
9.8
bits
Note 1:
The A/D conversion result never decreases with an increase in the input voltage, and has no missing
codes.
Preliminary
DS70289B-page 221
ADCLK
Instruction
Execution
Set SAMP
Clear SAMP
SAMP
AD61
AD60
TSAMP
AD55
DONE
AD1IF
7 Convert bit 1.
8 Convert bit 0.
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic
Min.
Typ
Max.
Units
Conditions
Clock Parameters
AD50
TAD
AD51
tRC
117.6
ns
250
ns
Conversion Rate
AD55
tCONV
Conversion Time
14 TAD
ns
AD56
FCNV
Throughput Rate
500
Ksps
AD57
TSAMP
Sample Time
3.0 TAD
Timing Parameters
AD60
tPCS
2.0 TAD
3.0 TAD
AD61
tPSS
2.0 TAD
3.0 TAD
AD62
tCSS
Conversion Completion to
Sample Start (ASAM = 1)(2)
0.5 TAD
AD63
tDPU
20
Note 1:
2:
Because the sample caps will eventually lose charge, clock rates below 10 kHz can affect linearity
performance, especially at elevated temperatures.
These parameters are characterized but not tested in manufacturing.
DS70289B-page 222
Preliminary
ADCLK
Instruction
Execution Set SAMP
Clear SAMP
SAMP
AD61
AD60
AD55
TSAMP
AD55
DONE
AD1IF
Buffer(0)
Buffer(1)
5 Convert bit 9.
6 Convert bit 8.
7 Convert bit 0.
8 One TAD for end of conversion.
FIGURE 21-19:
AD50
ADCLK
Instruction
Set ADON
Execution
SAMP
TSAMP
AD55
TSAMP
AD55
AD55
AD1IF
DONE
5 Convert bit 0.
3 Convert bit 9.
4 Convert bit 8.
Preliminary
DS70289B-page 223
AC CHARACTERISTICS
Param
Symbol
No.
Characteristic
Min.
Typ(1)
Max.
Units
Conditions
Clock Parameters
AD50
TAD
76
ns
AD51
tRC
250
ns
Conversion Rate
AD55
tCONV
Conversion Time
AD56
FCNV
Throughput Rate
AD57
TSAMP
Sample Time
AD60
tPCS
2.0 TAD
AD61
tPSS
AD62
tCSS
AD63
tDPU
12 TAD
1.1
Msps
2.0 TAD
3.0 TAD
2.0 TAD
3.0 TAD
Conversion Completion to
Sample Start (ASAM = 1)(1)
0.5 TAD
20
Timing Parameters
Note 1:
2:
Auto-Convert Trigger
not selected
DS70289B-page 224
Preliminary
PACKAGING INFORMATION
22.1
Example
PIC24HJ32GP202-I/SP e3
0610017
XXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX
YYWWNNN
Example
XXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXX
YYWWNNN
28-Lead QFN-S
PIC24HJ32GP202/SO e3
0610017
Example
XXXXXXXX
XXXXXXXX
YYWWNNN
Legend: XX...X
Y
YY
WW
NNN
e3
*
Note:
24HJ32GP
202E/MM e3
0730235
Customer-specific information
Year code (last digit of calendar year)
Year code (last 2 digits of calendar year)
Week code (week of January 1 is week 01)
Alphanumeric traceability code
Pb-free JEDEC designator for Matte Tin (Sn)
This package is Pb-free. The Pb-free JEDEC designator ( e3 )
can be found on the outer packaging for this package.
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.
Preliminary
DS70289B-page 225
44-Lead QFN
Example
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
YYWWNNN
PIC24HJ32
GP204-E/ML e3
0730235
44-Lead TQFP
Example
PIC24HJ
32GP204
-E/PT e3
0730235
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
YYWWNNN
Legend: XX...X
Y
YY
WW
NNN
e3
*
Note:
DS70289B-page 226
Customer-specific information
Year code (last digit of calendar year)
Year code (last 2 digits of calendar year)
Week code (week of January 1 is week 01)
Alphanumeric traceability code
Pb-free JEDEC designator for Matte Tin (Sn)
This package is Pb-free. The Pb-free JEDEC designator ( e3 )
can be found on the outer packaging for this package.
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.
Preliminary
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
28-Lead Skinny Plastic Dual In-Line (SP) 300 mil Body [SPDIP]
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
D
E
E1
NOTE 1
E1
NOTE 1
1 2 3
b
D
h
A2
L
A1
A1
Unitse
Dimension Limits
Number of Pins
Pitch
Overall Height
Number of Pins
L1
b1
b
A2
MILLMETERS
MIN
A2
NOM
2.05
28
.100 BSC
Overall Width
Molded
Package Width
Base to Seating Plane
E1
A1
.015
7.50 BSC
Overall
Length
Shoulder
to Shoulder Width
DE
.290
17.90
BSC
.310
A2
0.10
NOM
A1
MAX
INCHES
1.27
BSC
MIN
Standoff
eB
28
Units
e
Dimension Limits
A
.120
10.30 BSC
.135
MAX
2.65
0.30
.200
.150
.335
Chamfer
Molded (optional)
Package Width
hE1
0.25
.240
.285
0.75
.295
Foot
Length
Overall
Length
LD
0.40
1.345
1.365
1.27
1.400
L1L
.110
Lead
Thickness
Foot
Angle
Top
.008
0
.010
.015
8
Upper
Lead Width
Lead
Thickness
cb1
.040
0.18
.050
.070
0.33
.014
.018
Lead Width
eB
0.31
1.40.130
REF
.150
.022
0.51
.430
Mold Draft Angle Top
15
Notes:
Moldfeature
Draft Angle
Bottom
the hatched
5 area.
15
1. Pin 1 visual index
may vary,
but must be located within
Notes:
2. Significant Characteristic.
1. 3.Pin
1 visual index
feature
butmold
mustflash
be located
within the
hatched
Dimensions
D and
E1 domay
not vary,
include
or protrusions.
Mold
flash area.
or protrusions shall not exceed .010" per side.
Dimensioning
and tolerancing per ASME Y14.5M.
2. 4. Significant
Characteristic.
BSC: Basic
Theoretically
exactorvalue
shown without
tolerances.
3. Dimensions
D andDimension.
E1 do not include
mold flash
protrusions.
Mold flash
or protrusions shall not exceed 0.15 mm per side.
Preliminary
DS70289B-page 227
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
D
D2
EXPOSED
PAD
e
E2
E
K
N
NOTE 1
TOP VIEW
BOTTOM VIEW
A3
A1
Units
Dimension Limits
Number of Pins
MILLIMETERS
MIN
NOM
MAX
28
Pitch
Overall Height
0.80
0.65 BSC
0.90
1.00
Standoff
A1
0.00
0.02
0.05
Contact Thickness
A3
0.20 REF
Overall Width
E2
Overall Length
D2
3.65
3.70
4.70
0.23
0.38
0.43
Contact Length
0.30
0.40
0.50
Contact-to-Exposed Pad
0.20
Contact Width
6.00 BSC
3.65
3.70
4.70
6.00 BSC
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
DS70289B-page 228
Preliminary
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
D
D2
EXPOSED
PAD
e
E
E2
b
2
2
1
N
1
N
NOTE 1
TOP VIEW
L
BOTTOM VIEW
A
A3
A1
Units
Dimension Limits
Number of Pins
MILLIMETERS
MIN
NOM
MAX
44
Pitch
Overall Height
0.80
0.65 BSC
0.90
1.00
Standoff
A1
0.00
0.02
0.05
Contact Thickness
A3
0.20 REF
Overall Width
E2
Overall Length
D2
6.30
6.45
6.80
0.25
0.30
0.38
Contact Length
0.30
0.40
0.50
Contact-to-Exposed Pad
0.20
Contact Width
8.00 BSC
6.30
6.45
6.80
8.00 BSC
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-103B
Preliminary
DS70289B-page 229
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
D
D1
E
e
E1
NOTE 1
1 2 3
NOTE 2
A1
Units
MILLIMETERS
Dimension Limits
Number of Leads
A2
L1
MIN
NOM
MAX
44
Lead Pitch
Overall Height
0.80 BSC
A2
0.95
1.00
1.05
Standoff
A1
0.05
0.15
Foot Length
0.45
0.60
0.75
Footprint
L1
1.20
1.00 REF
Foot Angle
Overall Width
12.00 BSC
Overall Length
12.00 BSC
E1
10.00 BSC
D1
10.00 BSC
3.5
Lead Thickness
0.09
0.20
Lead Width
0.30
0.37
0.45
11
12
13
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
DS70289B-page 230
Preliminary
REVISION HISTORY
TABLE 22-1:
Section Name
High-Performance, 16-bit
Microcontrollers
Update Description
Added Extended Interrupts column to Remappable Peripherals in the
Controller Families table and Note 2 (see Table 1).
Added Note 1 to all pin diagrams, which references RPn pin usage by
remappable peripherals (see Pin Diagrams).
Changed PORTA pin name from RA15 to RA10 (see Table 1-1).
Updated Reset values for the following SFRs: IPC1, IPC3-IPC5, IPC7,
IPC16, and INTTREG (see Table 3-4).
Added the System Control Register Map (see Table 3-20).
Entire section was replaced to maintain consistency with other PIC24H data
sheets.
Removed the first sentence of the third clock source item (External Clock) in
Section 7.1.1.2 Primary.
Updated the default bit values for DOZE and FRCDIV in the Clock Divisor
Register (see Register 7-2).
Added the center frequency in the OSCTUN register for the FRC Tuning bits
(TUN<5:0>) value 011111 and updated the center frequency for bits value
011110 (see Register 7-4).
Replaced sections 13.1, 13.2 and 13.3 and related figures and tables with
entirely new content.
Removed the following sections, which are now available in the related
section of the PIC24H Family Reference Manual:
14.1 Interrupts
14.2 Receive Operations
14.3 Transmit Operations
14.4 SPI Setup (retained Figure 14-1: SPI Module Block Diagram)
Preliminary
DS70289B-page 231
Section Name
Section 15.0 Inter-Integrated
Circuit (I2C)
Update Description
Removed the following sections, which are now available in the related
section of the PIC24H Family Reference Manual:
15.3 I2C Interrupts
15.4 Baud Rate Generator (retained Figure 15-1: I2C Block Diagram)
15.5 I2C Module Addresses
15.6 Slave Address Masking
15.7 IPMI Support
15.8 General Call Address Support
15.9 Automatic Clock Stretch
15.10 Software Controlled Clock Stretching (STREN = 1)
15.11 Slope Control
15.12 Clock Arbitration
15.13 Multi-Master Communication, Bus Collision, and Bus Arbitration
15.14 Peripheral Pin Select Limitations
Removed Equation 17-1: ADC Conversion Clock Period and Figure 17-2:
ADC Transfer Function (10-Bit Example).
Added ADC1 Module Block Diagram for PIC24HFJ16GP304 and
PIC24HJ32GP204 Devices (Figure 17-1) and ADC1 Module Block Diagram
FOR PIC24HJ32GP202 Devices (Figure 17-2).
Added Note 2 to Figure 17-3: ADC Conversion Clock Period Block Diagram.
Added device-specific information to Note 1 in the ADC1 Input Scan Select
Register Low (see Register 17-6), and updated the default bit value for bits
12-10 (CSS12-CSS10) from U-0 to R/W-0.
Added device-specific information to Note 1 in the ADC1 Port Configuration
Register Low (see Register 17-7), and updated the default bit value for bits
12-10 (PCFG12-PCFG10) from U-0 to R/W-0.
DS70289B-page 232
Preliminary
Section Name
Section 18.0 Special Features
Update Description
Added FICD register information for address 0xF8000E in the Device
Configuration Register Map (see Table 18-1).
Added FICD register content (BKBUG, COE, JTAGEN, and ICS<1:0> to the
PIC24HJ32GP202/204 and PIC24HJ16GP304 Configuration Bits
Description (see Table 18-2).
Added a note regarding the placement of low-ESR capacitors, after the
second paragraph of Section 18.2 On-Chip Voltage Regulator and to
Figure 18-1.
Removed the words if enabled from the second sentence in the fifth
paragraph of Section 18.3 BOR: Brown-Out Reset.
Preliminary
DS70289B-page 233
DS70289B-page 234
Preliminary
B
Block Diagrams
16-bit Timer1 Module ................................................ 123
A/D Module ....................................................... 158, 159
Connections for On-Chip Voltage Regulator............. 175
Device Clock ......................................................... 85, 87
Input Capture ............................................................ 131
Output Compare ....................................................... 133
PIC24H ....................................................................... 12
PIC24H CPU Core ...................................................... 16
PLL.............................................................................. 87
Reset System.............................................................. 49
Shared Port Structure ................................................. 99
SPI ............................................................................ 137
Timer2 (16-bit) .......................................................... 127
Timer2/3 (32-bit) ....................................................... 126
UART ........................................................................ 151
Watchdog Timer (WDT) ............................................ 176
C
C Compilers
MPLAB C18 .............................................................. 188
MPLAB C30 .............................................................. 188
Clock Switching................................................................... 93
Enabling ...................................................................... 93
Sequence.................................................................... 93
Code Examples
Erasing a Program Memory Page............................... 47
Initiating a Programming Sequence............................ 48
Loading Write Buffers ................................................. 48
Port Write/Read ........................................................ 101
PWRSAV Instruction Syntax....................................... 95
Code Protection ........................................................ 171, 177
Configuration Bits.............................................................. 171
Description (Table).................................................... 172
Configuration Register Map .............................................. 171
Configuring Analog Port Pins ............................................ 101
CPU
Control Register .......................................................... 18
CPU Clocking System......................................................... 86
Options........................................................................ 86
Selection ..................................................................... 86
Customer Change Notification Service ............................. 238
Customer Notification Service........................................... 238
Customer Support ............................................................. 238
D
Data Address Space ........................................................... 23
Alignment .................................................................... 23
E
Electrical Characteristics .................................................. 191
AC............................................................................. 200
Equations
Device Operating Frequency...................................... 86
Errata .................................................................................... 9
F
Flash Program Memory ...................................................... 43
Control Registers........................................................ 44
Operations .................................................................. 44
Programming Algorithm.............................................. 47
RTSP Operation ......................................................... 44
Table Instructions ....................................................... 43
Flexible Configuration ....................................................... 171
I
I/O Ports ............................................................................. 99
Parallel I/O (PIO) ........................................................ 99
Write/Read Timing.................................................... 101
I2 C
Addresses................................................................. 144
Operating Modes ...................................................... 143
Registers .................................................................. 143
I2C Module
I2C1 Register Map...................................................... 29
In-Circuit Debugger........................................................... 178
In-Circuit Emulation .......................................................... 171
In-Circuit Serial Programming (ICSP)....................... 171, 178
Input Capture
Registers .................................................................. 132
Input Change Notification ................................................. 101
Instruction Addressing Modes ............................................ 36
File Register Instructions ............................................ 36
Fundamental Modes Supported ................................. 37
MCU Instructions ........................................................ 36
Move and Accumulator Instructions ........................... 37
Other Instructions ....................................................... 37
Instruction Set
Overview................................................................... 181
Summary .................................................................. 179
Instruction-Based Power-Saving Modes............................. 95
Idle.............................................................................. 96
Sleep .......................................................................... 95
Internal RC Oscillator
Use with WDT........................................................... 176
Internet Address ............................................................... 238
Interrupt Control and Status Registers ............................... 61
IECx............................................................................ 61
Preliminary
DS70289B-page 235
J
JTAG Boundary Scan Interface ........................................ 171
M
Memory Organization.......................................................... 21
Microchip Internet Web Site .............................................. 238
MPLAB ASM30 Assembler, Linker, Librarian ................... 188
MPLAB ICD 2 In-Circuit Debugger.................................... 189
MPLAB ICE 2000 High-Performance Universal In-Circuit Emulator ......................................................................... 189
MPLAB Integrated Development Environment Software .. 187
MPLAB PM3 Device Programmer..................................... 189
MPLAB REAL ICE In-Circuit Emulator System................. 189
MPLINK Object Linker/MPLIB Object Librarian ................ 188
Multi-Bit Data Shifter ........................................................... 20
N
NVM Module
Register Map............................................................... 35
O
Open-Drain Configuration ................................................. 100
Output Compare................................................................ 133
Registers ................................................................... 135
P
Packaging ......................................................................... 225
Details ....................................................................... 227
Marking ............................................................. 225, 226
Peripheral Module Disable (PMD)....................................... 96
PICSTART Plus Development Programmer ..................... 190
Pinout I/O Descriptions (table) ............................................ 13
PMD Module
Register Map............................................................... 35
PORTA
Register Map............................................................... 34
PORTB
Register Map............................................................... 34
Power-on Reset (POR) ....................................................... 54
Power-Saving Features....................................................... 95
Clock Frequency and Switching.................................. 95
Program Address Space ..................................................... 21
Construction ................................................................ 38
Data Access from Program Memory Using Program
Space Visibility.................................................... 41
Data Access from Program Memory Using Table Instructions .................................................................... 40
Data Access from, Address Generation...................... 39
Memory Map ............................................................... 21
Table Read Instructions
TBLRDH.............................................................. 40
TBLRDL .............................................................. 40
Visibility Operation ...................................................... 41
Program Memory
DS70289B-page 236
R
Reader Response............................................................. 239
Registers
AD1CHS0 (ADC1 Input Channel 0 Select ................ 167
AD1CHS123 (ADC1 Input Channel 1, 2, 3 Select)... 165
AD1CON1 (ADC1 Control 1) .................................... 161
AD1CON2 (ADC1 Control 2) .................................... 163
AD1CON3 (ADC1 Control 3) .................................... 164
AD1CSSL (ADC1 Input Scan Select Low)................ 169
AD1PCFGL (ADC1 Port Configuration Low) ............ 169
CLKDIV (Clock Divisor) .............................................. 90
CORCON (Core Control) ...................................... 19, 63
I2CxCON (I2Cx Control) ........................................... 145
I2CxMSK (I2Cx Slave Mode Address Mask) ............ 149
I2CxSTAT (I2Cx Status) ........................................... 147
ICxCON (Input Capture x Control)............................ 132
IEC0 (Interrupt Enable Control 0) ................... 70, 72, 73
IFS0 (Interrupt Flag Status 0) ..................................... 66
IFS1 (Interrupt Flag Status 1) ..................................... 68
IFS4 (Interrupt Flag Status 4) ..................................... 69
INTCON1 (Interrupt Control 1).................................... 64
INTCON2 (Interrupt Control 2).................................... 65
INTTREG Interrupt Control and Status Register ........ 82
IPC0 (Interrupt Priority Control 0) ............................... 74
IPC1 (Interrupt Priority Control 1) ............................... 75
IPC16 (Interrupt Priority Control 16) ........................... 81
IPC2 (Interrupt Priority Control 2) ............................... 76
IPC3 (Interrupt Priority Control 3) ............................... 77
IPC4 (Interrupt Priority Control 4) ............................... 78
IPC5 (Interrupt Priority Control 5) ............................... 79
IPC7 (Interrupt Priority Control 7) ............................... 80
NVMCOM (Flash Memory Control)....................... 45, 46
OCxCON (Output Compare x Control) ..................... 135
OSCCON (Oscillator Control) ..................................... 88
OSCTUN (FRC Oscillator Tuning).............................. 92
PLLFBD (PLL Feedback Divisor)................................ 91
PMD1 (Peripheral Module Disable Control Register 1) ..
97
PMD2 (Peripheral Module Disable Control Register 2) ..
98
RCON (Reset Control)................................................ 50
SPIxCON1 (SPIx Control 1)...................................... 139
SPIxCON2 (SPIx Control 2)...................................... 141
SPIxSTAT (SPIx Status and Control) ....................... 138
SR (CPU Status)................................................... 18, 62
T1CON (Timer1 Control) .......................................... 124
TxCON (T2CON, T4CON, T6CON or T8CON Control)..
128
TyCON (T3CON, T5CON, T7CON or T9CON Control)..
129
UxMODE (UARTx Mode).......................................... 152
UxSTA (UARTx Status and Control)......................... 154
Reset
Illegal Opcode....................................................... 49, 56
Trap Conflict ......................................................... 55, 56
Uninitialized W Register........................................ 49, 56
Reset Sequence ................................................................. 57
Resets................................................................................. 49
S
Serial Peripheral Interface (SPI) ....................................... 137
Software Reset Instruction (SWR)...................................... 55
Preliminary
V
Voltage Regulator (On-Chip) ............................................ 175
W
Watchdog Time-out Reset (WDTR).................................... 55
Watchdog Timer (WDT)............................................ 171, 176
Programming Considerations ................................... 176
WWW Address ................................................................. 238
WWW, On-Line Support ....................................................... 9
U
UART Module
UART1 Register Map.................................................. 29
Preliminary
DS70289B-page 237
DS70289B-page 238
Preliminary
CUSTOMER SUPPORT
Distributor or Representative
Local Sales Office
Field Application Engineer (FAE)
Technical Support
Customers
should
contact
their
distributor,
representative or field application engineer (FAE) for
support. Local sales offices are also available to help
customers. A listing of sales offices and locations is
included in the back of this document.
Technical support is available through the web site
at: http://support.microchip.com
Preliminary
DS70289B-page 239
RE:
Reader Response
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________
Application (optional):
Would you like a reply?
Device: PIC24HJ32GP202/204
N
and
Questions:
1. What are the best features of this document?
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?
DS70289B-page 240
Preliminary
Examples:
a)
Microchip Trademark
Architecture
PIC24HJ32GP202-E/SP:
General-purpose PIC24H, 32 KB program
memory, 28-pin, Extended temp.,
SPDIP package.
Architecture:
24
16-bit Microcontroller
HJ
Product Group:
GP2
GP3
=
=
Pin Count:
02
03
=
=
28-pin
44-pin
Temperature Range:
I
E
=
=
Package:
SP
SO
MM
PT
ML
=
=
=
=
=
Preliminary
DS70289B-page 241
ASIA/PACIFIC
ASIA/PACIFIC
EUROPE
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://support.microchip.com
Web Address:
www.microchip.com
India - Bangalore
Tel: 91-80-4182-8400
Fax: 91-80-4182-8422
India - New Delhi
Tel: 91-11-4160-8631
Fax: 91-11-4160-8632
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
India - Pune
Tel: 91-20-2566-1512
Fax: 91-20-2566-1513
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
Japan - Yokohama
Tel: 81-45-471- 6166
Fax: 81-45-471-6122
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Atlanta
Duluth, GA
Tel: 678-957-9614
Fax: 678-957-1455
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Farmington Hills, MI
Tel: 248-538-2250
Fax: 248-538-2260
Kokomo
Kokomo, IN
Tel: 765-864-8360
Fax: 765-864-8387
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
Santa Clara
Santa Clara, CA
Tel: 408-961-6444
Fax: 408-961-6445
Toronto
Mississauga, Ontario,
Canada
Tel: 905-673-0699
Fax: 905-673-6509
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8528-2100
Fax: 86-10-8528-2104
Korea - Daegu
Tel: 82-53-744-4301
Fax: 82-53-744-4302
China - Chengdu
Tel: 86-28-8665-5511
Fax: 86-28-8665-7889
China - Hong Kong SAR
Tel: 852-2401-1200
Fax: 852-2401-3431
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
China - Nanjing
Tel: 86-25-8473-2460
Fax: 86-25-8473-2470
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
Malaysia - Penang
Tel: 60-4-227-8870
Fax: 60-4-227-4068
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
China - Shenzhen
Tel: 86-755-8203-2660
Fax: 86-755-8203-1760
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
Taiwan - Kaohsiung
Tel: 886-7-536-4818
Fax: 886-7-536-4803
China - Xiamen
Tel: 86-592-2388138
Fax: 86-592-2388130
Taiwan - Taipei
Tel: 886-2-2500-6610
Fax: 886-2-2508-0102
China - Xian
Tel: 86-29-8833-7252
Fax: 86-29-8833-7256
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
UK - Wokingham
Tel: 44-118-921-5869
Fax: 44-118-921-5820
China - Zhuhai
Tel: 86-756-3210040
Fax: 86-756-3210049
01/02/08
DS70289B-page 242
Preliminary