2.0Guidelines for Getting Started with 32-bit Microcontrollers ........................................................................................................ 27
5.0Flash Program Memory.............................................................................................................................................................. 79
10.0 USB On-The-Go (OTG)............................................................................................................................................................ 121
24.0 Charge Time Measurement Unit (CTMU) ............................................................................................................................... 217
25.0 Power-Saving Features ........................................................................................................................................................... 221
26.0 Special Features ...................................................................................................................................................................... 225
27.0 Instruction Set .......................................................................................................................................................................... 239
28.0 Development Support............................................................................................................................................................... 241
30.0 DC and AC Device Characteristics Graphs.............................................................................................................................. 285
The Microchip Web Site ..................................................................................................................................................................... 315
Customer Change Notification Service .............................................................................................................................................. 315
Product Identification System ............................................................................................................................................................ 317
It is our intention to provide our valued customers with the best documentation possible to ensure successful use of your Microchip
products. To this end, we will continue to improve our publications to better suit your needs. Our publications will be refined and
enhanced as new volumes and updates are introduced.
If you have any questions or comments regarding this publication, please contact the Marketing Communications Department
via E-mail at docerrors@microchip.com or fax the Reader Response Form in the back of this data sheet to (480) 792-4150.
We welcome your feedback.
Most Current Data Sheet
To obtain the most up-to-date version of this data sheet, please register at our Worldwide Web site at:
http://www.microchip.com
You can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page.
The last character of the literature number is the version number, (e.g., DS30000A is version A of document DS30000).
Errata
An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current
devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision
of silicon and revision of document to which it applies.
To determine if an errata sheet exists for a particular device, please check with one of the following:
• Microchip’s Worldwide Web site; http://www.microchip.com
• Your local Microchip sales office (see last page)
When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are
using.
Customer Notification System
Register on our web site at www.microchip.com to receive the most current information on all of our products.
This device data sheet is based on the following
individual chapters of the “PIC32 Family ReferenceManual”. These documents should be considered as
the general reference for the operation of a particular
module or device feature.
Note:To access the documents listed below,
browse to the documentation section of
the Microchip web site
(www.microchip.com).
• Section 1. “Introduction” (DS61127)
• Section 2. “CPU” (D S61113)
• Section 3. “Memory Organization” (DS61115)
• Section 5. “Flash Program Memory” (DS61121)
• Section 6. “Oscillator Configuration” (DS61112)
• Section 7. “Resets” (D S61118)
• Section 8. “Interrupt Controller” (DS61108)
• Section 9. “Watchdog Timer and Power-up Timer” (DS61114)
• Section 10. “Power-Saving Features” (DS61130)
• Section 12. “I/O Ports” (DS61120)
• Section 13. “Parallel Master Port (PMP)” (DS61128)
Note 1: Some features are not available on all device variants. Refer to the family features tables (Tab le 1 and Table 2) for availability.
UART1-2
Comparators 1-3
PORTA
Remappable
PORTB
CTMU
JTAG
Priority
DMAC
ICD
MIPS32® M4K
®
ISDS
EJTAGINT
Bus Matrix
Data RAM
Peripheral Bridge
128
128-bit Wide
Flash
32
32
32
32
Peripheral Bus Clocked by PBCLK
Program Flash Memory
Controller
32
32
32
Interrupt
Controller
BSCAN
PORTC
PMP
I2C1-2
SPI1-2
IC1-5
PWM
OC1-5
OSC1/CLKI
OSC2/CLKO
V
DD, VSS
Timing
Generation
MCLR
Power-up
Timer
Oscillator
Start-up Timer
Power-on
Reset
Watchdog
Timer
Brown-out
Reset
Precision
Reference
Band Gap
FRC/LPRC
Oscillators
Regulator
Voltage
VCAP
OSC/SOSC
Oscillators
PLL
Dividers
SYSCLK
PBCLK
Peripheral Bus Clocked by SYSCLK
USB
PLL-USB
USBCLK
32
RTCC
10-bit ADC
Timer1-5
32
32
CPU Core
Pins
1.0DEVICE OVERVIEW
Note 1: This data sheet summarizes the features
of the PIC32MX1XX/2XX family of
devices. It is not intended to be a
comprehensive reference source. To
complement the information in this data
sheet, refer to the related section of the
“PIC32 Family Reference Manual”, which
is available from the Microchip web site
(www.microchip.com/PIC32).
2: Some registers and associated bits
described in this section may not be
available on all devices. Refer to
Section 4.0 “Memory Organization” in
this data sheet for device-specific register
and bit information.
FIGURE 1-1:BLOCK DIAGRAM
(1)
This document contains device-specific information for
PIC32MX1XX/2XX devices.
Figure 1-1 illustrates a general block diagram of the
core and peripheral modules in the PIC32MX1XX/2XX
family of devices.
Table 1-1 lists the functions of the various pins shown
SDA11518191I/OSTSynchronous serial data input/output for
SCL247224I/OSTSynchronous serial clock input/output for
SDA236123I/OSTSynchronous serial data input/output for
TMS
19
11
(2)
(3)
22
14
(2)
(3)
TCK14171813ISTJTAG test clock input pin
TDI13161735O—JTAG test data input pin
TDO15181932O—JTAG test data output pin
RTCC47224ISTReal-Time Clock alarm output
VREF-2833420IAnalog
C
CVREF+2723319IAnalog Comparator Voltage Reference (high)
CVREFOUT22252814OAnalogComparator Voltage Reference output
C1INA47224
2.0GUIDELINES FOR GETTING
STARTED WITH 32-BIT
MICROCONTROLLERS
Note 1: This data sheet summarizes the features
of the PIC32MX1XX/2XX family of
devices. It is not intended to be a
comprehensive reference source. To
complement the information in this data
sheet, refer to the related section of the
“PIC32 Family Reference Manual”, which
is available from the Microchip web site
(www.microchip.com/PIC32).
2: Some registers and associated bits
described in this section may not be
available on all devices. Refer to
Section 4.0 “Memory Organization” in
this data sheet for device-specific register
and bit information.
2.1Basic Connection Requirements
Getting started with the PIC32MX1XX/2XX family of
32-bit Microcontrollers (MCUs) requires attention to a
minimal set of device pin connections before proceeding with development. The following is a list of pin
names, which must always be connected:
DD and VSS pins
• All V
(see Section 2.2 “Decoupling Capacitors”)
• All AV
•V
•MCLR
• PGECx/PGEDx pins, used for In-Circuit Serial
• OSC1 and OSC2 pins, when external oscillator
The following pin may be required, as well:
2.2Decoupling Capacitors
The use of decoupling capacitors on power supply
pins, such as V
See Figure 2-1.
connected, regardless of ADC use and
the ADC voltage reference source.
DD and AVSS pins must be
DD, VSS, AVDD and AVSS is required.
Consider the following criteria when using decoupling
capacitors:
• Value and type of capacitor: A value of 0.1 µF
(100 nF), 10-20V is recommended. The capacitor
should be a low Equivalent Series Resistance (lowESR) capacitor and have resonance frequency in
the range of 20 MHz and higher. It is further
recommended that ceramic capacitors be used.
• Placement on the printed circuit board: The
decoupling capacitors should be placed as close to
the pins as possible. It is recommended that the
capacitors be placed on the same side of the board
as the device. If space is constricted, the capacitor
can be placed on another layer on the PCB using a
via; however, ensure that the trace length from the
pin to the capacitor is within one-quarter inch
(6 mm) in length.
• Handling high frequency noise: If the board is
experiencing high frequency noise, upward of tens
of MHz, add a second ceramic-type capacitor in parallel to the above described decoupling capacitor.
The value of the second capacitor can be in the
range of 0.01 µF to 0.001 µF. Place this second
capacitor next to the primary decoupling capacitor.
In high-speed circuit designs, consider implementing a decade pair of capacitances as close to the
power and ground pins as possible. For example,
0.1 µF in parallel with 0.001 µF.
• Maximizing performance: On the board layout
from the power supply circuit, run the power and
return traces to the decoupling capacitors first, and
then to the device pins. This ensures that the decoupling capacitors are first in the power chain. Equally
important is to keep the trace length between the
capacitor and the power pins to a minimum thereby
reducing PCB track inductance.
FIGURE 2-1:RECOMMENDED
MINIMUM CONNECTION
PIC32MX1XX/2XX
Note 1: R ≤ 10 kΩ is recommended. A suggested start-
ing value is 10 kΩ. Ensure that the MCLR
pin
V
IH and VIL specifications are met.
2: R1 ≤ 470Ω will limit any current flowing into
MCLR from the external capacitor C, in the
event of MCLR
pin breakdown, due to
Electrostatic Discharge (ESD) or Electrical
Overstress (EOS). Ensure that the MCLR
pin
V
IH and VIL specifications are met.
3: The capacitor can be sized to prevent uninten-
tional Resets from brief glitches or to extend
the device Reset period during POR.
C
(3)
R1
(2)
R
(1)
VDD
MCLR
PIC32
JP
2.2.1BULK CAPACITORS
The use of a bulk capacitor is recommended to improve
power supply stability. Typical values range from 4.7 µF
to 47 µF. This capacitor should be located as close to
the device as possible.
2.3Capacitor on Internal Voltage
Regulator (V
2.3.1INTERNAL REGULATOR MODE
A low-ESR (1 ohm) capacitor is required on the VCAP
pin, which is used to stabilize the internal voltage regulator output. The V
VDD, and must have a CEFC capacitor, with at least a
6V rating, connected to ground. The type can be
ceramic or tantalum. Refer to Section 29.0 “Electrical
Characteristics” for additional information on C
specifications.
CAP)
CAP pin must not be connected to
EFC
2.4Master Clear (MCLR) Pin
The MCLR pin provides for two specific device
functions:
• Device Reset
• Device programming and debugging
Pulling The MCLR
Figure 2-2 illustrates a typical MCLR
device programming and debugging, the resistance
and capacitance that can be added to the pin must
be considered. Device programmers and debuggers
drive the MCLR
levels (V
IH and VIL) and fast signal transitions must
not be adversely affected. Therefore, specific values
of R and C will need to be adjusted based on the
application and PCB requirements.
For example, as illustrated in Figure 2-2, it is
recommended that the capacitor C, be isolated from
the MCLR
pin during programming and debugging
operations.
Place the components illustrated in Figure 2-2 within
one-quarter inch (6 mm) from the MCLR
The PGECx and PGEDx pins are used for In-Circuit
Serial Programming™ (ICSP™) and debugging purposes. It is recommended to keep the trace length
between the ICSP connector and the ICSP pins on the
device as short as possible. If the ICSP connector is
expected to experience an ESD event, a series resistor
is recommended, with the value in the range of a few
tens of Ohms, not to exceed 100 Ohms.
Pull-up resistors, series diodes and capacitors on the
PGECx and PGEDx pins are not recommended as they
will interfere with the programmer/debugger communications to the device. If such discrete components are
an application requirement, they should be removed
from the circuit during programming and debugging.
Alternatively, refer to the AC/DC characteristics and
timing requirements information in the respective
device Flash programming specification for information
on capacitive loading limits and pin input voltage high
IH) and input low (VIL) requirements.
(V
Ensure that the “Communication Channel Select” (i.e.,
PGECx/PGEDx pins) programmed into the device
matches the physical connections for the ICSP to
MPLAB
For more information on ICD 3 and REAL ICE
connection requirements, refer to the following
documents that are available on the Microchip web
site.
• “Using MPLAB
• “MPLAB
• “MPLAB
• “Using MPLAB
®
ICD 3 or MPLAB REAL ICE™.
®
®
®
User’s Guide” DS51616
DS51749
ICD 3” (poster) DS51765
ICD 3 Design Advisory” DS51764
REAL ICE™ In-Circuit Debugger
®
REAL ICE™ Emulator” (poster)
2.6JTAG
The TMS, TDO, TDI and TCK pins are used for testing
and debugging according to the Joint Test Action
Group (JTAG) standard. It is recommended to keep the
trace length between the JTAG connector and the
JTAG pins on the device as short as possible. If the
JTAG connector is expected to experience an ESD
event, a series resistor is recommended, with the value
in the range of a few tens of Ohms, not to exceed 100
Ohms.
Pull-up resistors, series diodes and capacitors on the
TMS, TDO, TDI and TCK pins are not recommended
as they will interfere with the programmer/debugger
communications to the device. If such discrete components are an application requirement, they should be
removed from the circuit during programming and
debugging. Alternatively, refer to the AC/DC characteristics and timing requirements information in the
respective device Flash programming specification for
information on capacitive loading limits and pin input
voltage high (V
Many MCUs have options for at least two oscillators: a
high-frequency primary oscillator and a low-frequency
secondary oscillator (refer to Section 8.0 “Oscillator
Configuration” for details).
The oscillator circuit should be placed on the same side
of the board as the device. Also, place the oscillator circuit close to the respective oscillator pins, not exceeding one-half inch (12 mm) distance between them. The
load capacitors should be placed next to the oscillator
itself, on the same side of the board. Use a grounded
copper pour around the oscillator circuit to isolate them
from surrounding circuits. The grounded copper pour
should be routed directly to the MCU ground. Do not
run any signal traces or power traces inside the ground
pour. Also, if using a two-sided board, avoid any traces
on the other side of the board where the crystal is
placed. A suggested layout is illustrated in Figure 2-3.
FIGURE 2-3:SUGGESTED OSCILLATOR
CIRCUIT PLACEMENT
2.8Configuration of Analog and
Digital Pins During ICSP
Operations
If MPLAB ICD 2, ICD 3 or REAL ICE is selected as a
debugger, it automatically initializes all of the analog-todigital input pins (ANx) as “digital” pins by setting all bits
in the ADPCFG register.
The bits in this register that correspond to the analogto-digital pins that are initialized by MPLAB ICD 2, ICD
3 or REAL ICE, must not be cleared by the user
application firmware; otherwise, communication errors
will result between the debugger and the device.
If your application needs to use certain analog-to-digital
pins as analog input pins during the debug session, the
user application must clear the corresponding bits in
the ADPCFG register during initialization of the ADC
module.
When MPLAB ICD 2, ICD 3 or REAL ICE is used as a
programmer, the user application firmware must correctly configure the ADPCFG register. Automatic initialization of this register is only done during debugger
operation. Failure to correctly configure the register(s)
will result in all analog-to-digital pins being recognized
as analog input pins, resulting in the port value being
read as a logic ‘0’, which may affect user application
functionality.
2.9Unused I/Os
Unused I/O pins should not be allowed to float as
inputs. They can be configured as outputs and driven
to a logic-low state.
Alternatively, inputs can be reserved by connecting the
of the PIC32MX1XX/2XX family of
devices. It is not intended to be a
comprehensive reference source. To
complement the information in this data
sheet, refer to Section 2. “CPU”
(DS61113) in the “PIC32 FamilyReference Manual”, which is available
from the Microchip web site
(www.microchip.com/PIC32). Resources
for the MIPS32
are available at http://www.mips.com.
2: Some registers and associated bits
described in this section may not be
available on all devices. Refer to
Section 4.0 “Memory Organization” in
this data sheet for device-specific register
and bit information.
The the MIPS32® M4K® Processor Core is the heart of
the PIC32MX1XX/2XX family processor. The CPU
fetches instructions, decodes each instruction, fetches
source operands, executes each instruction and writes
the results of instruction execution to the proper
destinations.
3.1Features
• 5-stage pipeline
• 32-bit address and data paths
• MIPS32
- Multiply-accumulate and multiply-subtract
- Targeted multiply instruction
- Zero/One detect instructions
- WAIT instruction
- Conditional move instructions (MOVN, MOVZ)
- Vectored interrupts
®
Enhanced Architecture (Release 2)
instructions
®
M4K® Processor Core
- Programmable exception vector base
- Atomic interrupt enable/disable
- GPR shadow registers to minimize latency
for interrupt handlers
The MIPS32® M4K® processor core contains several
logic blocks working together in parallel, providing an
efficient high-performance computing engine. The
following blocks are included with the core:
• Execution Unit
• Multiply/Divide Unit (MDU)
• System Control Coprocessor (CP0)
• Fixed Mapping Translation (FMT)
• Dual Internal Bus interfaces
• Power Management
• MIPS16e Support
• Enhanced JTAG (EJTAG) Controller
3.2.1EXECUTION UNIT
The MIPS32® M4K® processor core execution unit
implements a load/store architecture with single-cycle
ALU operations (logical, shift, add, subtract) and an
autonomous multiply/divide unit. The core contains
thirty-two 32-bit General Purpose Registers (GPRs)
used for integer operations and address calculation.
One additional register file shadow set (containing
thirty-two registers) is added to minimize context
switching overhead during interrupt/exception processing. The register file consists of two read ports and one
write port and is fully bypassed to minimize operation
latency in the pipeline.
The execution unit includes:
• 32-bit adder used for calculating the data address
• Address unit for calculating the next instruction
address
• Logic for branch determination and branch target
address calculation
• Load aligner
• Bypass multiplexers used to avoid stalls when
executing instruction streams where data
producing instructions are followed closely by
consumers of their results
• Leading Zero/One detect unit for implementing
the CLZ and CLO instructions
• Arithmetic Logic Unit (ALU) for performing bitwise
logical operations
• Shifter and store aligner
3.2.2MULTIPLY/DIVIDE UNIT (MDU)
The MIPS32® M4K® processor core includes a Multiply/Divide Unit (MDU) that contains a separate pipeline
for multiply and divide operations. This pipeline operates in parallel with the Integer Unit (IU) pipeline and
does not stall when the IU pipeline stalls. This allows
MDU operations to be partially masked by system stalls
and/or other integer unit instructions.
The high-performance MDU consists of a 32x16 booth
recoded multiplier, result/accumulation registers (HI
and LO), a divide state machine, and the necessary
multiplexers and control logic. The first number shown
(‘32’ of 32x16) represents the rs operand. The second
number (‘16’ of 32x16) represents the rt operand. The
PIC32 core only checks the value of the latter (rt) operand to determine how many times the operation must
pass through the multiplier. The 16x16 and 32x16
operations pass through the multiplier once. A 32x32
operation passes through the multiplier twice.
The MDU supports execution of one 16x16 or 32x16
multiply operation every clock cycle; 32x32 multiply
operations can be issued every other clock cycle.
Appropriate interlocks are implemented to stall the
issuance of back-to-back 32x32 multiply operations.
The multiply operand size is automatically determined
by logic built into the MDU.
Divide operations are implemented with a simple 1 bit
per clock iterative algorithm. An early-in detection
checks the sign extension of the dividend (rs) operand.
If rs is 8 bits wide, 23 iterations are skipped. For a 16-bit
wide rs, 15 iterations are skipped and for a 24-bit wide
rs, 7 iterations are skipped. Any attempt to issue a subsequent MDU instruction while a divide is still active
causes an IU pipeline stall until the divide operation is
completed.
Table 3-1 lists the repeat rate (peak issue rate of cycles
until the operation can be reissued) and latency (number of cycles until a result is available) for the PIC32
core multiply and divide instructions. The approximate
latency and repeat rates are listed in terms of pipeline
clocks.
The MIPS architecture defines that the result of a
multiply or divide operation be placed in the HI and LO
registers. Using the Move-From-HI (MFHI) and MoveFrom-LO (MFLO) instructions, these values can be
transferred to the General Purpose Register file.
In addition to the HI/LO targeted operations, the
MIPS32
®
architecture also defines a multiply instruction, MUL, which places the least significant results in
the primary register file instead of the HI/LO register
pair. By avoiding the explicit MFLO instruction required
3.2.3SYSTEM CONTROL
COPROCESSOR (CP0)
In the MIPS architecture, CP0 is responsible for the
virtual-to-physical address translation, the exception
control system, the processor’s diagnostics capability,
the operating modes (Kernel, User and Debug) and
whether interrupts are enabled or disabled. Configuration information, such as presence of options like
MIPS16e, is also available by accessing the CP0
registers, listed in Ta bl e 3 -2 .
when using the LO register, and by supporting multiple
destination registers, the throughput of multiply-intensive operations is increased.
Two other instructions, Multiply-Add (MADD) and
Multiply-Subtract (MSUB), are used to perform the
multiply-accumulate and multiply-subtract operations.
The MADD instruction multiplies two numbers and then
adds the product to the current contents of the HI and
LO registers. Similarly, the MSUB instruction multiplies
two operands and then subtracts the product from the
HI and LO registers. The MADD and MSUB operations
are commonly used in DSP algorithms.
TABLE 3-2:COPROCESSOR 0 REGISTERS
Register
Number
0-6ReservedReserved in the PIC32MX1XX/2XX family core.
7HWREnaEnables access via the RDHWR instruction to selected hardware registers.
8BadVAddr
9Count
10ReservedReserved in the PIC32MX1XX/2XX family core.
11C ompa re
12Status
12IntCtl
12SRSCtl
12SRSMap
13Cause
14EPC
15PRIdProcessor identification and revision.
15EBASEException vector base register.
16ConfigConfiguration register.
16Config1Configuration Register 1.
16Config2Configuration Register 2.
16Config3Configuration Register 3.
17-22ReservedReserved in the PIC32MX1XX/2XX family core.
23Debug
24DEPC
25-29ReservedReserved in the PIC32MX1XX/2XX family core.
30ErrorEPC
31DESAVE
Note 1: Registers used in exception processing.
2: Registers used during debug.
Register
Name
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(2)
(2)
(1)
(2)
Function
Reports the address for the most recent address-related exception.
Processor cycle count.
Timer interrupt control.
Processor status and control.
Interrupt system status and control.
Shadow register set status and control.
Provides mapping from vectored interrupt to a shadow set.
Coprocessor 0 also contains the logic for identifying
and managing exceptions. Exceptions can be caused
by a variety of sources, including alignment errors in
data, external events or program errors. Table 3-3 lists
the exception types in order of priority.
DBpEJTAG breakpoint (execution of SDBBP instruction).
SysExecution of SYSCALL instruction.
BpExecution of BREAK instruction.
RIExecution of a reserved instruction.
CpUExecution of a coprocessor instruction for a coprocessor that is not enabled.
CEUExecution of a CorExtend instruction when CorExtend is not enabled.
OvExecution of an arithmetic instruction that overflowed.
TrExecution of a trap (when trap condition is true).
DDBL/DDBSEJTAG Data Address Break (address only) or EJTAG data value break on store (address + value).
AdELLoad address alignment error.
Load reference to protected address.
AdESStore address alignment error.
Store to protected address.
DBELoad or store bus error.
DDBLEJTAG data hardware breakpoint matched in load data compare.
or a Power-on Reset (POR).
3.3Power Management
The MIPS® M4K® processor core offers a number of
power management features, including low-power
design, active power management and power-down
modes of operation. The core is a static design that
supports slowing or Halting the clocks, which reduces
system power consumption during Idle periods.
3.3.1INSTRUCTION-CONTROLLED
POWER MANAGEMENT
The mechanism for invoking Power-Down mode is
through execution of the WAIT instruction. For more
information on power management, see Section 25.0
The MIPS® M4K® processor core provides for an
Enhanced JTAG (EJTAG) interface for use in the software debug of application and kernel code. In addition
to standard User mode and Kernel modes of operation,
the M4K
after a debug exception (derived from a hardware
breakpoint, single-step exception, etc.) is taken and
continues until a Debug Exception Return (DERET)
instruction is executed. During this time, the processor
executes the debug exception handler routine.
The EJTAG interface operates through the Test Access
Port (TAP), a serial communication port used for transferring test data in and out of the core. In addition to the
standard JTAG instructions, special instructions
defined in the EJTAG specification define which
registers are selected and how they are used.
®
core provides a Debug mode that is entered
PIC32MX1XX/2XX
4.0MEMORY ORGANIZATION
Note:This data sheet summarizes the features
of the PIC32MX1XX/2XX family of
devices. It is not intended to be a
comprehensive reference source.For
detailed information, refer to Section 3.“Memory Organization” (DS61115) in
the “PIC32 Family Reference Manual”,
which is available from the Microchip
web site (www.microchip.com/PIC32).
PIC32MX1XX/2XX microcontrollers provide 4 GB of
unified virtual memory address space. All memory
regions, including program, data memory, SFRs and
Configuration registers, reside in this address space at
their respective unique addresses. The program and
data memories can be optionally partitioned into user
and kernel memories. In addition, the data memory can
be made executable, allowing PIC32MX1XX/2XX
devices to execute from data memory.
Key features include:
• 32-bit native data width
• Separate User (KUSEG) and Kernel
(KSEG0/KSEG1) mode address space
• Flexible program Flash memory partitioning
• Flexible data RAM partitioning for data and
program space
• Separate boot Flash memory for protected code
• Robust bus exception handling to intercept
runaway code
• Simple memory mapping with Fixed Mapping
Translation (FMT) unit
• Cacheable (KSEG0) and non-cacheable (KSEG1)
address regions
4.1PIC32MX1XX/2XX Memory Layout
PIC32MX1XX/2XX microcontrollers implement two
address schemes: virtual and physical. All hardware
resources, such as program memory, data memory
and peripherals, are located at their respective physical
addresses. Virtual addresses are exclusively used by
the CPU to fetch and execute instructions as well as
access peripherals. Physical addresses are used by
bus master peripherals, such as DMA and the Flash
controller, that access memory independently of the
CPU.
The memory maps for the PIC32MX1XX/2XX devices
are illustrated in Figure 4-1 and Figure 4-2.
2: The size of this memory region is programmable (see Section 3. “Memory Organization”
(DS61115) in the “PIC32 Family Reference Manual”) and can be changed by initialization
code provided by end user development tools (refer to the specific development tool
documentation for information).
KSEG1KSEG0
FIGURE 4-1:MEMORY MAP ON RESET FOR PIC32MX11X/21X DEVICES
2: The size of this memory region is programmable (see Section 3. “Memory Organization”
(DS61115) in the “PIC32 Family Reference Manual”) and can be changed by initialization
code provided by end user development tools (refer to the specific development tool
documentation for information).
KSEG1KSEG0
FIGURE 4-2:MEMORY MAP ON RESET FOR PIC32MX12X/22X DEVICES
2: The size of this memory region is programmable (see Section 3. “Memory Organization”
(DS61115) in the “PIC32 Family Reference Manual”) and can be changed by initialization
code provided by end user development tools (refer to the specific development tool
documentation for information).
KSEG1KSEG0
FIGURE 4-3:MEMORY MAP ON RESET FOR PIC32MX13X/23X DEVICES
2: The size of this memory region is programmable (see Section 3. “Memory Organization”
(DS61115) in the “PIC32 Family Reference Manual”) and can be changed by initialization
code provided by end user development tools (refer to the specific development tool
documentation for information).
KSEG1KSEG0
FIGURE 4-4:MEMORY MAP ON RESET FOR PIC32MX15X/25X DEVICES
Table 4-1 through Tab le 4 -2 7 contain the peripheral address maps for the PIC32MX1XX/2XX devices.
TABLE 4-1:BUS MATRIX REGISTER MAP
Bits
PIC32MX1XX/2XX
Name
Register
(BF88_#)
Virtual Address
2000 BMXCON
2010 BMXDKPBA
2020 BMXDUDBA
2030 BMXDUPBA
2040 BMXDRMSZ
2050 BMXPUPBA
2060 BMXPFMSZ
2070 BMXBOOTSZ
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:This register has corresponding CLR, SET and INV registers at its virtual address, plus an offset of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for more information.
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:With the exception of those noted, all registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4 0x8 and 0xC, respectively. See Section 11.2 “CLR,
(3)
SET and INV Registers” for more information.
2:These bits are not available on PIC32MX1XX devices.
3:This register does not have associated CLR, SET, INV registers.
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:With the exception of those noted, all registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4 0x8 and 0xC, respectively. See Section 11.2 “CLR,
SET and INV Registers” for more information.
2:These bits are not available on PIC32MX1XX devices.
3:This register does not have associated CLR, SET, INV registers.
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:This register has corresponding CLR, SET and INV registers at its virtual address, plus an offset of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for more information.
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table except I2CxRCV have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:This register has corresponding CLR, SET and INV registers at its virtual address, plus an offset of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for more information.
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table except SPIxBUF have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at its virtual address, plus an offset of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for more
information.
TABLE 4-11:DMA CRC REGISTER MAP
Name
Register
(BF88_#)
Virtual Address
3030 DCRCCON
3040 DCRCDATA
3050 DCRCXOR
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for
TABLE 4-14:COMPARATOR VOLTAGE REFERENCE REGISTER MAP
Name
Register
(BF80_#)
Virtual Address
9800 CVRCON
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:This register has corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for more
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:With the exception of those noted, all registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2
“CLR, SET and INV Registers” for more information.
2:Reset values are dependent on the DEVCFGx Configuration bits and the type of reset.
3:This register does not have associated CLR, SET, INV registers.
4:This bit is available on PIC32MX2XX devices only.
TABLE 4-17:DEVCFG: DEVICE CONFIGURATION WORD SUMMARY
PIC32MX1XX/2XX
Bits
Name
Register
(BFC0_#)
Virtual Address
2FF0 DEVCFG3
2FF4 DEVCFG2
2FF8 DEVCFG1
2FFC DEVCFG0
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:This bit is available on PIC32MX2XX devices only.
31:16 FVBUSONID FUSBIDIO IOL1WAY PMDL1WAY
31:16
31:16
31:16
TABLE 4-18:DEVICE AND REVISION ID SUMMARY
Name
Register
(BF80_#)
Virtual Address
F220DEVID
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:Reset values are dependent on the device variant.
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for
more information.
2:This bit is not available on PIC32MX2XX devices. The reset value for the TRISB register when this bit is not available is 0x0000EFBF.
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for
more information.
2:PORTC is not available on 28-pin devices.
3:This bit is available on 44-pin devices only.
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at their virtual addresses, plus offsets of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at its virtual address, plus an offset of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for more
information.
TABLE 4-26:CTMU REGISTER MAP
Name
Register
(BF80_#)
Virtual Address
A200 CTMUCON
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:All registers in this table have corresponding CLR, SET and INV registers at its virtual address, plus an offset of 0x4, 0x8 and 0xC, respectively. See Section 11.2 “CLR, SET and INV Registers” for more
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:With the exception of those noted, all registers in this table (except as noted) have corresponding CLR, SET and INV registers at its virtual address, plus an offset of 0x4, 0x8 and 0xC respectively. See
2:This register does not have associated SET and INV registers.
3:This register does not have associated CLR, SET and INV registers.
4:Reset value for this bit is undefined.
(2)
(3)
(2)
(2)
(3)
Section 11.2 “CLR, SET and INV Registers” for more information.
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:With the exception of those noted, all registers in this table (except as noted) have corresponding CLR, SET and INV registers at its virtual address, plus an offset of 0x4, 0x8 and 0xC respectively. See
(3)
(3)
Section 11.2 “CLR, SET and INV Registers” for more information.
2:This register does not have associated SET and INV registers.
3:This register does not have associated CLR, SET and INV registers.
4:Reset value for this bit is undefined.
Legend:x = unknown value on Reset; — = unimplemented, read as ‘0’. Reset values are shown in hexadecimal.
Note 1:With the exception of those noted, all registers in this table (except as noted) have corresponding CLR, SET and INV registers at its virtual address, plus an offset of 0x4, 0x8 and 0xC respectively. See
Section 11.2 “CLR, SET and INV Registers” for more information.
2:This register does not have associated SET and INV registers.
3:This register does not have associated CLR, SET and INV registers.
4:Reset value for this bit is undefined.
Register 4-1 through Register 4-8 are used for setting
the RAM and Flash memory partitions for data and
code.
REGISTER 4-1:BMXCON: BUS MATRIX CONFIGURATION REGISTER
Bit
Range
31:24
23:16
15:8
7:0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared
Bit
31/23/15/7
U-0U-0U-0U-0U-0U-0U-0U-0
Bit
30/22/14/6
Bit
29/21/13/5
Bit
28/20/12/4
Bit
27/19/11/3
Bit
26/18/10/2
25/17/9/1
————————
U-0U-0U-0R/W-1R/W-1R/W-1R/W-1R/W-1
———
U-0U-0U-0U-0U-0U-0U-0U-0
BMX
ERRIXI
BMX
ERRICD
BMX
ERRDMA
BMX
ERRDS
————————
U-0R/W-1U-0U-0U-0R/W-0R/W-0R/W-1
—
BMX
WSDRM
———BMXARB<2:0>
Bit
Bit
24/16/8/0
BMX
ERRIS
bit 31-21 Unimplemented: Read as ‘0’
bit 20BMXERRIXI: Enable Bus Error from IXI bit
1 = Enable bus error exceptions for unmapped address accesses initiated from IXI shared bus
0 = Disable bus error exceptions for unmapped address accesses initiated from IXI shared bus
bit 19BMXERRICD: Enable Bus Error from ICD Debug Unit bit
1 = Enable bus error exceptions for unmapped address accesses initiated from ICD
0 = Disable bus error exceptions for unmapped address accesses initiated from ICD
bit 18BMXERRDMA: Bus Error from DMA bit
1 = Enable bus error exceptions for unmapped address accesses initiated from DMA
0 = Disable bus error exceptions for unmapped address accesses initiated from DMA
bit 17BMXERRDS: Bus Error from CPU Data Access bit (disabled in Debug mode)
1 = Enable bus error exceptions for unmapped address accesses initiated from CPU data access
0 = Disable bus error exceptions for unmapped address accesses initiated from CPU data access
bit 16BMXERRIS: Bus Error from CPU Instruction Access bit (disabled in Debug mode)
1 = Enable bus error exceptions for unmapped address accesses initiated from CPU instruction access
0 = Disable bus error exceptions for unmapped address accesses initiated from CPU instruction access
bit 15-7Unimplemented: Read as ‘0’
bit 6BMXWSDRM: CPU Instruction or Data Access from Data RAM Wait State bit
1 = Data RAM accesses from CPU have one wait state for address setup
0 = Data RAM accesses from CPU have zero wait states for address setup
bit 5-3Unimplemented: Read as ‘0’
bit 2-0BMXARB<2:0>: Bus Matrix Arbitration Mode bits
111 = Reserved (using these Configuration modes will produce undefined behavior)
•
•
•
011 = Reserved (using these Configuration modes will produce undefined behavior)
010 = Arbitration Mode 2
001 = Arbitration Mode 1 (default)
000 = Arbitration Mode 0
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 31-0BMXDRMSZ<31:0>: Data RAM Memory (DRM) Size bits
Bit
31/23/15/7
RRRRR R R R
Bit
30/22/14/6
Bit
29/21/13/5
Bit
28/20/12/4
Bit
27/19/11/3
Bit
26/18/10/2
Bit
25/17/9/1
BMXDRMSZ<31:24>
RRRRR R R R
BMXDRMSZ<23:16>
RRRRR R R R
BMXDRMSZ<15:8>
RRRRR R R R
BMXDRMSZ<7:0>
Static value that indicates the size of the Data RAM in bytes:
0x00001000 = device has 4 KB RAM
0x00002000 = device has 8 KB RAM
0x00004000 = device has 16 KB RAM
0x00008000 = device has 32 KB RAM
Bit
24/16/8/0
REGISTER 4-6:BMXPUPBA: PROGRAM FLASH (PFM) USER PROGRAM BASE ADDRESS
Bit
(1,2)
29/21/13/5
Bit
Bit
28/20/12/4
27/19/11/3
BMXPUPBA<15:8>
BMXPUPBA<7:0>
Bit
Bit
26/18/10/2
Bit
25/17/9/1
24/16/8/0
REGISTER
Bit
Range
31:24
23:16
15:8
7:0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 31-20 Unimplemented: Read as ‘0’
bit 19-11 BMXPUPBA<19:11>: Program Flash (PFM) User Program Base Address bits
bit 10-0BMXPUPBA<10:0>: Read-Only bits
Bit
31/23/15/7
U-0U-0U-0U-0U-0U-0U-0U-0
30/22/14/6
————————
U-0U-0U-0U-0R/W-0R/W-0R/W-0R/W-0
————BMXPUPBA<19:16>
R/W-0R/W-0R/W-0R/W-0R/W-0R-0R-0R-0
R-0R-0R-0R-0R-0R-0R-0R-0
Value is always ‘0’, which forces 2 KB increments
Bit
Note 1: At Reset, the value in this register is forced to zero, which causes all of the RAM to be allocated to Kernal
mode data usage.
2: The value in this register must be less than or equal to BMXPFMSZ.
REGISTER 4-7:BMXPFMSZ: PROGRAM FLASH (PFM) SIZE REGISTER
Bit
Range
31:24
23:16
15:8
7:0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 31-0BMXPFMSZ<31:0>: Program Flash Memory (PFM) Size bits
Bit
31/23/15/7
RRRRR R R R
Bit
30/22/14/6
Bit
29/21/13/5
Bit
28/20/12/4
Bit
27/19/11/3
Bit
26/18/10/2
Bit
25/17/9/1
BMXPFMSZ<31:24>
RRRRR R R R
BMXPFMSZ<23:16>
RRRRR R R R
BMXPFMSZ<15:8>
RRRRR R R R
BMXPFMSZ<7:0>
Static value that indicates the size of the PFM in bytes:
0x00004000 = device has 16 KB Flash
0x00008000 = device has 32 KB Flash
0x00010000 = device has 64 KB Flash
0x00020000 = device has 128 KB Flash
of the PIC32MX1XX/2XX family of
devices. It is not intended to be a
comprehensive reference source. To
complement the information in this data
sheet, refer to Section 5. “FlashProgram Memory” (DS61121) in the
“PIC32 Family Reference Manual”, which
is available from the Microchip web site
(www.microchip.com/PIC32).
2: Some registers and associated bits
described in this section may not be
available on all devices. Refer to
Section 4.0 “Memory Organization” in
this data sheet for device-specific register
and bit information.
PIC32MX1XX/2XX devices contain an internal Flash
program memory for executing user code. There are
three methods by which the user can program this
memory:
1.Run-Time Self-Programming (RTSP)
2.EJTAG Programming
3.In-Circuit Serial Programming™ (ICSP™)
RTSP is performed by software executing from either
Flash or RAM memory. Information about RTSP
techniques is available in Section 5. “Flash Program
Memory” (DS61121) in the “PIC32 Family Reference
Manual”.
EJTAG is performed using the EJTAG port of the
device and an EJTAG capable programmer.
ICSP is performed using a serial data connection to the
device and allows much faster programming times than
RTSP.
The EJTAG and ICSP methods are described in the
“PIC32 Flash Programming Specification” (DS61145),
which can be downloaded from the Microchip web site.
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 31-16 Unimplemented: Read as ‘0’
bit 15WR: Write Control bit
bit 14WREN: Write Enable bit
bit 13WRERR: Write Error bit
bit 12LVDERR: Low-Voltage Detect Error bit (LVD circuit must be enabled)
bit 11LV DSTAT: Low-Voltage Detect Status bit (LVD circuit must be enabled)
bit 10-4Unimplemented: Read as ‘0’
bit 3-0NVMOP<3:0>: NVM Operation bits
Bit
31/23/15/7
U-0U-0U-0U-0U-0U-0U-0U-0
Bit
30/22/14/6
Bit
29/21/13/5
Bit
28/20/12/4
Bit
27/19/11/3
Bit
26/18/10/2
Bit
25/17/9/1
24/16/8/0
————————
U-0U-0U-0U-0U-0U-0U-0U-0
————————
R/W-0R/W-0R-0R-0R-0U-0U-0U-0
WRWRENWRERR
U-0U-0U-0U-0R/W-0R/W-0R/W-0R/W-0
(1)
LVDERR
(1)
LVDS TAT
(1)
———
————NVMOP<3:0>
This bit is writable when WREN = 1 and the unlock sequence is followed.
1 = Initiate a Flash operation. Hardware clears this bit when the operation completes
0 = Flash operation complete or inactive
1 = Enable writes to WR bit and enables LVD circuit
0 = Disable writes to WR bit and disables LVD circuit
This is the only bit in this register reset by a device Reset.
(1)
This bit is read-only and is automatically set by hardware.
1 = Program or erase sequence did not complete successfully
0 = Program or erase sequence completed normally
(1)
This bit is read-only and is automatically set by hardware.
1 = Low-voltage detected (possible data corruption, if WRERR is set)
0 = Voltage level is acceptable for programming
(1)
This bit is read-only and is automatically set, and cleared, by hardware.
1 = Low-voltage event active
0 = Low-voltage event NOT active
These bits are writable when WREN = 0.
1111 = Reserved
•
•
•
0111 = Reserved
0110 = No operation
0101 = Program Flash (PFM) erase operation: erases PFM, if all pages are not write-protected
0100 = Page erase operation: erases page selected by NVMADDR, if it is not write-protected
0011 = Row program operation: programs row selected by NVMADDR, if it is not write-protected
0010 = No operation
0001 = Word program operation: programs word selected by NVMADDR, if it is not write-protected
0000 = No operation
Bit
Note 1: This bit is cleared by setting NVMOP == 0000b, and initiating a Flash operation (i.e., WR).
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 31-0NVMKEY<31:0>: Unlock Register bits
These bits are write-only, and read as ‘0’ on any read
Note 1: This register is used as part of the unlock sequence to prevent inadvertent writes to the PFM.
Bit
24/16/8/0
Bit
Bit
26/18/10/2
Bit
25/17/9/1
REGISTER 5-3:NVMADDR: FLASH ADDRESS REGISTER
Bit
Range
31:24
23:16
15:8
7:0
Bit
31/23/15/7
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
Bit
30/22/14/6
Bit
29/21/13/5
Bit
28/20/12/4
27/19/11/3
NVMADDR<31:24>
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
NVMADDR<23:16>
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
NVMADDR<15:8>
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
NVMADDR<7:0>
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 31-0NVMADDR<31:0>: Flash Address bits
Bulk/Chip/PFM Erase: Address is ignored.
Page Erase: Address identifies the page to erase.
Row Program: Address identifies the row to program.
Word Program: Address identifies the word to program.
of the PIC32MX1XX/2XX family of
devices. It is not intended to be a
comprehensive reference source. To
complement the information in this data
sheet, refer to Section 7. “Resets”
(DS61118) in the “PIC32 FamilyReference Manual”, which is available
from the Microchip web site
(www.microchip.com/PIC32).
2: Some registers and associated bits
described in this section may not be
available on all devices. Refer to
Section 4.0 “Memory Organization” in
this data sheet for device-specific register
and bit information.
FIGURE 6-1:SYSTEM RESET BLOCK DIAGRAM
The Reset module combines all Reset sources and
controls the device Master Reset signal, SYSRST. The
following is a list of device Reset sources:
• POR: Power-on Reset
•MCLR
: Master Clear Reset pin
• SWR: Software Reset
• WDTR: Watchdog Timer Reset
• BOR: Brown-out Reset
• CMR: Configuration Mismatch Reset
A simplified block diagram of the Reset module is
illustrated in Figure 6-1.
of the PIC32MX1XX/2XX family of
devices. It is not intended to be a
comprehensive reference source. To
complement the information in this data
sheet, refer to Section 8. “Interrupt
Controller” (DS61108) in the “PIC32
Family Reference Manual”, which is
available from the Microchip web site
(www.microchip.com/PIC32).
2: Some registers and associated bits
described in this section may not be
available on all devices. Refer to
Section 4.0 “Memory Organization” in
this data sheet for device-specific register
and bit information.
PIC32MX1XX/2XX devices generate interrupt requests
in response to interrupt events from peripheral modules.
The interrupt control module exists externally to the CPU
logic and prioritizes the interrupt events before
presenting them to the CPU.
The PIC32MX1XX/2XX interrupt module includes the
following features:
• Up to 64 interrupt sources
• Up to 44 interrupt vectors
• Single and multi-vector mode operations
• Five external interrupts with edge polarity control
• Interrupt proximity timer
• Seven user-selectable priority levels for each
vector
• Four user-selectable subpriority levels within each
priority
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 31-17 Unimplemented: Read as ‘0’
bit 16SS0: Single Vector Shadow Register Set bit
bit 15-13 Unimplemented: Read as ‘0’
bit 12MVEC: Multi Vector Configuration bit
bit 11Unimplemented: Read as ‘0’
bit 10-8TPC<2:0>: Temporal Proximity Control bits
bit 7-5Unimplemented: Read as ‘0’
bit 4INT4EP: External Interrupt 4 Edge Polarity Control bit
bit 3INT3EP: External Interrupt 3 Edge Polarity Control bit
bit 2INT2EP: External Interrupt 2 Edge Polarity Control bit
bit 1INT1EP: External Interrupt 1 Edge Polarity Control bit
bit 0INT0EP: External Interrupt 0 Edge Polarity Control bit
Bit
31/23/15/7
U-0U-0U-0U-0U-0U-0U-0U-0
Bit
30/22/14/6
Bit
29/21/13/5
Bit
28/20/12/4
Bit
27/19/11/3
Bit
26/18/10/2
Bit
25/17/9/1
————————
U-0U-0U-0U-0U-0U-0U-0R/W-0
———————SS0
U-0U-0U-0R/W-0U-0R/W-0R/W-0R/W-0
———MVEC—TPC<2:0>
U-0U-0U-0R/W-0R/W-0R/W-0R/W-0R/W-0
———INT4EPINT3EPINT2EPINT1EPINT0EP
1 = Single vector is presented with a shadow register set
0 = Single vector is not presented with a shadow register set
1 = Interrupt controller configured for multi vectored mode
0 = Interrupt controller configured for single vectored mode
111 = Interrupts of group priority 7 or lower start the TP timer
•
•
•
010 = Interrupts of group priority 2 or lower start the TP timer
001 = Interrupts of group priority 1 start the IP timer
000 = Disables proximity timer
of the PIC32MX1XX/2XX family of
devices. It is not intended to be a
comprehensive reference source. To
complement the information in this data
sheet, refer to Section 6. “OscillatorConfiguration” ( D S 6 111 2 ) in th e
“PIC32 Family Reference Manual”, which
is available from the Microchip web site
(www.microchip.com/PIC32).
2: Some registers and associated bits
described in this section may not be
available on all devices. Refer to
Section 4.0 “Memory Organization” in
this data sheet for device-specific register
and bit information.
The PIC32MX1XX/2XX oscillator system has the
following modules and features:
• A Total of four external and internal oscillator
options as clock sources
• On-Chip PLL with user-selectable input divider,
multiplier and output divider to boost operating
frequency on select internal and external
oscillator sources
• On-Chip user-selectable divisor postscaler on
select oscillator sources
• Software-controllable switching between
various clock sources
• A Fail-Safe Clock Monitor (FSCM) that detects
clock failure and permits safe application recovery
or shutdown
• Dedicated On-Chip PLL for USB peripheral
A block diagram of the oscillator system is provided in
bit 18-16 PLLMULT<2:0>: Phase-Locked Loop (PLL) Multiplier bits
111 = Clock is multiplied by 24
110 = Clock is multiplied by 21
101 = Clock is multiplied by 20
100 = Clock is multiplied by 19
011 = Clock is multiplied by 18
010 = Clock is multiplied by 17
001 = Clock is multiplied by 16
000 = Clock is multiplied by 15
bit 15Unimplemented: Read as ‘0’
bit 14-12 COSC<2:0>: Current Oscillator Selection bits
111 = Internal Fast RC (FRC) Oscillator divided by OSCCON<FRCDIV> bits
110 = Internal Fast RC (FRC) Oscillator divided by 16
101 = Internal Low-Power RC (LPRC) Oscillator
100 = Secondary Oscillator (S
011 = Primary Oscillator (P
010 = Primary Oscillator (POSC) (XT, HS or EC)
001 = Internal Fast RC Oscillator with PLL module via Postscaler (FRCPLL)
000 = Internal Fast RC (FRC) Oscillator
bit 11Unimplemented: Read as ‘0’
bit 10-8NOSC<2:0>: New Oscillator Selection bits
111 = Internal Fast RC Oscillator (FRC) divided by OSCCON<FRCDIV> bits
110 = Internal Fast RC Oscillator (FRC) divided by 16
101 = Internal Low-Power RC (LPRC) Oscillator
100 = Secondary Oscillator (S
011 = Primary Oscillator with PLL module (XTPLL, HSPLL or ECPLL)
010 = Primary Oscillator (XT, HS or EC)
001 = Internal Fast Internal RC Oscillator with PLL module via Postscaler (FRCPLL)
000 = Internal Fast Internal RC Oscillator (FRC)
On Reset, these bits are set to the value of the FNOSC Configuration bits (DEVCFG1<2:0>).
bit 7CLKLOCK: Clock Selection Lock Enable bit
If clock switching and monitoring is
1 = Clock and PLL selections are locked
0 = Clock and PLL selections are not locked and may be modified
OSC)
OSC) with PLL module (XTPLL, HSPLL or ECPLL)
OSC)
disabled (FCKSM<1:0> = 1x):
(1)
If clock switching and monitoring is enabled (FCKSM<1:0> =
Clock and PLL selections are never locked and may be modified.
bit 6ULOCK: USB PLL Lock Status bit
1 = Indicates that the USB PLL module is in lock or USB PLL module start-up timer is satisfied
0 = Indicates that the USB PLL module is out of lock or USB PLL module start-up timer is in progress or
USB PLL is disabled
bit 5SLOCK: PLL Lock Status bit
1 = PLL module is in lock or PLL module start-up timer is satisfied
0 = PLL module is out of lock, PLL start-up timer is running or PLL is disabled
bit 4SLPEN: Sleep Mode Enable bit
1 = Device will enter Sleep mode when a WAIT instruction is executed
0 = Device will enter Idle mode when a WAIT instruction is executed
bit 3CF: Clock Fail Detect bit
1 = FSCM has detected a clock failure
0 = No clock failure has been detected
Note 1: Writes to this register require an unlock sequence. Refer to Section 6. “Oscillator” (DS61112) in the
“PIC32 Family Reference Manual” for details.
2: This bit is available on PIC32MX2XX devices only.