B
B
B
Data Sheet
20/28/44/48-Pin, General Purpose,
16-Bit Flash Microcontrollers
with XLP Technology
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in 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.
ISBN: 978-1-61341-079-0
Microchip received ISO/TS-16949:2002 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
Tempe, Arizona; Gresham, Oregon and design centers in California
and India. The Companys quality system processes and procedures
are for its PIC MCUs and dsPIC DSCs, KEELOQ code hopping
devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchips quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.
Compare/PWM
Comparators
CTMU (ch)
UART w/
Capture
Output
Timers
16-Bit
RTCC
IrDA
Input
I2C
Program
Pins
PIC24F
EE Data
SPI
(bytes)
(bytes)
(bytes)
SRAM
Flash
Device
24FVXXKA301
RA1 3 18 RB15
24FXXKA301
RB0 4 17 RB14
RB1 5 16 RB13
RB2 6 15 RB12
RA2 7 14 RA6 OR VCAP
RA3 8 13 RB9
RB4 9 12 RB8
RA4 10 11 RB7
Pin Features
Pin
PIC24FVXXKA301 PIC24FXXKA301
1 MCLR/VPP/RA5 MCLR/VPP/RA5
2 PGEC2/VREF+/CVREF+/AN0/C3INC/SCK2/CN2/RA0 PGEC2/VREF+/CVREF+/AN0/C3INC/SCK2/CN2/RA0
3 PGED2/CVREF-/VREF-/AN1/SDO2/CN3/RA1 PGED2/CVREF-/VREF-/AN1/SDO2/CN3/RA1
4 PGED1/AN2/ULPWU/CTCMP/C1IND/C2INB/C3IND/U2TX/SDI2/ PGED1/AN2/ULPWU/CTCMP/C1IND/C2INB/C3IND/U2TX/SDI2/
OC2/CN4/RB0 OC2/CN4/RB0
5 PGEC1/AN3/C1INC/C2INA/U2RX/OC3/CTED12/CN5/RB1 PGEC1/AN3/C1INC/C2INA/U2RX/OC3/CTED12/CN5/RB1
6 AN4/SDA2/T5CK/T4CK/U1RX/CTED13/CN6/RB2 AN4/SDA2/T5CK/T4CK/U1RX/CTED13/CN6/RB2
7 OSCI/AN13/C1INB/C2IND/CLKI/CN30/RA2 OSCI/AN13/C1INB/C2IND/CLKI/CN30/RA2
8 OSCO/AN14/C1INA/C2INC/CLKO/CN29/RA3 OSCO/AN14/C1INA/C2INC/CLKO/CN29/RA3
9 PGED3/SOSCI/AN15/U2RTS/CN1/RB4 PGED3/SOSCI/AN15/U2RTS/CN1/RB4
10 PGEC3/SOSCO/SCLKI/U2CTS/CN0/RA4 PGEC3/SOSCO/SCLKI/U2CTS/CN0/RA4
11 U1TX/C2OUT/OC1/IC1/CTED1/INT0/CN23/RB7 U1TX/INT0/CN23/RB7
12 SCL1/U1CTS/C3OUT/CTED10/CN22/RB8 SCL1/U1CTS/C3OUT/CTED10/CN22/RB8
13 SDA1/T1CK/U1RTS/IC2/CTED4/CN21/RB9 SDA1/T1CK/U1RTS/IC2/CTED4/CN21/RB9
14 VCAP C2OUT/OC1/IC1/CTED1/INT2/CN8/RA6
15 AN12/LVDIN/SCK1/SS2/IC3/CTED2/INT2/CN14/RB12 AN12/LVDIN/SCK1/SS2/IC3/CTED2/CN14/RB12
16 AN11/SDO1/OCFB/CTPLS/CN13/RB13 AN11/SDO1/OCFB/CTPLS/CN13/RB13
17 CVREF/AN10/C3INB/RTCC/SDI1/C1OUT/OCFA/CTED5/INT1/ CVREF/AN10/C3INB/RTCC/SDI1/C1OUT/OCFA/CTED5/INT1/
CN12/RB14 CN12/RB14
18 AN9/C3INA/SCL2/T3CK/T2CK/REFO/SS1/CTED6/CN11/RB15 AN9/C3INA/SCL2/T3CK/T2CK/REFO/SS1/CTED6/CN11/RB15
19 VSS/AVSS VSS/AVSS
20 VDD/AVDD VDD/AVDD
Legend: Pin numbers in bold indicate pin function differences between PIC24FV and PIC24F devices.
Note 1: PIC24F32KA304 device pins have a maximum voltage of 3.6V and are not 5V tolerant.
28-Pin SPDIP/SSOP/SOIC(1,2)
MCLR/RA5 1 28 VDD
RA0 2 27 VSS
RA1 3 26 RB15
PIC24FVXXKA302
RB0 4 25 RB14
PIC24FXXKA302
RB1 5 24 RB13
RB2 6 23 RB12
RB3 7 22 RB11
VSS 8 21 RB10
RA2 9 20 RA6 OR VCAP
RA3 10 19 RA7
RB4 11 18 RB9
RA4 12 17 RB8
VDD 13 16 RB7
RB5 14 15 RB6
Pin Features
Pin
PIC24FVXXKA302 PIC24FXXKA302
1 MCLR/VPP/RA5 MCLR/VPP/RA5
2 VREF+/CVREF+/AN0/C3INC/CTED1/CN2/RA0 VREF+/CVREF+/AN0/C3INC/CTED1/CN2/RA0
3 CVREF-/VREF-/AN1/CN3/RA1 CVREF-/VREF-/AN1/CN3/RA1
4 PGED1/AN2/ULPWU/CTCMP/C1IND/C2INB/C3IND/U2TX/CN4/RB0 PGED1/AN2/ULPWU/CTCMP/C1IND/C2INB/C3IND/U2TX/CN4/RB0
5 PGEC1/AN3/C1INC/C2INA/U2RX/CTED12/CN5/RB1 PGEC1/AN3/C1INC/C2INA/U2RX/CTED12/CN5/RB1
6 AN4/C1INB/C2IND/SDA2/T5CK/T4CK/U1RX/CTED13/CN6/RB2 AN4/C1INB/C2IND/SDA2/T5CK/T4CK/U1RX/CTED13/CN6/RB2
7 AN5/C1INA/C2INC/SCL2/CN7/RB3 AN5/C1INA/C2INC/SCL2/CN7/RB3
8 VSS VSS
9 OSCI/AN13/CLKI/CN30/RA2 OSCI/AN13/CLKI/CN30/RA2
10 OSCO/AN14/CLKO/CN29/RA3 OSCO/AN14/CLKO/CN29/RA3
11 SOSCI/AN15/U2RTS/CN1/RB4 SOSCI/AN15/U2RTS/CN1/RB4
12 SOSCO/SCLKI/U2CTS/CN0/RA4 SOSCO/SCLKI/U2CTS/CN0/RA4
13 VDD VDD
14 PGED3/ASDA(1)/SCK2/CN27/RB5 PGED3/ASDA(1)/SCK2/CN27/RB5
15 PGEC3/ASCL(1)/SDO2/CN24/RB6 PGEC3/ASCL(1)/SDO2/CN24/RB6
16 U1TX/C2OUT/OC1/INT0/CN23/RB7 U1TX/INT0/CN23/RB7
17 SCL1/U1CTS/C3OUT/CTED10/CN22/RB8 SCL1/U1CTS/C3OUT/CTED10/CN22/RB8
18 SDA1/T1CK/U1RTS/IC2/CTED4/CN21/RB9 SDA1/T1CK/U1RTS/IC2/CTED4/CN21/RB9
19 SDI2/IC1/CTED3/CN9/RA7 SDI2/IC1/CTED3/CN9/RA7
20 VCAP C2OUT/OC1/CTED1/INT2/CN8/RA6
21 PGED2/SDI1/OC3/CTED11/CN16/RB10 PGED2/SDI1/OC3/CTED11/CN16/RB10
22 PGEC2/SCK1/OC2/CTED9/CN15/RB11 PGEC2/SCK1/OC2/CTED9/CN15/RB11
23 AN12/LVDIN/SS2/IC3/CTED2/INT2/CN14/RB12 AN12/LVDIN/SS2/IC3/CTED2/CN14/RB12
24 AN11/SDO1/OCFB/CTPLS/CN13/RB13 AN11/SDO1/OCFB/CTPLS/CN13/RB13
25 CVREF/AN10/C3INB/RTCC/C1OUT/OCFA/CTED5/INT1/CN12/RB14 CVREF/AN10/C3INB/RTCC/C1OUT/OCFA/CTED5/INT1/CN12/
RB14
26 AN9/C3INA/T3CK/T2CK/REFO/SS1/CTED6/CN11/RB15 AN9/C3INA/T3CK/T2CK/REFO/SS1/CTED6/CN11/RB15
27 VSS/AVSS VSS/AVSS
28 VDD/AVDD VDD/AVDD
Legend: Pin numbers in bold indicate pin function differences between PIC24FV and PIC24F devices.
Note 1: Alternative multiplexing for SDA1(ASDA1) and SCL1 (ASCL1) when the I2CSEL Configuration bit is set.
2: PIC24F32KA304 device pins have a maximum voltage of 3.6V and are not 5V tolerant
28-Pin QFN(1,2,3)
MCLR/RA5
RB15
RB14
RA1
RA0
VDD
VSS
28 27 26 25 24 23 22
RB0 1 21 RB13
RB1 2 20 RB12
RB2 3 24FVXXKA302 19 RB11
RB3 4 18 RB10
24FXXKA302
VSS 5 17 RA6 OR VCAP
RA2 6 16 RA7
RA3 7 15 RB9
8 9 10 11 12 13 14
RB8
RB4
RA4
VDD
RB5
RB6
RB7
Pin Features
Pin
PIC24FVXXKA302 PIC24FXXKA302
1 PGED1/AN2/ULPWU/CTCMP/C1IND/C2INB/C3IND/U2TX/CN4/RB0 PGED1/AN2/ULPWU/CTCMP/C1IND/C2INB/C3IND/U2TX/CN4/RB0
2 PGEC1/AN3/C1INC/C2INA/U2RX/CTED12/CN5/RB1 PGEC1/AN3/C1INC/C2INA/U2RX/CTED12/CN5/RB1
3 AN4/C1INB/C2IND/SDA2/T5CK/T4CK/U1RX/CTED13/CN6/RB2 AN4/C1INB/C2IND/SDA2/T5CK/T4CK/U1RX/CTED13/CN6/RB2
4 AN5/C1INA/C2INC/SCL2/CN7/RB3 AN5/C1INA/C2INC/SCL2/CN7/RB3
5 VSS VSS
6 OSCI/AN13/CLKI/CN30/RA2 OSCI/AN13/CLKI/CN30/RA2
7 OSCO/AN14/CLKO/CN29/RA3 OSCO/AN14/CLKO/CN29/RA3
8 SOSCI/AN15/U2RTS/CN1/RB4 SOSCI/AN15/U2RTS/CN1/RB4
9 SOSCO/SCLKI/U2CTS/CN0/RA4 SOSCO/SCLKI/U2CTS/CN0/RA4
10 VDD VDD
11 PGED3/ASDA1(2)/SCK2/CN27/RB5 PGED3/ASDA1(2)/SCK2/CN27/RB5
12 PGEC3/ASCL1(2)/SDO2/CN24/RB6 PGEC3/ASCL1(2)/SDO2/CN24/RB6
13 U1TX/C2OUT/OC1/INT0/CN23/RB7 U1TX/INT0/CN23/RB7
14 SCL1/U1CTS/C3OUT/CTED10/CN22/RB8 SCL1/U1CTS/C3OUT/CTED10/CN22/RB8
15 SDA1/T1CK/U1RTS/IC2/CTED4/CN21/RB9 SDA1/T1CK/U1RTS/IC2/CTED4/CN21/RB9
16 SDI2/IC1/CTED3/CN9/RA7 SDI2/IC1/CTED3/CN9/RA7
17 VCAP C2OUT/OC1/CTED1/INT2/CN8/RA6
18 PGED2/SDI1/OC3/CTED11/CN16/RB10 PGED2/SDI1/OC3/CTED11/CN16/RB10
19 PGEC2/SCK1/OC2/CTED9/CN15/RB11 PGEC2/SCK1/OC2/CTED9/CN15/RB11
20 AN12/LVDIN/SS2/IC3/CTED2/INT2/CN14/RB12 AN12/LVDIN/SS2/IC3/CTED2/CN14/RB12
21 AN11/SDO1/OCFB/CTPLS/CN13/RB13 AN11/SDO1/OCFB/CTPLS/CN13/RB13
22 CVREF/AN10/C3INB/RTCC/C1OUT/OCFA/CTED5/INT1/CN12/ CVREF/AN10/C3INB/RTCC/C1OUT/OCFA/CTED5/INT1/CN12/
RB14 RB14
23 AN9/C3INA/T3CK/T2CK/REFO/SS1/CTED6/CN11/RB15 AN9/C3INA/T3CK/T2CK/REFO/SS1/CTED6/CN11/RB15
24 VSS/AVSS VSS/AVSS
25 VDD/AVDD VDD/AVDD
26 MCLR/VPP/RA5 MCLR/VPP/RA5
27 VREF+/CVREF+/AN0/C3INC/CTED1/CN2/RA0 VREF+/CVREF+/AN0/C3INC/CTED1/CN2/RA0
28 CVREF-/VREF-/AN1/CN3/RA1 CVREF-/VREF-/AN1/CN3/RA1
Legend: Pin numbers in bold indicate pin function differences between PIC24FV and PIC24F devices.
Note 1: Exposed pad on underside of device is connected to VSS.
2: Alternative multiplexing for SDA1 (ASDA1) and SCL1 (ASCL1) when the I2CSEL Configuration bit is set.
3: PIC24F32KA304 device pins have a maximum voltage of 3.6V and are not 5V tolerant.
RC5
RC4
RC3
RB8
RB7
RB6
RB5
RA9
RA4
VDD
4 OC2/CN20/RC8 OC2/CN20/RC8
VSS
5 IC2/CTED7/CN19/RC9 IC2/CTED7/CN19/RC9
44
43
42
41
40
39
38
37
36
35
34
6 IC1/CTED3/CN9/RA7 IC1/CTED3/CN9/RA7
RB9 1 33 RB4
RC6 2 32 RA8 7 VCAP C2OUT/OC1/CTED1/INT2/CN8/RA6
RC7 3 31 RA3 8 PGED2/SDI1/CTED11/CN16/RB10 PGED2/SDI1/CTED11/CN16/RB10
RC8 4 30 RA2
RC9 5 PIC24FVXXKA304 29 VSS 9 PGEC2/SCK1/CTED9/CN15/RB11 PGEC2/SCK1/CTED9/CN15/RB11
RA7 6 28 VDD 10 AN12/LVDIN/CTED2/INT2/CN14/ AN12/LVDIN/CTED2/CN14/RB12
RA6 OR VCAP 7 PIC24FXXKA304 27 RC2 RB12
RB10 8 26 RC1
RB11 RC0 11 AN11/SDO1/CTPLS/CN13/RB13 AN11/SDO1/CTPLS/CN13/RB13
9 25
RB12 10 24 RB3 12 OC3/CN35/RA10 OC3/CN35/RA10
RB13 11 23 RB2
13 IC3/CTED8/CN36/RA11 IC3/CTED8/CN36/RA11
12
13
14
15
16
17
18
19
20
21
22
14 CVREF/AN10/C3INB/RTCC/ CVREF/AN10/C3INB/RTCC/
MCLR/RA5
RA0
RA1
RB1
RB0
VSS
RA10
VDD
RA11
RB14
RB15
C1OUT/OCFA/CTED5/INT1/CN12/ C1OUT/OCFA/CTED5/INT1/CN12/
RB14 RB14
15 AN9/C3INA/T3CK/T2CK/REFO/ AN9/C3INA/T3CK/T2CK/REFO/
SS1/CTED6/CN11/RB15 SS1/CTED6/CN11/RB15
16 VSS/AVSS VSS/AVSS
17 VDD/AVDD VDD/AVDD
18 MCLR/VPP/RA5 MCLR/VPP/RA5
19 VREF+/CVREF+/AN0/C3INC/ VREF+/CVREF+/AN0/C3INC/CN2/
CTED1/CN2/RA0 RA0
20 CVREF-/VREF-/AN1/CN3/RA1 CVREF-/VREF-/AN1/CN3/RA1
21 PGED1/AN2/ULPWU/CTCMP/ PGED1/AN2/ULPWU/CTCMP/C1IND/
C1IND/C2INB/C3IND/U2TX/CN4/RB0 C2INB/C3IND/U2TX/CN4/RB0
22 PGEC1/AN3/C1INC/C2INA/U2RX/ PGEC1/AN3/C1INC/C2INA/U2RX/
CTED12/CN5/RB1 CTED12/CN5/RB1
23 AN4/C1INB/C2IND/SDA2/T5CK/ AN4/C1INB/C2IND/SDA2/T5CK/
T4CK/CTED13/CN6/RB2 T4CK/CTED13/CN6/RB2
24 AN5/C1INA/C2INC/SCL2/CN7/ AN5/C1INA/C2INC/SCL2/CN7/RB3
RB3
25 AN6/CN32/RC0 AN6/CN32/RC0
26 AN7/CN31/RC1 AN7/CN31/RC1
27 AN8/CN10/RC2 AN8/CN10/RC2
28 VDD VDD
29 VSS VSS
30 OSCI/AN13/CLKI/CN30/RA2 OSCI/AN13/CLKI/CN30/RA2
31 OSCO/AN14/CLKO/CN29/RA3 OSCO/AN14/CLKO/CN29/RA3
32 OCFB/CN33/RA8 OCFB/CN33/RA8
33 SOSCI/AN15/U2RTS/CN1/RB4 SOSCI/AN15/U2RTS/CN1/RB4
Legend: Pin numbers in bold indicate pin
34 SOSCO/SCLKI/U2CTS/CN0/RA4 SOSCO/SCLKI/U2CTS/CN0/RA4
function differences between
35 SS2/CN34/RA9 SS2/CN34/RA9
PIC24FV and PIC24F devices.
36 SDI2/CN28/RC3 SDI2/CN28/RC3
Note 1: Exposed pad on underside of device
is connected to VSS. 37 SDO2/CN25/RC4 SDO2/CN25/RC4
2: Alternative multiplexing for SDA1 38 SCK2/CN26/RC5 SCK2/CN26/RC5
(ASDA1) and SCL1 (ASCL1) when 39 VSS VSS
the I2CSEL Configuration bit is set. 40 VDD VDD
3: PIC24F32KA304 device pins have a 41 PGED3/ASDA1(2)/CN27/RB5 PGED3/ASDA1(2)/CN27/RB5
maximum voltage of 3.6V and are not 42 PGEC3/ASCL1(2)/CN24/RB6 PGEC3/ASCL1(2)/CN24/RB6
5V tolerant.
43 INT0/CN23/RB7 INT0/CN23/RB7
44 SCL1/U1CTS/C3OUT/CTED10/ SCL1/U1CTS/C3OUT/CTED10/
CN22/RB8 CN22/RB8
RC5
RC4
RC3
RB8
RB7
RB6
RB5
RA9
RA4
VDD
VSS
n/c
4 OC2/CN20/RC8 OC2/CN20/RC8
5 IC2/CTED7/CN19/RC9 IC2/CTED7/CN19/RC9
47
41
46
45
44
43
42
40
39
38
48
37
RB9 1 36 RB4 6 IC1/CTED3/CN9/RA7 IC1/CTED3/CN9/RA7
RC6 2 35 RA8
RC7 3 34 RA3 7 VCAP INT2/RA6
RC8 4 33 RA2 8 n/c n/c
RC9 5 32 n/c
RA7 6 PIC24FVXXKA304 31 VSS 9 PGED2/SDI1/CTED11/CN16/RB10 PGED2/SDI1/CTED11/CN16/RB10
RA6 7 30 VDD 10 PGEC2/SCK1/CTED9/CN15/RB11 PGEC2/SCK1/CTED9/CN15/RB11
n/c PIC24FXXKA304
8 29 RC2
RB10 9 28 RC1 11 AN12/LVDIN/CTED2/INT2/CN14/RB12 AN12/LVDIN/CTED2/CN14/RB12
RB11 10 27 RC0 12 AN11/SDO1/CTPLS/CN13/RB13 AN11/SDO1/CTPLS/CN13/RB13
RB12 11 26 RB3
RB13 12 25 RB2 13 OC3/CN35/RA10 OC3/CN35/RA10
20
21
22
23
24
13
14
15
16
17
18
19
14 IC3/CTED8/CN36/RA11 IC3/CTED8/CN36/RA11
15 CVREF/AN10/C3INB/RTCC/ CVREF/AN10/C3INB/RTCC/C1OUT/
RA10
RA11
RB14
RB15
VDD/AVDD
MCLR/RA5
RA0
RA1
RB0
RB1
n/c
VSS/AVSS
C1OUT/OCFA/CTED5/INT1/CN12/RB14 OCFA/CTED5/INT1/CN12/RB14
16 AN9/C3INA/T3CK/T2CK/REFO/ AN9/C3INA/T3CK/T2CK/REFO/
SS1/CTED6/CN11/RB15 SS1/CTED6/CN11/RB15
17 VSS/AVSS VSS/AVSS
18 VDD/AVDD VDD/AVDD
19 MCLR/RA5 MCLR/RA5
20 n/c n/c
21 VREF+/CVREF+/AN0/C3INC/ VREF+/CVREF+/AN0/C3INC/
CTED1/CN2/RA0 CTED1/CN2/RA0
22 CVREF-/VREF-/AN1/CN3/RA1 CVREF-/VREF-/AN1/CN3/RA1
23 PGED1/AN2/ULPWU/CTCMP/C1IND/ PGED1/AN2/ULPWU/CTCMP/C1IND/
C2INB/C3IND/U2TX/CN4/RB0 C2INB/C3IND/U2TX/CN4/RB0
24 PGEC1/AN3/C1INC/C2INA/U2RX/ PGEC1/AN3/C1INC/C2INA/U2RX/
CTED12/CN5/RB1 CTED12/CN5/RB1
25 AN4/C1INB/C2IND/SDA2/T5CK/ AN4/C1INB/C2IND/SDA2/T5CK/
T4CK/CTED13/CN6/RB2 T4CK/CTED13/CN6/RB2
26 AN5/C1INA/C2INC/SCL2/CN7/RB3 AN5/C1INA/C2INC/SCL2/CN7/RB3
27 AN6/CN32/RC0 AN6/CN32/RC0
28 AN7/CN31/RC1 AN7/CN31/RC1
29 AN8/CN10/RC2 AN8/CN10/RC2
30 VDD VDD
31 VSS VSS
32 n/c n/c
33 OSCI/AN13/CLKI/CN30/RA2 OSCI/AN13/CLKI/CN30/RA2
34 OSCO/AN14/CLKO/CN29/RA3 OSCO/AN14/CLKO/CN29/RA3
35 OCFB/CN33/RA8 OCFB/CN33/RA8
36 SOSCI/AN15/U2RTS/CN1/RB4 SOSCI/AN15/U2RTS/CN1/RB4
Legend: Pin numbers in bold indicate pin func- 37 SOSCO/SCLKI/U2CTS/CN0/RA4 SOSCO/SCLKI/U2CTS/CN0/RA4
tion differences between PIC24FV and 38 SS2/CN34/RA9 SS2/CN34/RA9
PIC24F devices. 39 SDI2/CN28/RC3 SDI2/CN28/RC3
Note 1: Exposed pad on underside of device is 40 SDO2/CN25/RC4 SDO2/CN25/RC4
connected to VSS. 41 SCK2/CN26/RC5 SCK2/CN26/RC5
2: Alternative multiplexing for SDA1 42 VSS VSS
(ASDA1) and SCL1 (ASCL1) when the
43 VDD VDD
I2CSEL Configuration bit is set.
44 n/c n/c
3: PIC24F32KA3XX device pins have a
maximum voltage of 3.6V and are not 45 PGED3/ASDA1(2)/CN27/RB5 PGED3/ASDA1(2)/CN27/RB5
(2)
5V tolerant. 46 PGEC3/ASCL1 /CN24/RB6 PGEC3/ASCL1(2)/CN24/RB6
47 C2OUT/OC1/INT0/CN23/RB7 C2OUT/OC1/INT0/CN23/RB7
48 SCL1/U1CTS/C3OUT/CTED10/ SCL1/U1CTS/C3OUT/CTED10/
CN22/RB8 CN22/RB8
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.
PIC24FV16KA301
PIC24FV32KA301
PIC24FV16KA302
PIC24FV32KA302
PIC24FV16KA304
PIC24FV32KA304
Features
PIC24F16KA301
PIC24F32KA301
PIC24F16KA302
PIC24F32KA302
PIC16F16KA304
PIC24F32KA304
Features
EA MUX 16
Address Bus
Literal Data
24 16 16 PORTC(1)
RC<9:0>
Inst Latch
Inst Register
Instruction
Decode and
Control
Divide
Control Signals Support 16 x 16
17x17 W Reg Array
OSCO/CLKO Timing Power-up Multiplier
OSCI/CLKI Generation Timer
Oscillator
FRC/LPRC Start-up Timer
Oscillators
Power-on 16-Bit ALU
Reset
Precision Watchdog 16
Band Gap Timer
Reference
DSWDT
Voltage BOR
Regulator
12-Bit
HLVD RTCC Timer1 Timer2/3 Timer4/5 CTMU Comparators
ADC
Note 1: All pins or features are not implemented on all device pinout configurations. See Table 1-3 for I/O port pin
descriptions.
PIC24FV32KA304 FAMILY
TABLE 1-3: PIC24FV32KA304 FAMILY PINOUT DESCRIPTIONS
F FV
F FV
PIC24FV32KA304 FAMILY
CN3 3 20 3 28 20 22 3 20 3 28 20 22 I ST
CN4 4 1 4 1 21 23 4 1 4 1 21 23 I ST
CN5 5 2 5 2 22 24 5 2 5 2 22 24 I ST
CN6 6 3 6 3 23 25 6 3 6 3 23 25 I ST
CN7 7 4 24 26 - 7 4 24 26 I ST
CN8 14 11 20 17 7 7 - - - - I ST
CN9 - - 19 16 6 6 - 19 16 6 6 I ST
CN10 - - 27 29 - - - 27 29 I ST
CN11 18 15 26 23 15 16 18 15 26 23 15 16 I ST
CN12 17 14 25 22 14 15 17 14 25 22 14 15 I ST
CN13 16 13 24 21 11 12 16 13 24 21 11 12 I ST
CN14 15 12 23 20 10 11 15 12 23 20 10 11 I ST
CN15 - - 22 19 9 10 - 22 19 9 10 I ST
CN16 - - 21 18 8 9 - 21 18 8 9 I ST
CN17 - - 3 3 - 3 3 I ST
DS39995B-page 19
TABLE 1-3: PIC24FV32KA304 FAMILY PINOUT DESCRIPTIONS (CONTINUED)
DS39995B-page 20
PIC24FV32KA304 FAMILY
F FV
CN18 2 2 2 2 I ST
CN19 - - 5 5 - 5 5 I ST
CN20 - - 4 4 - - 4 4 I ST
CN21 13 10 18 15 1 1 13 10 18 15 1 1 I ST
CN22 12 9 17 14 44 48 12 9 17 14 44 48 I ST
CN23 11 8 16 13 43 47 11 8 16 13 43 47 I ST
CN24 - - 15 12 42 46 - 15 12 42 46 I ST
CN25 - - 37 40 - - - 37 40 I ST
CN26 - - 38 41 - - - 38 41 I ST
CN27 - - 14 11 41 45 - 14 11 41 45 I ST
CN28 - - 36 39 - - - 36 39 I ST
CN29 8 5 10 7 31 34 8 5 10 7 31 34 I ST
CN30 7 4 9 6 30 33 7 4 9 6 30 33 I ST
CN31 - - 26 28 26 28 I ST
CN32 - - 25 27 25 27 I ST
CN33 - - 32 35 32 35 I ST
CN34 - - 35 38 35 38 I ST
CN35 - - 12 13 12 13 I ST
CN36 - - 13 14 13 14 I ST
CVREF 17 14 25 22 14 15 17 14 25 22 14 15 I ANA Comparator Voltage Reference
Output
CVREF+ 2 19 2 27 19 21 2 19 2 27 19 21 I ANA Comparator Reference Positive
Input Voltage
2011 Microchip Technology Inc.
F FV
PIC24FV32KA304 FAMILY
CTED12 13 14 13 14 I ST
CTED13 22 19 9 10 22 19 9 10 I ST
CTPLS 16 13 24 21 11 12 16 13 24 21 11 12 O CTMU Pulse Output
HLVDIN 15 12 23 20 10 11 15 12 23 20 10 11 I ST
IC1 11 11 19 16 6 6 11 8 19 16 6 6 I ST High/Low-Voltage Detect Input
IC2 13 10 18 15 5 5 13 10 18 15 5 5 I ST Input Capture 1 Input
IC3 15 12 23 20 13 14 15 12 23 20 13 14 I ST Input Capture 2 Input
INT0 11 8 16 13 43 47 11 8 16 13 43 47 I ST Input Capture 3 Input
INT1 17 14 25 22 14 15 17 14 25 22 14 15 I ST Interrupt 0 Input
INT2 14 11 20 17 7 7 15 12 23 20 10 11 I ST Interrupt 1 Input
MCLR 1 18 1 26 18 19 1 18 1 26 18 19 I ST Interrupt 2 Input
OC1 11 11 20 17 7 7 11 8 16 13 43 47 O Output Compare/PWM1 Output
OC2 4 1 22 19 4 4 4 1 22 19 4 4 O Output Compare/PWM2 Output
OC3 5 2 21,5 18,2 8,12,22 9,13,24 5 2 21,5 18,2 8,12,22 9,13,24 O Output Compare/PWM3 Output
OCFA 17 14 25 22 14 15 17 14 25 22 14 15 O Output Compare Fault A
OFCB 16 13 24 21 11,32 12,35 16 13 24 21 11,32 12,35 O Output Compare Fault B
DS39995B-page 21
PIC24FV32KA304 FAMILY
F FV
PGED2 3 20 21,3 18,28 8,20 9,22 3 20 21,3 18,28 8,20 9,22 I/O ST ICSP Data 2
PGEC3 10 7 12,15 9,12 34,42 37,46 10 7 12,15 9,12 34,42 37,46 I/O ST ICSP Clock 3
PGED3 9 6 11,14 8,11 33,41 36,45 9 6 11,14 8,11 33,41 36,45 I/O ST ICSP Data 3
RA0 2 19 2 27 19 21 2 19 2 27 19 21 I/O ST PORTA Pins
RA1 3 20 3 28 20 22 3 20 3 28 20 22 I/O ST
RA2 7 4 9 6 30 33 7 4 9 6 30 33 I/O ST
RA3 8 5 10 7 31 34 8 5 10 7 31 34 I/O ST
RA4 10 7 12 9 34 37 10 7 12 9 34 37 I/O ST
RA5 1 18 1 26 18 19 1 18 1 26 18 19 I/O ST
RA6 14 11 20 17 7 7 I/O ST
RA7 19 16 6 6 19 16 6 6 I/O ST
RA8 32 35 32 35 I/O ST
RA9 35 38 35 38 I/O ST
RA10 12 13 12 13 I/O ST
RA11 13 14 13 14 I/O ST
RB0 4 1 4 1 21 23 4 1 4 1 21 23 I/O ST PORTB Pins
RB1 5 2 5 2 22 24 5 2 5 2 22 24 I/O ST
RB2 6 3 6 3 23 25 6 3 6 3 23 25 I/O ST
RB3 7 4 24 26 7 4 24 26 I/O ST
RB4 9 6 11 8 33 36 9 6 11 8 33 36 I/O ST
RB5 14 11 41 45 14 11 41 45 I/O ST
RB6 15 12 42 46 15 12 42 46 I/O ST
2011 Microchip Technology Inc.
RB7 11 8 16 13 43 47 11 8 16 13 43 47 I/O ST
RB8 12 9 17 14 44 48 12 9 17 14 44 48 I/O ST
RB9 13 10 18 15 1 1 13 10 18 15 1 1 I/O ST
RB10 21 18 8 9 21 18 8 9 I/O ST
RB11 22 19 9 10 22 19 9 10 I/O ST
RB12 15 12 23 20 10 11 15 12 23 20 10 11 I/O ST
RB13 16 13 24 21 11 12 16 13 24 21 11 12 I/O ST
RB14 17 14 25 22 14 15 17 14 25 22 14 15 I/O ST
RB15 18 15 26 23 15 16 18 15 26 23 15 16 I/O ST
TABLE 1-3: PIC24FV32KA304 FAMILY PINOUT DESCRIPTIONS (CONTINUED)
2011 Microchip Technology Inc.
F FV
PIC24FV32KA304 FAMILY
REFO 18 15 26 23 15 16 18 15 26 23 15 16 O Reference Clock Output
RTCC 17 14 25 22 14 15 17 14 25 22 14 15 O Real-Time Clock/Calendar
Output
SCK1 15 12 22,23 19,20 9,10 10,11 15 12 22,23 19,20 9,10 10,11 I/O ST SPI1 Serial Input/Output Clock
SCK2 2 19 2,14 27,11 19,38,41 21,41,45 2 19 2,14 27,11 19,38,41 21,41,45 I/O ST SPI2 Serial Input/Output Clock
SCL1 12 9 17 14 44 48 12 9 17 14 44 48 I/O I2 C I2C1 Clock Input/Output
SCL2 18 15 26,7 23,4 15,24 16,26 18 15 26,7 23,4 15,24 16,26 I/O I2 C I2C2 Clock Input/Output
SCLKI 10 7 12 9 34 37 10 7 12 9 34 37 I ST Digital Secondary Clock Input
SDA1 13 10 18 15 1 1 13 10 18 15 1 1 I/O I2 C I2C1 Data Input/Output
SDA2 6 3 6 3 23 25 6 3 6 3 23 25 I/O I2C I2C2 Data Input/Output
SDI1 17 14 21,25 18,22 8,14 9,15 17 14 21,25 18,22 8,14 9,15 I ST SPI1 Serial Data Input
SDI2 4 1 19,4 16,1 6,21,36 6,23,39 4 1 19,4 16,1 6,21,36 6,23,39 I ST SPI2 Serial Data Input
SDO1 16 13 24 21 11 12 16 13 24 21 11 12 O SPI1 Serial Data Output
SDO2 3 20 3,15 28,12 20,37,42 22,40,46 3 20 3,15 28,12 20,37,42 22,40,46 O SPI2 Serial Data Output
SOSCI 9 6 11 8 33 36 9 6 11 8 33 36 I ANA Secondary Oscillator Input
SOSCO 10 7 12 9 34 37 10 7 12 9 34 37 O ANA Secondary Oscillator Output
SS1 18 15 26 23 15 16 18 15 26 23 15 16 O SPI1 Slave Select
DS39995B-page 23
PIC24FV32KA304 FAMILY
F FV
VDD
VSS
R1
family of 16-bit microcontrollers requires attention to a R2
minimal set of device pin connections before MCLR
proceeding with development. VCAP
(1)
C1 (3)
The following pins must always be connected: C7
PIC24FXXKXX
All VDD and VSS pins
VDD
(see Section 2.2 Power Supply Pins) VSS
C6(2) C3(2)
All AVDD and AVSS pins, regardless of whether or VSS
VDD
not the analog device features are used
AVDD
AVSS
VDD
VSS
(see Section 2.2 Power Supply Pins)
MCLR pin
(see Section 2.3 Master Clear (MCLR) Pin)
C5(2) C4(2)
VCAP pins
(see Section 2.4 Voltage Regulator Pin (VCAP))
These pins must also be connected if they are being Key (all values are recommendations):
used in the end application: C1 through C6: 0.1 F, 20V ceramic
PGECx/PGEDx pins used for In-Circuit Serial C7: 10 F, 16V tantalum or ceramic
Programming (ICSP) and debugging purposes R1: 10 k
(see Section 2.5 ICSP Pins)
R2: 100 to 470
OSCI and OSCO pins when an external oscillator
Note 1: See Section 2.4 Voltage Regulator Pin
source is used (VCAP) for explanation of VCAP pin
(see Section 2.6 External Oscillator Pins) connections.
Additionally, the following pins may be required: 2: The example shown is for a PIC24F device
with five VDD/VSS and AVDD/AVSS pairs.
VREF+/VREF- pins are used when external voltage Other devices may have more or less pairs;
reference for analog modules is implemented adjust the number of decoupling capacitors
Note: The AVDD and AVSS pins must always be appropriately.
connected, regardless of whether any of 3: Some PIC24F K parts do not have a
the analog modules are being used. regulator.
ESR ()
ground. The type can be ceramic or tantalum. Suitable 0.1
examples of capacitors are shown in Table 2-1.
Capacitors with equivalent specifications can be used.
0.01
Designers may use Figure 2-3 to evaluate ESR
equivalence of candidate devices.
0.001
The placement of this capacitor should be close to VCAP. 0.01 0.1 1 10 100 1000 10,000
It is recommended that the trace length not exceed Frequency (MHz)
0.25 inch (6 mm). Refer to Section 29.0 Electrical Note: Typical data measurement at 25C, 0V DC bias.
Characteristics for additional information.
Ceramic capacitors are suitable for use with the inter- -30
-40
nal voltage regulator of this microcontroller. However, -50
10V Capacitor
some care is needed in selecting the capacitor to -60
-70
6.3V Capacitor
ensure that it maintains sufficient capacitance over the -80
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
intended operating range of the application.
DC Bias Voltage (VDC)
Typical low-cost, 10 F ceramic capacitors are available
in X5R, X7R and Y5V dielectric ratings (other types are
also available, but are less common). The initial toler- When selecting a ceramic capacitor to be used with the
ance specifications for these types of capacitors are internal voltage regulator, it is suggested to select a
often specified as 10% to 20% (X5R and X7R), or high-voltage rating, so that the operating voltage is a
-20%/+80% (Y5V). However, the effective capacitance small percentage of the maximum rated capacitor volt-
that these capacitors provide in an application circuit will age. For example, choose a ceramic capacitor rated at
also vary based on additional factors, such as the 16V for the 3.3V or 2.5V core voltage. Suggested
applied DC bias voltage and the temperature. The total capacitors are shown in Table 2-1.
in-circuit tolerance is, therefore, much wider than the
initial tolerance specification. 2.5 ICSP Pins
The X5R and X7R capacitors typically exhibit satisfac- The PGC and PGD pins are used for In-Circuit Serial
tory temperature stability (ex: 15% over a wide Programming (ICSP) and debugging purposes. It
temperature range, but consult the manufacturers data is recommended to keep the trace length between the
sheets for exact specifications). However, Y5V capaci- ICSP connector and the ICSP pins on the device as
tors typically have extreme temperature tolerance short as possible. If the ICSP connector is expected to
specifications of +22%/-82%. Due to the extreme experience an ESD event, a series resistor is recom-
temperature tolerance, a 10 F nominal rated Y5V type mended, with the value in the range of a few tens of
capacitor may not deliver enough total capacitance to ohms, not to exceed 100.
meet minimum internal voltage regulator stability and
transient response requirements. Therefore, Y5V Pull-up resistors, series diodes and capacitors on the
capacitors are not recommended for use with the PGC and PGD pins are not recommended as they will
internal regulator if the application must operate over a interfere with the programmer/debugger communica-
wide temperature range. tions to the device. If such discrete components are an
application requirement, they should be removed from
In addition to temperature tolerance, the effective the circuit during programming and debugging. Alter-
capacitance of large value ceramic capacitors can vary natively, refer to the AC/DC characteristics and timing
substantially, based on the amount of DC voltage requirements information in the respective device
applied to the capacitor. This effect can be very signifi- Flash programming specification for information on
cant, but is often overlooked or is not always capacitive loading limits, and pin input voltage high
documented. (VIH) and input low (VIL) requirements.
A typical DC bias voltage vs. capacitance graph for For device emulation, ensure that the Communication
X7R type capacitors is shown in Figure 2-4. Channel Select (i.e., PGCx/PGDx pins), programmed
into the device, matches the physical connections for
the ICSP to the Microchip debugger/emulator tool.
For more information on available Microchip
development tools connection requirements, refer to
Section 27.0 Development Support.
Data Bus
Interrupt
Controller
16
8 16 16
Data Latch
23
PCH PCL Data RAM 16
23
Program Counter
Stack Loop Address
Control Control Latch
Logic Logic
23 16
RAGU
Address Latch WAGU
Program Memory
Instruction
Decode and Literal Data
Control Instruction Reg
Control Signals
to Various Blocks Hardware
Multiplier 16 x 16
W Register Array
Divide
Support 16
16-Bit ALU
16
To Peripheral Modules
W9
W10
W11
W12
W13
W14 Frame Pointer
W15 Stack Pointer 0
7 0
Table Memory Page
TBLPAG
Address Register
7 0
Program Space Visibility
PSVPAG Page Address Register
15 0
Repeat Loop Counter
RCOUNT
Register
15 SRH SRL 0
IPL
DC
2 1 0
RA N OV Z C ALU STATUS Register (SR)
15 0
IPL3 PSV CPU Control Register (CORCON)
R/W-0, HSC(1) R/W-0, HSC(1) R/W-0, HSC(1) R-0, HSC R/W-0, HSC R/W-0, HSC R/W-0, HSC R/W-0, HSC
(2) (2) (2)
IPL2 IPL1 IPL0 RA N OV Z C
bit 7 bit 0
Note 1: The IPL Status bits are read-only when NSTDIS (INTCON1<15>) = 1.
2: The IPL Status bits are concatenated with the IPL3 bit (CORCON<3>) to form the CPU Interrupt Priority
Level (IPL). The value in parentheses indicates the IPL when IPL3 = 1.
3.3 Arithmetic Logic Unit (ALU) The PIC24F CPU incorporates hardware support for
both multiplication and division. This includes a
The PIC24F ALU is 16 bits wide and is capable of dedicated hardware multiplier and support hardware
addition, subtraction, bit shifts and logic operations. division for 16-bit divisor.
Unless otherwise mentioned, arithmetic operations are
2s complement in nature. Depending on the operation, 3.3.1 MULTIPLIER
the ALU may affect the values of the Carry (C), Zero
The ALU contains a high-speed, 17-bit x 17-bit
(Z), Negative (N), Overflow (OV) and Digit Carry (DC)
multiplier. It supports unsigned, signed or mixed sign
Status bits in the SR register. The C and DC Status bits
operation in several multiplication modes:
operate as Borrow and Digit Borrow bits, respectively,
for subtraction operations. 16-bit x 16-bit signed
The ALU can perform 8-bit or 16-bit operations, 16-bit x 16-bit unsigned
depending on the mode of the instruction that is used. 16-bit signed x 5-bit (literal) unsigned
Data for the ALU operation can come from the W 16-bit unsigned x 16-bit unsigned
register array, or data memory, depending on the 16-bit unsigned x 5-bit (literal) unsigned
addressing mode of the instruction. Likewise, output 16-bit unsigned x 16-bit signed
data from the ALU can be written to the W register array 8-bit unsigned x 8-bit unsigned
or a data memory location.
TABLE 3-2: INSTRUCTIONS THAT USE THE SINGLE AND MULTI-BIT SHIFT OPERATION
Instruction Description
ASR Arithmetic shift right source register by one or more bits.
SL Shift left source register by one or more bits.
LSR Logical shift right source register by one or more bits.
FIGURE 4-1: PROGRAM SPACE MEMORY MAP FOR PIC24FV32KA304 FAMILY DEVICES
PIC24FV16KA304 PIC24FV32KA304
GOTO Instruction GOTO Instruction 000000h
Reset Address 000002h
Reset Address 000004h
Interrupt Vector Table Interrupt Vector Table 0000FEh
Reserved Reserved 000100h
Alternate Vector Table Alternate Vector Table 000104h
0001FEh
000200h
Flash
Program Memory
User Memory Space
(5632 instructions)
User Flash
Program Memory 002BFEh
(11264 instructions)
Unimplemented
Read 0
0057FEh
Unimplemented
Read 0
7FFE00h
Data EEPROM
Data EEPROM
7FFFFFh
800000h
Reserved Reserved
Configuration Memory Space
F7FFFEh
Device Config Registers Device Config Registers F80000h
F80010h
F80012h
Reserved Reserved
FEFFFEh
DEVID (2) DEVID (2) FF0000h
FFFFFFh
FIGURE 4-3: DATA SPACE MEMORY MAP FOR PIC24FV32KA304 FAMILY DEVICES
MSB LSB
Address MSB LSB Address
0001h 0000h SFR
SFR Space
07FFh 07FEh Space
0801h 0800h
Near
Data Space
Data RAM
Implemented
Data RAM
0FFFh 0FFEh
1FFF 1FFEh
Unimplemented
Read as 0
7FFFh 7FFFh
8001h 8000h
Program Space
Visibility Area
FFFFh FFFEh
PIC24FV32KA304 FAMILY
Start All
File Name Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Addr Resets
CNPD1 0056 CN15PDE(1) CN14PDE CN13PDE CN12PDE CN11PDE CN10PDE(1,2) CN9PDE(1) CN8PDE(3) CN7PDE(1) CN6PDE CN5PDE CN4PDE CN3PDE CN2PDE CN1PDE CN0PDE 0000
(1,2) (1,2) (1) (1,2) (1,2)
CNPD2 0058 CN31PDE CN30PDE CN29PDE CN28PDE CN27PDE CN26PDE CN25PDE CN24PDE(1) CN23PDE CN22PDE CN21PDE CN20PDE(1,2) CN19PDE(1,2) CN18PDE(1,2) CN17PDE(1,2) CN16PDE(1) 0000
CNPD3 005A CN36PDE(1,2) CN35PDE(1,2) CN34PDE(1,2) CN33PDE(1,2) CN32PDE(1,2) 0000
CNEN1 0062 CN15IE(1) CN14IE CN13IE CN12IE CN11IE CN10IE(1,2) CN9IE(1) CN8IE(3) CN7IE(1) CN6IE CN5IE CN4IE CN3IE CN2IE CN1IE CN0IE 0000
CNEN2 0064 CN31IE(1,2) CN30IE CN29IE CN28IE(1,2) CN27IE(1) CN26IE(1,2) CN25IE(1,2) CN24IE(1) CN23IE CN22IE CN21IE CN20IE(1,2) CN19IE(1,2) CN18IE(1,2) CN17IE(1,2) CN16IE(1) 0000
CNEN3 0066 CN36IE(1,2) CN35IE(1,2) CN34IE(1,2) CN33IE(1,2) CN32IE(1,2) 0000
CNPU1 006E CN15PUE(1) CN14PUE CN13PUE CN12PUE CN11PUE CN10PUE(1,2) CN9PUE(1) CN8PUE(3) CN7PUE(1) CN6PUE CN5PUE CN4PUE CN3PUE CN2PUE CN1PUE CN0PUE 0000
CNPU2 0070 CN31PUE(1,2) CN30PUE CN29PUE CN28PUE(1,2) CN27PUE(1) CN26PUE(1,2) CN25PUE(1,2) CN24PUE(1) CN23PUE CN22PUE CN21PUE CN20PUE(1,2) CN19PUE(1,2) CN18PUE(1,2) CN17PUE(1,2) CN16PUE(1) 0000
CNPU3 0072 CN36PUE(1,2) CN35PUE(1,2) CN34PUE(1,2) CN33PUE(1,2) CN32PUE(1,2) 0000
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
Note 1: These bits are not implemented in 20-pin devices.
2: These bits are not implemented in 28-pin devices.
3: These bits are not implemented in FV devices.
PIC24FV32KA304 FAMILY
DS39995B-page 42
TABLE 4-5: INTERRUPT CONTROLLER REGISTER MAP
DS39995B-page 43
PIC24FV32KA304 FAMILY
File All
Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Name Resets
IPC16 00C4 CRCIP2 CRCIP1 CRCIP0 U2ERIP2 U2ERIP1 U2ERIP0 U1ERIP2 U1ERIP1 U1ERIP0 4440
IPC18 00C8 HLVDIP2 HLVDIP1 HLVDIP0 0004
IPC19 00CA CTMUIP2 CTMUIP1 CTMUIP0 0040
IPC20 00CC ULPWUIP2 ULPWUIP1 ULPWUIP0 0000
INTTREG 00E0 CPUIRQ VHOLD ILR3 ILR2 ILR1 ILR0 VECNUM6 VECNUM5 VECNUM4 VECNUM3 VECNUM2 VECNUM1 VECNUM0 0000
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
2011 Microchip Technology Inc.
PIC24FV32KA304 FAMILY
PR4 011A PR4 FFFF
PR5 011C PR5 FFFF
T4CON 011E TON TSIDL TGATE TCKPS1 TCKPS0 T45 TCS 0000
T5CON 0120 TON TSIDL TGATE TCKPS1 TCKPS0 TCS 0000
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
IC1CON1 0140 ICSIDL ICTSEL2 ICTSEL1 ICTSEL0 ICI1 ICI0 ICOV ICBNE ICM2 ICM1 ICM0 0000
IC1CON2 0142 IC32 ICTRIG TRIGSTAT SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000D
IC1BUF 0144 IC1BUF 0000
IC1TMR 0146 IC1TMR xxxx
IC2CON1 0148 ICSIDL IC2TSEL2 IC2TSEL1 IC2TSEL0 ICI1 ICI0 ICOV ICBNE ICM2 ICM1 ICM0 0000
IC2CON2 014A IC32 ICTRIG TRIGSTAT SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000D
IC2BUF 014C IC2BUF 0000
IC2TMR 014E IC2TMR xxxx
DS39995B-page 44
IC3CON1 0150 ICSIDL IC3TSEL2 IC3TSEL1 IC3TSEL0 ICI1 ICI0 ICOV ICBNE ICM2 ICM1 ICM0 0000
IC3CON2 0152 IC32 ICTRIG TRIGSTAT SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000D
IC3BUF 0154 IC3BUF 0000
IC3TMR 0156 IC3TMR xxxx
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
DS39995B-page 45
PIC24FV32KA304 FAMILY
TABLE 4-8: OUTPUT COMPARE REGISTER MAP
All
File Name Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Resets
OC1CON1 0190 OCSIDL OCTSEL2 OCTSEL1 OCTSEL0 ENFLT2 ENFLT1 ENFLT0 OCFLT2 OCFLT1 OCFLT0 TRIGMODE OCM2 OCM1 OCM0 0000
OC1CON2 0192 FLTMD FLTOUT FLTTRIEN OCINV DCB1 DCB0 OC32 OCTRIG TRIGSTAT OCTRIS SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000C
OC1RS 0194 OC1RS 0000
OC1R 0196 OC1R 0000
OC1TMR 0198 OC1TMR xxxx
OC2CON1 019A OCSIDL OCTSEL2 OCTSEL1 OCTSEL0 ENFLT2 ENFLT1 ENFLT0 OCFLT2 OCFLT1 OCFLT0 TRIGMODE OCM2 OCM1 OCM0 0000
OC2CON2 019C FLTMD FLTOUT FLTTRIEN OCINV DCB1 DCB0 OC32 OCTRIG TRIGSTAT OCTRIS SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000C
OC2RS 019E OC2RS 0000
OC2R 01A0 OC2R 0000
OC2TMR 01A2 OC2TMR xxxx
OC3CON1 01A4 OCSIDL OCTSEL2 OCTSEL1 OCTSEL0 ENFLT2 ENFLT1 ENFLT0 OCFLT2 OCFLT1 OCFLT0 TRIGMODE OCM2 OCM1 OCM0 0000
OC3CON2 01A6 FLTMD FLTOUT FLTTRIEN OCINV DCB1 DCB0 OC32 OCTRIG TRIGSTAT OCTRIS SYNCSEL4 SYNCSEL3 SYNCSEL2 SYNCSEL1 SYNCSEL0 000C
OC3RS 01A8 OC3RS 0000
OC3R 01AA OC3R 0000
OC3TMR 01AC OC3TMR xxxx
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
2011 Microchip Technology Inc.
2011 Microchip Technology Inc.
PIC24FV32KA304 FAMILY
I2C2MSK 021C AMSK9 AMSK8 AMSK7 AMSK6 AMSK5 AMSK4 AMSK3 AMSK2 AMSK1 AMSK0 0000
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
U1MODE 0220 UARTEN USIDL IREN RTSMD UEN1 UEN0 WAKE LPBACK ABAUD RXINV BRGH PDSEL1 PDSEL0 STSEL 0000
U1STA 0222 UTXISEL1 UTXINV UTXISEL0 UTXBRK UTXEN UTXBF TRMT URXISEL1 URXISEL0 ADDEN RIDLE PERR FERR OERR URXDA 0110
U1TXREG 0224 U1TXREG xxxx
U1RXREG 0226 U1RXREG 0000
U1BRG 0228 BRG 0000
U2MODE 0230 UARTEN USIDL IREN RTSMD UEN1 UEN0 WAKE LPBACK ABAUD RXINV BRGH PDSEL1 PDSEL0 STSEL 0000
U2STA 0232 UTXISEL1 UTXINV UTXISEL0 UTXBRK UTXEN UTXBF TRMT URXISEL1 URXISEL0 ADDEN RIDLE PERR FERR OERR URXDA 0110
U2TXREG 0234 U2TXREG xxxx
U2RXREG 0236 U2RXREG 0000
U2BRG 0238 BRG 0000
DS39995B-page 46
PIC24FV32KA304 FAMILY
TABLE 4-11: SPI REGISTER MAP
File All
Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Name Resets
SPI1STAT 0240 SPIEN SPISIDL SPIBEC2 SPIBEC1 SPIBEC0 SRMPT SPIROV SR1MPT SISEL2 SISEL1 SISEL0 SPITBF SPIRBF 0000
SPI1CON1 0242 DISSCK DISSDO MODE16 SMP CKE SSEN CKP MSTEN SPRE2 SPRE1 SPRE0 PPRE1 PPRE0 0000
SPI1CON2 0244 FRMEN SPIFSD SPIFPOL SPIFE SPIBEN 0000
SPI1BUF 0248 SPI1BUF 0000
SPI2STAT 0260 SPIEN SPISIDL SPIBEC2 SPIBEC1 SPIBEC0 SRMPT SPIROV SRXMPT SISEL2 SISEL1 SISEL0 SPITBF SPIRBF 0000
SPI2CON1 0262 DISSCK DISSDO MODE16 SMP CKE SSEN CKP MSTEN SPRE2 SPRE1 SPRE0 PPRE1 PPRE0 0000
SPI2CON2 0264 FRMEN SPIFSD SPIFPOL SPIFE SPIBEN 0000
SPI2BUF 0268 SPI2BUF 0000
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
TRISA 02C0 TRISA11 TRISA10 TRISA9 TRISA8 TRISA7 TRISA6 TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 00DF
PORTA 02C2 RA11 RA10 RA9 RA8 RA7 RA6 RA5 RA4 RA3 RA2 RA1 RA0 xxxx
LATA 02C4 LATA11 LATA10 LATA9 LATA8 LATA7 LATA6 LATA4 LATA3 LATA2 LATA1 LATA0 xxxx
ODCA 02C6 ODA11 ODA10 ODA9 ODA8 ODA7 ODA6 ODA4 ODA3 ODA2 ODA1 ODA0 0000
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
Note 1: This bit is available only when MCLRE = 1.
2: These bits are not implemented in 20-pin devices.
3: These bits are not implemented in 28-pin devices.
4: These bits are not implemented in FV devices.
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 ODB15 ODB14 ODB13 ODB12 ODB11 ODB10 ODB9 ODB8 ODB7 ODB6 ODB5 ODB4 ODB3 ODB2 ODB1 ODB0 0000
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
Note 1: These bits not implemented in 20-pin devices.
2011 Microchip Technology Inc.
TRISC 02D0 TRISC9 TRISC8 TRISC7 TRISC6 TRISC5 TRISC4 TRISC3 TRISC2 TRISC1 TRISC0 03FF
PORTC 02D2 RC9 RC8 RC7 RC6 RC5 RC4 RC3 RC2 RC1 RC0 xxxx
LATC 02D4 LATC9 LATC8 LATC7 LATC6 LATC5 LATC4 LATC3 LATC2 LATC1 LATC0 xxxx
ODCC 02D6 ODC9 ODC8 ODC7 ODC6 ODC5 ODC4 ODC3 ODC2 ODC1 ODC0 0000
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
Note 1: PORTC is not implemented in 20-pin devices or 28-pin devices.
PIC24FV32KA304 FAMILY
DS39995B-page 48
DS39995B-page 49
PIC24FV32KA304 FAMILY
TABLE 4-16: ADC REGISTER MAP
File All
Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Name Resets
0000
AD1CHITL 0358 CHH15 CHH14 CHH13 CHH12 CHH11 CHH10 CHH9 CHH8 CHH7 CHH6 CHH5 CHH4 CHH3 CHH2 CHH1 CHH0 0000
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
2011 Microchip Technology Inc.
CTMUCON1 035A CTMUEN CTMUSIDL TGEN EDGEN EDGSEQEN IDISSEN CTTRIG 0000
CTMUCON2 035C EDG1EDGE EDG1POL EDG1SEL3 EDG1SEL2 EDG1SEL1 EDG1SEL0 EDG2 EDG1 EDG2EDGE EDG2POL EDG2SEL3 EDG2SEL2 EDG2SEL1 EDG2SEL0 0000
CTMUICON 035E ITRIM5 ITRIM4 ITRIM3 ITRIM2 ITRIM1 ITRIM0 IRNG1 IRNG0 0000
AD1CTMUENH 0360 CTMEN17 CTMEN16 0000
AD1CTMUENL 0362 CTMEN15 CTMEN14 CTMEN13 CTMEN12 CTMEN11 CTMEN10 CTMEN9 CTMEN8 CTMEN7 CTMEN6 CTMEN5 CTMEN4 CTMEN3 CTMEN2 CTMEN1 CTMEN0 0000
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
PIC24FV32KA304 FAMILY
Note 1: These bits are not implemented in 20-pin devices.
2: These bits are not implemented in 28-pin devices.
CMSTAT 0630 CMIDL C3EVT C2EVT C1EVT C3OUT C2OUT C1OUT xxxx
DS39995B-page 50
CVRCON 0632 CVREN CVROE CVRSS CVR4 CVR3 CVR2 CVR1 CVR0 0000
CM1CON 0634 CON COE CPOL CLPWR CEVT COUT EVPOL1 EVPOL0 CREF CCH1 CCH0 xxxx
CM2CON 0636 CON COE CPOL CLPWR CEVT COUT EVPOL1 EVPOL0 CREF CCH1 CCH0 0000
CM3CON 0638 CON COE CPOL CLPWR CEVT COUT EVPOL1 EVPOL0 CREF CCH1 CCH0 0000
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
DS39995B-page 51
PIC24FV32KA304 FAMILY
TABLE 4-21: CRC REGISTER MAP
File All
Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Name Resets
CRCCON1 0640 CRCEN CSIDL VWORD4 VWORD3 VWORD2 VWORD1 VWORD0 CRCFUL CRCMPT CRCISEL CRCGO LENDIAN 0000
CRCCON2 0642 DWIDTH4 DWIDTH3 DWIDTH2 DWIDTH1 DWIDTH0 PLEN4 PLEN3 PLEN2 PLEN1 PLEN0 0000
CRCXORL 0644 X15 X14 X13 X12 X11 X10 X9 X8 X7 X6 X5 X4 X3 X2 X1 0000
CRCXORH 0646 X31 X30 X29 X28 X27 X26 X25 X24 X23 X22 X21 X20 X19 X18 X17 X16 0000
CRCDATL 0648 CRCDATL xxxx
CRCDATH 064A CRCDATH xxxx
CRCWDATL 064C CRCWDATL xxxx
CRCWDATH 064E CRCWDATH xxxx
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
RCON 0740 TRAPR IOPUWR SBOREN LVREN DPSLP CM PMSLP EXTR SWR SWDTEN WDTO SLEEP IDLE BOR POR (Note 1)
OSCCON 0742 COSC2 COSC1 COSC0 NOSC2 NOSC1 NOSC0 CLKLOCK LOCK CF SOSCDRV SOSCEN OSWEN (Note 2)
CLKDIV 0744 ROI DOZE2 DOZE1 DOZE0 DOZEN RCDIV2 RCDIV1 RCDIV0 3140
OSCTUN 0748 TUN5 TUN4 TUN3 TUN2 TUN1 TUN0 0000
REFOCON 074E ROEN ROSSLP ROSEL RODIV3 RODIV2 RODIV1 RODIV0 0000
HLVDCON 0756 HLVDEN HLSIDL VDIR BGVST IRVST HLVDL3 HLVDL2 HLVDL1 HLVDL0 0000
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
Note 1: RCON register Reset values are dependent on type of Reset.
2: OSCCON register Reset values are dependent on configuration fuses and by type of Reset.
All
File Name Addr Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Resets
NVMCON 0760 WR WREN WRERR PGMONLY ERASE NVMOP5 NVMOP4 NVMOP3 NVMOP2 NVMOP1 NVMOP0 0000
NVMKEY 0766 NVMKEY 0000
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
Note 1: Reset value shown is for POR only. Value on other Reset states is dependent on the state of memory write or erase operations at the time of Reset.
PIC24FV32KA304 FAMILY
PMD1 0770 T5MD T4MD T3MD T2MD T1MD I2C1MD U2MD U1MD SPI2MD SPI1MD ADC1MD 0000
PMD2 0772 IC3MD IC2MD IC1MD OC3MD OC2MD OC1MD 0000
PMD3 0774 CMPMD RTCCMD CRCPMD I2C2MD 0000
PMD4 0776 ULPWUMD EEMD REFOMD CTMUMD HLVDMD 0000
Legend: = unimplemented, read as 0. Reset values are shown in hexadecimal.
DS39995B-page 52
PIC24FV32KA304 FAMILY
4.2.5 SOFTWARE STACK 4.3 Interfacing Program and Data
In addition to its use as a working register, the W15 Memory Spaces
register in PIC24F devices is also used as a Software
The PIC24F architecture uses a 24-bit wide program
Stack Pointer. The pointer always points to the first
space and 16-bit wide data space. The architecture is
available free word and grows from lower to higher
also a modified Harvard scheme, meaning that data
addresses. It predecrements for stack pops and
can also be present in the program space. To use this
post-increments for stack pushes, as shown in
data successfully, it must be accessed in a way that
Figure 4-4.
preserves the alignment of information in both spaces.
Note that for a PC push during any CALL instruction,
Apart from the normal execution, the PIC24F
the MSB of the PC is zero-extended before the push,
architecture provides two methods by which the
ensuring that the MSB is always clear.
program space can be accessed during operation:
Note: A PC push during exception processing Using table instructions to access individual bytes
will concatenate the SRL register to the or words anywhere in the program space
MSB of the PC prior to the push. Remapping a portion of the program space into
The Stack Pointer Limit Value (SPLIM) register, the data space, PSV
associated with the Stack Pointer, sets an upper Table instructions allow an application to read or write
address boundary for the stack. SPLIM is uninitialized small areas of the program memory. This makes the
at Reset. As is the case for the Stack Pointer, method ideal for accessing data tables that need to be
SPLIM<0> is forced to 0 as all stack operations must updated from time to time. It also allows access to all
be word-aligned. Whenever an EA is generated, using bytes of the program word. The remapping method
W15 as a source or destination pointer, the resulting allows an application to access a large block of data on
address is compared with the value in SPLIM. If the a read-only basis, which is ideal for look-ups from a
contents of the Stack Pointer (W15) and the SPLIM large table of static data. It can only access the least
register are equal, and a push operation is performed, significant word (lsw) of the program word.
a stack error trap will not occur. The stack error trap will
occur on a subsequent push operation. 4.3.1 ADDRESSING PROGRAM SPACE
Thus, for example, if it is desirable to cause a stack Since the address ranges for the data and program
error trap when the stack grows beyond address, spaces are 16 and 24 bits, respectively, a method is
0DF6, in RAM, initialize the SPLIM with the value, needed to create a 23-bit or 24-bit program address
0DF4. from 16-bit data registers. The solution depends on the
Similarly, a Stack Pointer underflow (stack error) trap is interface method to be used.
generated when the Stack Pointer address is found to For table operations, the 8-bit Table Memory Page
be less than 0800h. This prevents the stack from Address register (TBLPAG) is used to define a 32K word
interfering with the Special Function Register (SFR) region within the program space. This is concatenated
space. with a 16-bit EA to arrive at a full 24-bit program space
address. In this format, the Most Significant bit (MSb) of
Note: A write to the SPLIM register should not
TBLPAG is used to determine if the operation occurs in
be immediately followed by an indirect
the user memory (TBLPAG<7> = 0) or the configuration
read operation using W15.
memory (TBLPAG<7> = 1).
For remapping operations, the 8-bit Program Space
FIGURE 4-4: CALL STACK FRAME
Visibility Page Address register (PSVPAG) is used to
0000h 15 0
define a 16K word page in the program space. When
the MSb of the EA is 1, PSVPAG is concatenated with
the lower 15 bits of the EA to form a 23-bit program
space address. Unlike the table operations, this limits
Stack Grows Towards
23 Bits
EA 1/0
8 bits 16 bits
24 Bits
Select
1 EA 0
8 bits 15 bits
23 bits
Note 1: The LSb of program space addresses is always fixed as 0 in order to maintain word alignment of data in the
program and data spaces.
2: Table operations are not required to be word-aligned. Table read operations are permitted in the configuration
memory space.
Program Space
Data EA<15:0>
TBLPAG
00 23 16 8 0
00000000
23 15 0 000000h
00000000
00000000
002BFEh 00000000
Phantom Byte
TBLRDH.B (Wn<0> = 0)
TBLRDL.B (Wn<0> = 1)
TBLRDL.B (Wn<0> = 0)
TBLRDL.W
002BFEh
The data in the page
designated by
PSVPAG is mapped
into the upper half of
the data memory 8000h
space....
PSV Area
...while the lower 15 bits
of the EA specify an exact
address within the PSV
FFFFh area. This corresponds
exactly to the same lower
15 bits of the actual
program space address.
800000h
The PIC24FV32KA304 of devices contains internal 5.1 Table Instructions and Flash
Flash program memory for storing and executing appli- Programming
cation code. The memory is readable, writable and
erasable when operating with VDD over 1.8V. Regardless of the method used, Flash memory
programming is done with the table read and write
Flash memory can be programmed in three ways: instructions. These allow direct read and write access to
In-Circuit Serial Programming (ICSP) the program memory space from the data memory while
Run-Time Self Programming (RTSP) the device is in normal operating mode. The 24-bit target
Enhanced In-Circuit Serial Programming address in the program memory is formed using the
(Enhanced ICSP) TBLPAG<7:0> bits and the Effective Address (EA) from
a W register, specified in the table instruction, as
ICSP allows a PIC24FV32KA304 device to be serially depicted in Figure 5-1.
programmed while in the end application circuit. This is
simply done with two lines for the programming clock The TBLRDL and the TBLWTL instructions are used to
and programming data (which are named PGECx and read or write to bits<15:0> of program memory.
PGEDx, respectively), and three other lines for power TBLRDL and TBLWTL can access program memory in
(VDD), ground (VSS) and Master Clear/Program mode both Word and Byte modes.
Entry Voltage (MCLR/VPP). This allows customers to The TBLRDH and TBLWTH instructions are used to read
manufacture boards with unprogrammed devices and or write to bits<23:16> of program memory. TBLRDH
then program the microcontroller just before shipping and TBLWTH can also access program memory in Word
the product. This also allows the most recent firmware or Byte mode.
or custom firmware to be programmed.
24 Bits
Using
Program 0 Program Counter 0
Counter
Working Reg EA
User/Configuration Byte
Space Select 24-Bit EA Select
int __attribute__ ((space(auto_psv))) progAddr = &progAddr;// Global variable located in Pgm Memory
unsigned int offset;
#define NUM_INSTRUCTION_PER_ROW 64
int __attribute__ ((space(auto_psv))) progAddr = &progAddr;// Global variable located in Pgm Memory
unsigned int offset;
unsigned int i;
unsigned int progData[2*NUM_INSTRUCTION_PER_ROW]; // Buffer of data to write
FIGURE 6-1: DATA EEPROM ADDRESSING WITH TBLPAG AND NVM ADDRESS REGISTERS
24-Bit PM Address
7Fh xxxxh
0 TBLPAG W Register EA 0
NVMADRU NVMADR
6.4 Data EEPROM Operations Note 1: Unexpected results will be obtained if the
The EEPROM block is accessed using table read and user attempts to read the EEPROM while
write operations similar to those used for program a programming or erase operation is
memory. The TBLWTH and TBLRDH instructions are not underway.
required for data EEPROM operations since the 2: The C30 C compiler includes library
memory is only 16 bits wide (data on the lower address procedures to automatically perform the
is valid only). The following programming operations table read and table write operations,
can be performed on the data EEPROM: manage the Table Pointer and write
Erase one, four or eight words buffers, and unlock and initiate memory
write sequences. This eliminates the
Bulk erase the entire data EEPROM
need to create assembler macros or time
Write one word
critical routines in C for each application.
Read one word
The library procedures are used in the code examples
detailed in the following sections. General descriptions
of each process are provided for users who are not
using the C30 compiler libraries.
EXAMPLE 6-5: READING THE DATA EEPROM USING THE TBLRD COMMAND
int __attribute__ ((space(eedata))) eeData = 0x1234; // Global variable located in EEPROM
int data; // Data read from EEPROM
unsigned int offset;
The Reset module combines all Reset sources and All types of device Reset will set a corresponding status
controls the device Master Reset Signal, SYSRST. The bit in the RCON register to indicate the type of Reset
following is a list of device Reset sources: (see Register 7-1). A POR will clear all bits except for
the BOR and POR bits (RCON<1:0>) which are set.
POR: Power-on Reset The user may set or clear any bit at any time during
MCLR: Pin Reset code execution. The RCON bits only serve as status
SWR: RESET Instruction bits. Setting a particular Reset status bit in software will
WDTR: Watchdog Timer Reset not cause a device Reset to occur.
BOR: Brown-out Reset The RCON register also has other bits associated with
Low-Power BOR/Deep Sleep BOR the Watchdog Timer (WDT) and device power-saving
TRAPR: Trap Conflict Reset states. The function of these bits is discussed in other
IOPUWR: Illegal Opcode Reset sections of this manual.
UWR: Uninitialized W Register Reset
Note: The status bits in the RCON register
A simplified block diagram of the Reset module is should be cleared after they are read so
shown in Figure 7-1. that the next RCON register value after a
device Reset will be meaningful.
RESET
Instruction
Glitch Filter
MCLR
WDT
Module
Sleep or Idle
00 Brown-out BOR
0
Reset
RCON<SBOREN> 01
SLEEP 10 Enable Voltage Regulator
1 11 (PIC24FV32KA3XX only)
Configuration Mismatch
Trap Conflict
Illegal Opcode
Uninitialized W Register
Note 1: All of the Reset status bits may be set or cleared in software. Setting one of these bits in software does not
cause a device Reset.
2: If the FWDTEN Configuration bit is 1 (unprogrammed), the WDT is always enabled, regardless of the
SWDTEN bit setting.
3: On PIC24FV32KA3xx parts only, not used on PIC24F32KA3XX.
Note 1: All of the Reset status bits may be set or cleared in software. Setting one of these bits in software does not
cause a device Reset.
2: If the FWDTEN Configuration bit is 1 (unprogrammed), the WDT is always enabled, regardless of the
SWDTEN bit setting.
3: On PIC24FV32KA3xx parts only, not used on PIC24F32KA3XX.
7.1 Clock Source Selection at Reset TABLE 7-2: OSCILLATOR SELECTION vs.
TYPE OF RESET (CLOCK
If clock switching is enabled, the system clock source at
SWITCHING ENABLED)
device Reset is chosen, as shown in Table 7-2. If clock
switching is disabled, the system clock source is always Reset Type Clock Source Determinant
selected according to the oscillator Configuration bits.
POR FNOSC Configuration bits
For more information, see Section 9.0 Oscillator
BOR (FNOSC<10:8>)
Configuration.
MCLR COSC Control bits
WDTO (OSCCON<14:12>)
SWR
Note: For detailed operating frequency and timing specifications, see Section 29.0 Electrical Characteristics.
R/W-0, HSC R/W-0, HSC R/W-0, HSC R-0, HSC R/W-0, HSC R/W-0, HSC R/W-0, HSC R/W-0, HSC
(2,3) IPL1(2,3) IPL0(2,3) RA(1) N(1) OV(1) Z(1) C(1)
IPL2
bit 7 bit 0
Note 1: See Register 3-1 for the description of these bits, which are not dedicated to interrupt control functions.
2: The IPL bits are concatenated with the IPL3 bit (CORCON<3>) to form the CPU interrupt priority level.
The value in parentheses indicates the interrupt priority level if IPL3 = 1.
3: The IPL Status bits are read-only when NSTDIS (INTCON1<15>) = 1.
Note: Bit 8 and bits 4 through 0 are described in Section 3.0 CPU.
Note 1: See Register 3-2 for the description of this bit, which is not dedicated to interrupt control functions.
2: The IPL3 bit is concatenated with the IPL<2:0> bits (SR<7:5>) to form the CPU interrupt priority level.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Primary Oscillator
REFOCON<15:8>
XT, HS, EC
OSCO
Reference Clock
Generator
XTPLL, HSPLL
OSCI ECPLL,FRCPLL
4 x PLL
REFO
8 MHz
Postscaler
8 MHz 4 MHz
FRCDIV
FRC
Oscillator
Peripherals
500 kHz
LPFRC CLKDIV<10:8> FRC
Oscillator
CLKO
LPRC LPRC
Postscaler
Secondary Oscillator
SOSC
SOSCO
CLKDIV<14:12>
SOSCEN
Enable
SOSCI Oscillator Clock Control Logic
Fail-Safe
Clock
Monitor
R/SO-0, HSC U-0 R-0, HSC(2) U-0 R/CO-0, HS R/W-0(3) R/W-0 R/W-0
CLKLOCK LOCK CF SOSCDRV SOSCEN OSWEN
bit 7 bit 0
Note 1: Reset values for these bits are determined by the FNOSC Configuration bits.
2: Also resets to 0 during any valid clock switch or whenever a non-PLL Clock mode is selected.
3: When SOSC is selected to run from a digital clock input, rather than an external crystal (SOSCSRC = 0),
this bit has no effect.
Note 1: Reset values for these bits are determined by the FNOSC Configuration bits.
2: Also resets to 0 during any valid clock switch or whenever a non-PLL Clock mode is selected.
3: When SOSC is selected to run from a digital clock input, rather than an external crystal (SOSCSRC = 0),
this bit has no effect.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: This bit is automatically cleared when the ROI bit is set and an interrupt occurs.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: Increments or decrements of TUN<5:0> may not change the FRC frequency in equal steps over the FRC
tuning range and may not be monotonic.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: The crystal oscillator must be enabled using the FOSC<2:0> bits; the crystal maintains the operation in
Sleep mode.
Note 1: All register bits are reset only in the case of a POR event outside of Deep Sleep mode.
2: Unlike all other events, a Deep Sleep BOR event will NOT cause a wake-up from Deep Sleep; this re-arms
POR.
Note 1: All register bits are cleared when the DSEN (DSCON<15>) bit is set.
2: All register bits are reset only in the case of a POR event outside of Deep Sleep mode, except bit,
DSPOR, which does not reset on a POR event that is caused due to a Deep Sleep exit.
3: Unlike the other bits in this register, this bit can be set outside of Deep Sleep.
2. Stop charging the capacitor by configuring RB0 for(i = 0; i < 10000; i++) Nop();
as an input. //*****************************
3. Discharge the capacitor by setting the ULPEN //2. Stop Charging the capacitor
and ULPSINK bits in the ULPWCON register. // on RB0
4. Configure Sleep mode. //*****************************
5. Enter Sleep mode. TRISBbits.TRISB0 = 1;
When the voltage on RB0 drops below VIL, the device //*****************************
wakes up and executes the next instruction. //3. Enable ULPWU Interrupt
This feature provides a low-power technique for //*****************************
periodically waking up the device from Sleep mode. IFS5bits.ULPWUIF = 0;
IEC5bits.ULPWUIE = 1;
The time-out is dependent on the discharge time of the
IPC21bits.ULPWUIP = 0x7;
RC circuit on RB0.
//*****************************
When the ULPWU module wakes the device from
//4. Enable the Ultra Low Power
Sleep mode, the ULPWUIF bit (IFS5<0>) is set. Soft-
ware can check this bit upon wake-up to determine the // Wakeup module and allow
wake-up source. // capacitor discharge
C1
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Doze mode is enabled by setting the DOZEN bit Both bits have similar functions in enabling or disabling
(CLKDIV<11>). The ratio between peripheral and core its associated module. Setting the PMD bit for a module
clock speed is determined by the DOZE<2:0> bits disables all clock sources to that module, reducing its
(CLKDIV<14:12>). There are eight possible power consumption to an absolute minimum. In this
configurations, from 1:1 to 1:128, with 1:1 being the state, the control and status registers associated with
default. the peripheral will also be disabled, so writes to those
registers will have no effect, and read values will be
It is also possible to use Doze mode to selectively reduce invalid. Many peripheral modules have a corresponding
power consumption in event driven applications. This PMD bit.
allows clock-sensitive functions, such as synchronous
communications, to continue without interruption. Mean- In contrast, disabling a module by clearing its XXXEN
while, the CPU Idles, waiting for something to invoke an bit, disables its functionality, but leaves its registers
interrupt routine. Enabling the automatic return to available to be read and written to. Power consumption
full-speed CPU operation on interrupts is enabled by is reduced, but not by as much as the PMD bits are
setting the ROI bit (CLKDIV<15>). By default, interrupt used. Most peripheral modules have an enable bit;
events have no effect on Doze mode operation. exceptions include capture, compare and RTCC.
To achieve more selective power savings, peripheral
modules can also be selectively disabled when the
device enters Idle mode. This is done through the control
bit of the generic name format, XXXIDL. By default, all
modules that can operate during Idle mode will do so.
Using the disable on Idle feature disables the module
while in Idle mode, allowing further reduction of power
consumption during Idle mode, enhancing power
savings for extremely critical power applications.
PIO Module 1
Output Data
Read TRIS 0
Data Bus
D Q I/O Pin
WR TRIS
CK
TRIS Latch
D Q
WR LAT +
CK
WR PORT
Data Latch
Read LAT
Input Data
Read PORT
Equivalent C Code
TRISB = 0xFF00; //Configure PORTB<15:8> as inputs and PORTB<7:0> as outputs
NOP(); //Delay 1 cycle
if(PORTBbits.RB13 == 1) // execute following code if PORTB pin 13 is set.
{
}
TCKPS<1:0>
SOSCO/ TON 2
1x
T1CK
Gate Prescaler
SOSCEN Sync 01 1, 8, 64, 256
SOSCI
TCY 00
TGATE
TGATE TCS
1 Q D
Set T1IF
0 Q CK
0
Reset
TMR1
1 Sync
Comparator TSYNC
Equal
PR1
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
TCKPS<1:0>
T2CK TON 2
1x
(T4CK)
Gate Prescaler
Sync 01 1, 8, 64, 256
TCY 00
TGATE TGATE
TCS
1 Q D
Set T3IF (T5IF)
Q CK
0
PR3 PR2
(PR5) (PR4)
MSB LSB
TMR3 TMR2
Sync
Reset (TMR5) (TMR4)
16
(1)
Read TMR2 (TMR4)
Write TMR2 (TMR4)(1)
16
TMR3HLD 16
(TMR5HLD)
Data Bus<15:0>
Note 1: The 32-bit Timer Configuration bit, T32, must be set for 32-bit timer/counter operation. All control bits are
respective to the T2CON and T4CON registers.
2: The ADC event trigger is available only on Timer2/3 in 32-bit mode and Timer3 in 16-bit mode.
TCKPS<1:0>
TON 2
T2CK 1x
(T4CK)
Gate Prescaler
Sync 01 1, 8, 64, 256
TGATE 00
TCY TCS
1 Q D TGATE
Set T2IF (T4IF) Q CK
0
Reset
TMR2 (TMR4) Sync
Comparator
Equal
PR2 (PR4)
TCKPS<1:0>
T3CK TON 2
Sync 1x
(T5CK)
Prescaler
01 1, 8, 64, 256
TGATE 00
TCY TCS
1 Q D TGATE
Set T3IF (T5IF)
Q CK
0
Reset
TMR3 (TMR5)
PR3 (PR5)
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: In 32-bit mode, the T3CON or T5CON control bits do not affect 32-bit timer operation.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: When 32-bit operation is enabled (TxCON<3> = 1), these bits have no effect on Timery operation. All timer
functions are set through TxCON.
ICTSEL<2:0>
Clock Increment 16
IC Clock Select ICxTMR 4-Level FIFO Buffer
Sources 16
Trigger and
Sync Logic 16
Reset
Trigger and ICxBUF
Sync Sources
SYNCSEL<4:0>
Trigger
ICOV, ICBNE System Bus
U-0 R/W-0 R/W-0 R-0, HCS R-0, HCS R/W-0 R/W-0 R/W-0
ICI1 ICI0 ICOV ICBNE ICM2(1) ICM1(1) ICM0(1)
bit 7 bit 0
Note 1: Use these inputs as trigger sources only and never as sync sources.
DCBx
OCMx
OCxCON1 OCINV
OCTRIS
OCTSELx
OCxCON2 FLTOUT
SYNCSELx
FLTTRIEN
TRIGSTAT
FLTMD
TRIGMODE
ENFLTx
OCTRIG OCxR OCFLTx
OCx Interrupt
FIGURE 15-2: OUTPUT COMPARE BLOCK DIAGRAM (DOUBLE-BUFFERED, 16-BIT PWM MODE)
OCxCON1
OCMx
OCxCON2 OCINV
OCTSELx OCTRIS
SYNCSELx OCxR and DCB<1:0> FLTOUT
TRIGSTAT FLTTRIEN
TRIGMODE FLTMD
OCTRIG Rollover/Reset ENFLTx
OCFLTx
OCxR and DCB<1:0> Buffers DCB<1:0>
OCx Pin
Comparator Match
Clock Increment
OC Clock Event
Select
Sources
OC Output Timing
OCxTMR
Rollover and Fault Logic
Reset
Comparator OCFA/OCFB/CxOUT
Match Event Match
Trigger and Event
Trigger and
Sync Sources Sync Logic
OCxRS Buffer
Rollover/Reset
OCxRS
OCx Interrupt
Reset
log10 (F
PWM
FCY
(Prescale Value) ) bits
Maximum PWM Resolution (bits) =
log10(2)
Note 1: Based on FCY = FOSC/2, Doze mode and PLL are disabled.
Note 1: Based on TCY = 2 * TOSC; Doze mode and PLL are disabled.
TABLE 15-1: EXAMPLE PWM FREQUENCIES AND RESOLUTIONS AT 4 MIPS (FCY = 4 MHz)(1)
PWM Frequency 7.6 Hz 61 Hz 122 Hz 977 Hz 3.9 kHz 31.3 kHz 125 kHz
Prescaler Ratio 8 1 1 1 1 1 1
Period Value FFFFh FFFFh 7FFFh 0FFFh 03FFh 007Fh 001Fh
Resolution (bits) 16 16 15 12 10 7 5
Note 1: Based on FCY = FOSC/2; Doze mode and PLL are disabled.
TABLE 15-2: EXAMPLE PWM FREQUENCIES AND RESOLUTIONS AT 16 MIPS (FCY = 16 MHz)(1)
PWM Frequency 30.5 Hz 244 Hz 488 Hz 3.9 kHz 15.6 kHz 125 kHz 500 kHz
Prescaler Ratio 8 1 1 1 1 1 1
Period Value FFFFh FFFFh 7FFFh 0FFFh 03FFh 007Fh 001Fh
Resolution (bits) 16 16 15 12 10 7 5
Note 1: Based on FCY = FOSC/2; Doze mode and PLL are disabled.
R/W-0 R/W-0, HCS R/W-0, HCS R/W-0, HCS R/W-0 R/W-0 R/W-0 R/W-0
(1) (1)
ENFLT0 OCFLT2 OCFLT1 OCFLT0 TRIGMODE OCM2 OCM1 OCM0(1)
bit 7 bit 0
Note 1: The comparator module used for Fault input varies with the OCx module. OC1 and OC2 use
Comparator 1; OC3 and OC4 use Comparator 2; OC5 uses Comparator 3.
Note 1: The comparator module used for Fault input varies with the OCx module. OC1 and OC2 use
Comparator 1; OC3 and OC4 use Comparator 2; OC5 uses Comparator 3.
Note 1: Do not use an OC module as its own trigger source, either by selecting this mode or another equivalent
SYNCSEL setting.
2: Use these inputs as trigger sources only and never as sync sources.
3: These bits affect the rising edge when OCINV = 1. The bits have no effect when the OCM bits
(OCxCON1<2:0>) = 001.
Note 1: Do not use an OC module as its own trigger source, either by selecting this mode or another equivalent
SYNCSEL setting.
2: Use these inputs as trigger sources only and never as sync sources.
3: These bits affect the rising edge when OCINV = 1. The bits have no effect when the OCM bits
(OCxCON1<2:0>) = 001.
Transfer Transfer
SPI1BUF
16
Internal Data Bus
SCK1
1:1 to 1:8 1:1/4/16/64
Secondary Primary FCY
Prescaler Prescaler
SS1/FSYNC1
Sync Control Select
Control Clock Edge SPI1CON1<1:0>
Transfer Transfer
SPI1BUF
16
Internal Data Bus
R-0,HSC R/C-0, HS R/W-0, HSC R/W-0 R/W-0 R/W-0 R-0, HSC R-0, HSC
SRMPT SPIROV SRXMPT SISEL2 SISEL1 SISEL0 SPITBF SPIRBF
bit 7 bit 0
Legend: C = Clearable bit HS = Hardware Settable bit HSC = Hardware Settable/Clearable bit
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: The CKE bit is not used in the Framed SPI modes. The user should program this bit to 0 for the Framed
SPI modes (FRMEN = 1).
Note 1: The CKE bit is not used in the Framed SPI modes. The user should program this bit to 0 for the Framed
SPI modes (FRMEN = 1).
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: Based on FCY = FOSC/2; Doze mode and PLL are disabled.
Internal
Data Bus
I2C1RCV
Read
Shift
SCL1 Clock
I2C1RSR
LSB
I2C1MSK
Write Read
I2C1ADD
Read
Read
Collision Write
Detect
I2C1CON
Acknowledge
Generation Read
Clock
Stretching
Write
I2C1TRN
LSB
Read
Shift Clock
Reload
Control
Write
Read
TCY/2
R/C-0, HS R/C-0, HS R-0, HSC R/C-0, HSC R/C-0, HSC R-0, HSC R-0, HSC R-0, HSC
IWCOL I2COV D/A P S R/W RBF TBF
bit 7 bit 0
Legend: C = Clearable bit HS = Hardware Settable bit HSC = Hardware Settable/Clearable bit
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
IrDA UxBCLK
Note 1: Based on FCY = FOSC/2; Doze mode and PLL are disabled.
Note 1: This feature is is only available for the 16x BRG mode (BRGH = 0).
2: Bit availability depends on pin availability.
R/W-0 R/W-0 R/W-0 U-0 R/W-0, HC R/W-0 R-0, HSC R-1, HSC
UTXISEL1 UTXINV UTXISEL0 UTXBRK UTXEN UTXBF TRMT
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R-1, HSC R-0, HSC R-0, HSC R/C-0, HS R-0, HSC
URXISEL1 URXISEL0 ADDEN RIDLE PERR FERR OERR URXDA
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
R-0, HSC R-0, HSC R-0, HSC R-0, HSC R-0, HSC R-0, HSC R-0, HSC R-0, HSC
URX7 URX6 URX5 URX4 URX3 URX2 URX1 URX0
bit 7 bit 0
ALMTHDY
Alarm Registers with Masks ALRMVAL ALWDHR
ALMINSEC
Repeat Counter
RTSECSEL<1:0>
RTCC 1s
Interrupt
RTCC Interrupt Logic 01
Alarm Pulse
00
10 RTCC
Clock Source Pin
RTCOE
R/W-0 U-0 R/W-0 R-0, HSC R-0, HSC R/W-0 R/W-0 R/W-0
(2)
RTCEN RTCWREN RTCSYNC HALFSEC(3) RTCOE RTCPTR1 RTCPTR0
bit 15 bit 8
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
19.5 POWER CONTROL The polarity of the PWC control signal may be chosen
using the PWCP register bit. Active-low or active-high
The RTCC includes a power control feature that allows may be used with the appropriate external switch to
the device to periodically wake-up an external device, turn on or off the power to one or more external
wait for the device to be stable before sampling wake-up devices. The active-low setting may also be used in
events from that device and then shut down the external conjunction with an open-drain setting on the RTCC
device. This can be done completely autonomously by pin. This setting is able to drive the GND pin(s) of the
the RTCC, without the need to wake from the current external device directly (with the appropriate external
low-power mode (Sleep, Deep Sleep, etc.). VDD pull-up device), without the need for external
To enable this feature, the RTCC must be enabled switches. Finally, the CHIME bit should be set to enable
(RTCEN = 1), the PWCEN register bit must be set and the PWC periodicity.
the RTCC pin must be driving the PWC control signal
(RTCOE = 1 and RTCSECSEL<1:0> = 11).
CRCDATH CRCDATL
CRCISEL
0 1 LENDIAN
CRCWDATH CRCWDATL
CRCWDATH CRCWDATL
Read/Write Bus
Shift Buffer
Data Bit 0 Bit 1 Bit 2 Bit n(2)
Note 1: Each XOR stage of the shift engine is programmable; see text for details.
2: Polynomial length n is determined by ([PLEN<3:0>] + 1)
R-0, HCS R-1, HCS R/W-0 R/W-0, HC R/W-0 U-0 U-0 U-0
CRCFUL CRCMPT CRCISEL CRCGO LENDIAN
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Externally Generated
Trip Point
VDD
VDD HLVDL<3:0>
HLVDIN
HLVDEN VDIR
16-to-1 MUX
Set
HLVDIF
-
Internal Voltage
Reference
1.024V Typical
HLVDEN
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: For the actual trip point, see Section 29.0 Electrical Characteristics.
AN1
12-Bit SAR Conversion Logic
AN2
AN3
AN6
MUX A
ADC1BUF0:
ADC1BUF17
AN7
AN8 AD1CON1
AN9 VINL AD1CON2
AD1CON3
AD1CON5
AD1CHS
AD1CHITL
AD1CHITH
AN14 AD1CSSL
VINH AD1CSSH
MUX B
AN15
CTMU
Temp. Sensor
VINL
CTMU
Sample Control Control Logic
VBG Conversion Control
0.215 *
VDD
AVDD
AVss
R/W-0 R/W-0 R/W-0 R/W-0 U-0 R/W-0 R/W-0 HSC R/C-0 HSC
SSRC3 SSRC2 SSRC1 SSRC0 ASAM SAMP DONE
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: Only applicable when the buffer is used in FIFO mode (BUFREGEN = 0). In addition, BUFS is only used
when BUFM = 1.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
REGISTER 22-7: AD1CHITL: A/D SCAN COMPARE HIT REGISTER (LOW WORD)(1)
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CHH15 CHH14 CHH13 CHH12 CHH11 CHH10 CHH9 CHH8
bit 15 bit 8
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: Unimplemented channels are read as 0. Do not select unimplemented channels for sampling as
indeterminate results may be produced.
REGISTER 22-9: AD1CSSL: A/D INPUT SCAN SELECT REGISTER (LOW WORD)(1)
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CSS15 CSS14 CSS13 CSS12 CSS11 CSS10 CSS9 CSS8
bit 15 bit 8
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: Unimplemented channels are read as 0. Do not select unimplemented channels for sampling as
indeterminate results may be produced.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
CPIN CHOLD
VA ILEAKAGE = 4.4 pF
500 nA
VSS
Note: CPIN value depends on device package and is not tested. Effect of CPIN negligible if Rs 5 k.
Output Code
(Binary (Decimal))
(VINH VINL)
VR+
VR-
VR+ VR-
4096
4096
4096
Voltage Level
VR- +
VR-+
VR- +
CCH<1:0>
CREF
EVPOL<1:0>
Trigger/Interrupt CEVT
CXINB Logic
Input CPOL COE
VIN-
CXINC Select
VIN+ C1
Logic
CXIND C1OUT
COUT Pin
VBG/2
Trigger/Interrupt CEVT
CPOL Logic COE
VIN-
VIN+ C2
C2OUT
COUT Pin
EVPOL<1:0>
Trigger/Interrupt CEVT
CPOL Logic COE
CXINA VIN-
VIN+ C3
CVREF
C3OUT
COUT Pin
COE
VIN- -
VIN+ Cx
Off (Read as 0) CxOUT
Pin
Comparator CxINB > CxINA Compare Comparator CxINC > CxINA Compare
CON = 1, CREF = 0, CCH<1:0> = 00 CON = 1, CREF = 0, CCH<1:0> = 01
COE COE
VIN- - VIN- -
CXINB CXINC
VIN+ Cx VIN+ Cx
CXINA CxOUT CXINA CxOUT
Pin Pin
Comparator CxIND > CxINA Compare Comparator VBG > CxINA Compare
CON = 1, CREF = 0, CCH<1:0> = 10 CON = 1, CREF = 0, CCH<1:0> = 11
COE COE
VIN- - VIN- -
CXIND VBG/2
VIN+ Cx VIN+ Cx
CXINA CxOUT CXINA CxOUT
Pin Pin
Comparator CxINB > CVREF Compare Comparator CxINC > CVREF Compare
CON = 1, CREF = 1, CCH<1:0> = 00 CON = 1, CREF = 1, CCH<1:0> = 01
COE COE
VIN- - VIN-
CXINB CXINC -
VIN+ Cx VIN+ Cx
CVREF CxOUT CVREF CxOUT
Pin Pin
Comparator CxIND > CVREF Compare Comparator VBG > CVREF Compare
CON = 1, CREF = 1, CCH<1:0> = 10 CON = 1, CREF = 1, CCH<1:0> = 11
COE COE
VIN- - VIN- -
CXIND VBG/2
VIN+ Cx VIN+ Cx
CVREF CxOUT CVREF CxOUT
Pin Pin
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
U-0 U-0 U-0 U-0 U-0 R-0, HSC R-0, HSC R-0, HSC
C3OUT C2OUT C1OUT
bit 7 bit 0
CVRSS = 1
VREF+
AVDD
CVRSS = 0 8R
CVR<3:0>
R
CVREN
32-to-1 MUX
32 Steps
CVREF
8R
CVRSS = 1
VREF-
CVRSS = 0
AVSS
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
PIC24F Device
Timer1
CTMU
EDG1 Current Source
EDG2
Output Pulse
A/D Converter
ANx
ANY
CAPP RPR
PIC24F Device
CTMU
CTEDX EDG1
Current Source
CTEDX EDG2
Output Pulse
A/D Converter
ANx
CAD
RPR
PIC24F Device
CTMU
CTEDX EDG1 CTPLS
Current Source
Comparator
C2INB -
C2
CDELAY CVREF
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: Edge sources, CTED11 and CTED12, are not available on PIC24FV32KA302 devices.
2: Edge sources, CTED3,CTED11, CTED12 and CTED13, are not available on PIC24FV32KA301 devices.
Note 1: Edge sources, CTED11 and CTED12, are not available on PIC24FV32KA302 devices.
2: Edge sources, CTED3,CTED11, CTED12 and CTED13, are not available on PIC24FV32KA301 devices.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit C = Clearable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
bit 7-6 FCKSM<1:0>: Clock Switching and Monitor Selection Configuration bits
1x = Clock switching is disabled, Fail-Safe Clock Monitor is disabled
01 = Clock switching is enabled, Fail-Safe Clock Monitor is disabled
00 = Clock switching is enabled, Fail-Safe Clock Monitor is enabled
bit 5 SOSCSEL: Secondary Oscillator Power Selection Configuration bit
1 = Secondary oscillator is configured for high-power operation
0 = Secondary oscillator is configured for low-power operation
bit 4-3 POSCFREQ<1:0>: Primary Oscillator Frequency Range Configuration bits
11 = Primary oscillator/external clock input frequency is greater than 8 MHz
10 = Primary oscillator/external clock input frequency is between 100 kHz and 8 MHz
01 = Primary oscillator/external clock input frequency is less than 100 kHz
00 = Reserved; do not use
bit 2 OSCIOFNC: CLKO Enable Configuration bit
1 = CLKO output signal active on the OSCO pin; primary oscillator must be disabled or configured for
the External Clock mode (EC) for the CLKO to be active (POSCMD<1:0> = 11 or 00)
0 = CLKO output disabled
bit 1-0 POSCMD<1:0>: Primary Oscillator Configuration bits
11 = Primary Oscillator mode is disabled
10 = HS Oscillator mode is selected
01 = XT Oscillator mode is selected
00 = External Clock mode is selected
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Note 1: This setting only applies to the FV devices. This bit is reserved and should be maintained as 1 on F
devices.
2: The MCLRE fuse can only be changed when using the VPP-Based ICSP mode entry. This prevents a
user from accidentally locking out the device from the low-voltage test entry.
3: Refer to Section 29.0 Electrical Characteristics for BOR voltages.
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
R R R R R R R R
FAMID7 FAMID6 FAMID5 FAMID4 FAMID3 FAMID2 FAMID1 FAMID0
bit 15 bit 8
R R R R R R R R
DEV7 DEV6 DEV5 DEV4 DEV3 DEV2 DEV1 DEV0
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
00010110 = PIC24F32KA304
00000110 = PIC24F16KA304
00010010 = PIC24F32KA302
00000010 = PIC24F16KA302
00011000 = PIC24F32KA301
00001000 = PIC24F16KA301
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
For all PIC24FV32KA304 devices, the on-chip regula- 26.3 Watchdog Timer (WDT)
tor provides a constant voltage of 3.0V nominal to the
digital core logic. The regulator can provide this level For the PIC24FV32KA304 family of devices, the WDT
from a VDD of about 3.0V, all the way up to the devices is driven by the LPRC oscillator. When the WDT is
VDDMAX. It does not have the capability to boost VDD enabled, the clock source is also enabled.
levels below 3.0V. In order to prevent brown out con- The nominal WDT clock source from LPRC is 31 kHz.
ditions when the voltage drops too low for the regulator, This feeds a prescaler that can be configured for either
the regulator enters Tracking mode. In Tracking mode, 5-bit (divide-by-32) or 7-bit (divide-by-128) operation.
the regulator output follows VDD with a typical voltage The prescaler is set by the FWPSA Configuration bit.
drop of 100 mV. With a 31 kHz input, the prescaler yields a nominal
When the device enters Tracking mode, it is no longer WDT time-out period (TWDT) of 1 ms in 5-bit mode or
possible to operate at full speed. To provide information 4 ms in 7-bit mode.
about when the device enters Tracking mode, the A variable postscaler divides down the WDT prescaler
on-chip regulator includes a simple, High/Low-Voltage output and allows for a wide range of time-out periods.
Detect (HLVD) circuit. When VDD drops below full-speed The postscaler is controlled by the Configuration bits,
operating voltage, the circuit sets the High/Low-Voltage WDTPS<3:0> (FWDT<3:0>), which allow the selection
Detect Interrupt Flag, HLVDIF (IFS4<8>). This can be of a total of 16 settings, from 1:1 to 1:32,768. Using the
used to generate an interrupt and put the application into prescaler and postscaler time-out periods, ranging
a low-power operational mode or trigger an orderly from 1 ms to 131 seconds, can be achieved.
shutdown. High/Low-Voltage Detection is only available
for FV parts.
SWDTEN
LPRC Control
FWDTEN Wake from Sleep
FWPSA WDTPS<3:0>
Transition to
New Clock Source
Exit Sleep or
Idle Mode
CLRWDT Instr.
PWRSAV Instr.
Note 1: Maximum allowable current is a function of device maximum power dissipation (see Table 29-1).
NOTICE: Stresses above those listed under Absolute Maximum Ratings may cause permanent damage to the
device. This is a stress rating only and functional operation of the device at those or any other conditions above those
indicated in the operation listings of this specification is not implied. Exposure to maximum rating conditions for
extended periods may affect device reliability.
5.5V 5.5V
3.20V 3.20V
Voltage (VDD)
2.00V
8 MHz 32 MHz
Frequency
Note: For frequencies between 8 MHz and 32 MHz, FMAX = 20 MHz *(VDD 2.0) + 8 MHz.
3.60V 3.60V
3.00V 3.00V
Voltage (VDD)
1.80V
8 MHz 32 MHz
Frequency
Note: For frequencies between 8 MHz and 32 MHz, FMAX = 20 MHz * (VDD 1.8) + 8 MHz.
Param
Symbol Characteristics Min Typ Max Units Comments
No.
VBG Band Gap Reference Voltage 0.973 1.024 1.075 V
TBG Band Gap Reference Start-up 1 ms
Time
VRGOUT Regulator Output Voltage 3.1 3.3 3.6 V
CEFC External Filter Capacitor Value 4.7 10 F Series resistance < 3 Ohm
recommended;
< 5 Ohm required.
VLVR Low-Voltage Regulator Output 2.6 V
Voltage
Load Condition 1 for all pins except OSCO Load Condition 2 for OSCO
VDD/2
RL Pin CL
VSS
CL
Pin RL = 464
CL = 50 pF for all pins except OSCO
VSS
15 pF for OSCO output
Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3
OSCI
OS20
OS30 OS30 OS31 OS31
OS25
CLKO
OS40 OS41
I/O Pin
(Input)
DI35
DI40
PIC24FV32KA301
-I/P e3
1010017
PIC24FV32KA302
-I/SP e3
1010017
PIC24FV32KA
301-I/SS e3
1010017
PIC24FV32KA
302-I/SS e3
1010017
Note: In the event the full Microchip part number cannot be marked on one line, it
will be carried over to the next line, thus limiting the number of available
characters for customer-specific information.
PIC24FV32KA301
-I/SO e3
1010017
PIC24FV32KA302
-I/SO e3
1010017
PIC24FV32KA
302-I/ML e3
1010017
PIC24FV32KA
304-I/ML e3
1010017
PIC24FV32KA
304-I/PT e3
1010017
PIC24FV32KA
304-I/MV e3
1010017
3&
'!&"
&
4
#*!(
!
!
&
4
%&&
#&
&&
255***'
'5
4
NOTE 1 E1
1 2 3
A A2
L
c
A1
b1
b e eB
6&! 7,8.
'
!9'&! 7 7: ;
7"')
%! 7
&
1,
&
&
< <
#
#4
4
!! -
1!
&
&
< <
"#
&"#
=#& . - - -
#
#4
=#& . >
:
9
& > - ?
&
&
9 -
9
#4
!! >
6
* , 1
!"
!
!
3&
'!&"
&
4
#*!(
!
!
&
4
%&&
#&
&&
255***'
'5
4
N
NOTE 1
E1
1 2 3
A A2
L c
A1 b1
b e eB
6&! 7,8.
'
!9'&! 7 7: ;
7"')
%! 7 >
&
1,
&
&
< <
#
#4
4
!! -
1!
&
&
< <
"#
&"#
=#& . - --
#
#4
=#& . >
:
9
& - -?
&
&
9 -
9
#4
!! >
6
* , 1
D
N
E1
NOTE 1
1 2
e
b
c
A A2
A1
L1 L
6&! 99..
'
!9'&! 7 7: ;
7"')
%! 7
&
?1,
:
8
& < <
#
#4
4
!! ? >
&#%% < <
:
=#& . > >
#
#4
=#& . - ?
:
9
& ?
3&9
& 9
3&
& 9 .3
9
#4
!! <
3&
I @ @ >@
9
#=#& ) < ->
!"#
$%
&"
' ()"&'"!&)
&
#*&&
&
#
'
!!#.#&"#
'#%!
&"!!#%!
&"!!!&
$
#''
!#
- '
!#&
.0
1,2 1!'
!
&
$& "
!**&"&&
!
.32
%
'
!("!"*&"&&
(%%'&
"
!
!
* , 1
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
!#$" ! %
!! &' !!%
3&
'!&"
&
4
#*!(
!
!
&
4
%&&
#&
&&
255***'
'5
4
D
N
E
E1
1 2
b
NOTE 1
e
c
A A2
A1
L1 L
6&! 99..
'
!9'&! 7 7: ;
7"')
%! 7 >
&
?1,
:
8
& < <
#
#4
4
!! ? >
&#%% < <
:
=#& . > >
#
#4
=#& . - ?
:
9
&
3&9
& 9
3&
& 9 .3
9
#4
!! <
3&
I @ @ >@
9
#=#& ) < ->
!"#
$%
&"
' ()"&'"!&)
&
#*&&
&
#
'
!!#.#&"#
'#%!
&"!!#%!
&"!!!&
$
#''
!#
- '
!#&
.0
1,2 1!'
!
&
$& "
!**&"&&
!
.32
%
'
!("!"*&"&&
(%%'&
"
!
!
* , -1
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
! %
!% () *'& !%+
3&
'!&"
&
4
#*!(
!
!
&
4
%&&
#&
&&
255***'
'5
4
D
N
E
E1
NOTE 1
1 2 3
e
b
h
h
c
A A2
L
A1 L1
6&! 99..
'
!9'&! 7 7: ;
7"')
%! 7
&
1,
:
8
& < < ?
#
#4
4
!! < <
&#%%+ < -
:
=#& . -1,
#
#4
=#& . 1,
:
9
& >1,
,'%
A
&B <
3&9
& 9 <
3&
& 9 .3
3&
I @ < >@
9
#4
!! < --
9
#=#& ) - <
#%&
D @ < @
#%&
1&&' E @ < @
!"#
$%
&"
' ()"&'"!&)
&
#*&&
&
#
+%&,&
!&
- '
!!#.#&"#
'#%!
&"!!#%!
&"!!!&
$
#''
!#
'
!#&
.0
1,2 1!'
!
&
$& "
!**&"&&
!
.32
%
'
!("!"*&"&&
(%%'&
"
!
!
* , 1
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
D
N
E
E1
NOTE 1
1 2 3
e
b
h
h
c
A A2
L
A1 L1
6&! 99..
'
!9'&! 7 7: ;
7"')
%! 7 >
&
1,
:
8
& < < ?
#
#4
4
!! < <
&#%%+ < -
:
=#& . -1,
#
#4
=#& . 1,
:
9
& 1,
,'%
A
&B <
3&9
& 9 <
3&
& 9 .3
3&
I @ < >@
9
#4
!! > < --
9
#=#& ) - <
#%&
D @ < @
#%&
1&&' E @ < @
!"#
$%
&"
' ()"&'"!&)
&
#*&&
&
#
+%&,&
!&
- '
!!#.#&"#
'#%!
&"!!#%!
&"!!!&
$
#''
!#
'
!#&
.0
1,2 1!'
!
&
$& "
!**&"&&
!
.32
%
'
!("!"*&"&&
(%%'&
"
!
!
* , 1
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
D D2
EXPOSED
PAD
E
b
E2
2 2
1 1 K
N N
NOTE 1 L
TOP VIEW BOTTOM VIEW
A3 A1
6&! 99..
'
!9'&! 7 7: ;
7"')
%! 7 >
&
?1,
:
8
& >
&#%%
,&&4
!! - .3
:
=#& . ?1,
.$
!
##=#& . -? -
:
9
& ?1,
.$
!
##9
& -? -
,&&=#& ) - - -
,&&9
& 9
,&& & .$
!
## C < <
!"#
$%
&"
' ()"&'"!&)
&
#*&&
&
#
4
!!*!"&
#
- '
!#&
.0
1,2 1!'
!
&
$& "
!**&"&&
!
.32
%
'
!("!"*&"&&
(%%'&
"
!
!
* , 1
, -
)
". / 010 ,-
2
# '&& +
.
#
3&
'!&"
&
4
#*!(
!
!
&
4
%&&
#&
&&
255***'
'5
4
33
, -
)
". / 1 ,-
3&
'!&"
&
4
#*!(
!
!
&
4
%&&
#&
&&
255***'
'5
4
D D2
EXPOSED
PAD
E2
b
2 2
1 1
N N K
NOTE 1 L
A3 A1
6&! 99..
'
!9'&! 7 7: ;
7"')
%! 7
&
?1,
:
8
& >
&#%%
,&&4
!! - .3
:
=#& . >1,
.$
!
##=#& . ?- ? ?>
:
9
& >1,
.$
!
##9
& ?- ? ?>
,&&=#& ) - ->
,&&9
& 9 -
,&& & .$
!
## C < <
!"#
$%
&"
' ()"&'"!&)
&
#*&&
&
#
4
!!*!"&
#
- '
!#&
.0
1,2 1!'
!
&
$& "
!**&"&&
!
.32
%
'
!("!"*&"&&
(%%'&
"
!
!
* , -1
33
, -
)
". / 1 ,-
3&
'!&"
&
4
#*!(
!
!
&
4
%&&
#&
&&
255***'
'5
4
33
4# , -
5"
4 61616 ) ' 4,-
3&
'!&"
&
4
#*!(
!
!
&
4
%&&
#&
&&
255***'
'5
4
D
D1
E
e
E1
N
b
NOTE 1 1 2 3
NOTE 2
A
c
A1 A2
L L1
6&! 99..
'
!9'&! 7 7: ;
7"')
%9
#! 7
9
#&
>1,
:
8
& < <
#
#4
4
!!
&#%% <
3&9
& 9 ?
3&
& 9 .3
3&
I @ -@ @
:
=#& . 1,
:
9
& 1,
#
#4
=#& . 1,
#
#4
9
& 1,
9
#4
!! <
9
#=#& ) - -
#%&
D @ @ -@
#%&
1&&' E @ @ -@
!"#
$%
&"
' ()"&'"!&)
&
#*&&
&
#
,'%
!&
!
&D!E
'
- '
!!#.#&"#
'#%!
&"!!#%!
&"!!!&
$
#''
!#
'
!#&
.0
1,2 1!'
!
&
$& "
!**&"&&
!
.32
%
'
!("!"*&"&&
(%%'&
"
!
!
* , ?1
33
4# , -
5"
4 61616 ) ' 4,-
3&
'!&"
&
4
#*!(
!
!
&
4
%&&
#&
&&
255***'
'5
4
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
D I
Data EEPROM Memory ..................................................... 67 I/O Ports
Erasing ....................................................................... 70 Analog Port Configuration ........................................ 140
Operations ................................................................. 69 Analog Selection Registers ...................................... 140
Programming Input Change Notification ........................................ 142
Bulk Erase .......................................................... 71 Open-Drain Configuration ........................................ 140
Reading Data EEPROM .................................... 72 Parallel (PIO) ........................................................... 139
Single-Word Write .............................................. 71 I2C
Programming Control Registers Clock Rates ............................................................. 175
NVMADR(U) ...................................................... 69 Communicating as Master in Single Master
NVMCON ........................................................... 67 Environment .................................................... 173
NVMKEY ............................................................ 67 Pin Remapping Options ........................................... 173
Data Memory Reserved Addresses ............................................... 175
Address Space ........................................................... 39 Slave Address Masking ........................................... 175
Memory Map .............................................................. 39 In-Circuit Debugger .......................................................... 250
Near Data Space ....................................................... 40 In-Circuit Serial Programming (ICSP) .............................. 250
Organization ............................................................... 40 Input Capture
SFR Space ................................................................. 40 32-Bit Mode ............................................................. 152
Software Stack ........................................................... 53 Operations ............................................................... 152
Space Width ............................................................... 39 Synchronous and Trigger Modes ............................. 151
DC Characteristics Input Capture with Dedicated Timers .............................. 151
Comparator .............................................................. 278 Instruction Set
Comparator Voltage Reference ............................... 278 Opcode Symbols ..................................................... 256
CTMU Current Source ............................................. 279 Overview .................................................................. 257
Data EEPROM Memory ........................................... 278 Summary ................................................................. 255
High/Low-Voltage Detect ......................................... 266 Internet Address .............................................................. 317
I/O Pin Input Specifications ...................................... 276 Interrupts
I/O Pin Output Specifications ................................... 277 Alternate Interrupt Vector Table (AIVT) ..................... 79
Idle Current (IIDLE) ................................................... 269 Control and Status Registers ..................................... 82
Internal Voltage Regulator Specifications ................ 279 Implemented Vectors ................................................. 81
Operating Current (IDD) ............................................ 267 Interrupt Vector Table (IVT) ....................................... 79
Power-Down Current (IPD) ....................................... 271 Reset Sequence ........................................................ 79
Program Memory ..................................................... 277 Setup Procedures .................................................... 115
Temperature and Voltage Specifications ................. 265 Trap Vectors .............................................................. 81
Development Support ...................................................... 251 Vector Table .............................................................. 80
Device Features (Summary) ........................................ 15, 16
M
E Microchip Internet Web Site ............................................. 317
Electrical Characteristics MPLAB ASM30 Assembler, Linker, Librarian .................. 252
Absolute Maximum Ratings ..................................... 263 MPLAB Integrated Development Environment
Thermal Operating Conditions ................................. 265 Software .................................................................. 251
Thermal Packaging Characteristics ......................... 265 MPLAB PM3 Device Programmer ................................... 254
V/F Graphs ............................................................... 264 MPLAB REAL ICE In-Circuit Emulator System ............... 253
Equations MPLINK Object Linker/MPLIB Object Librarian ............... 252
Baud Rate Reload Calculation ................................. 175
N
Calculating the PWM Period .................................... 159
Calculation for Maximum PWM Resolution .............. 159 Near Data Space ............................................................... 40
Device and SPI Clock Speed Relationship .............. 172
PWM Period and Duty Cycle Calculations ............... 159
UART Baud Rate with BRGH = 0 ............................ 182
UART Baud Rate with BRGH = 1 ............................ 182
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________ FAX: (______) _________ - _________
Application (optional):
Would you like a reply? Y N
Questions:
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this document easy to follow? If not, why?
4. What additions to the document do you think would enhance the structure and subject?
5. What deletions from the document could be made without affecting the overall usefulness?
Package SP = SPDIP
SO = SOIC
SS = SSOP
ML = QFN
P = PDIP
PT = TQFP
02/18/11