English
Language : 

PIC32MX440F256H-80I Datasheet, PDF (47/646 Pages) Microchip Technology – 64/100-Pin General Purpose and USB 32-Bit Flash Microcontrollers
PIC32MX3XX/4XX
2.6 MCU Initialization
Software is required to initialize the following parts of
the device after a Reset event:
• General Purpose Registers
• Coprocessor 0 State
2.6.1 GENERAL PURPOSE REGISTERS
The MCU register file powers up in an unknown state
with the exception of r0 which is always 0. Initializing
the rest of the register file is not required for proper
operation of hardware. Depending on the software
environment however, several registers may need to
be initialized. Some of these are:
• SP – Stack Pointer
• GP – Global Pointer
• FP – Frame Pointer
2.6.2 COPROCESSOR 0 STATE
Miscellaneous CP0 states need to be initialized prior to
leaving the boot code. There are various exceptions
which are blocked by ERL = 1 or EXL = 1 and which are
not cleared by Reset. These can be cleared to avoid
taking spurious exceptions when leaving the boot code.
TABLE 2-6: CP0 INITIALIZATION
CP0 Register
Action
Cause
WP (Watch Pending), SW0/1 (Software Interrupts) should be cleared.
Config
Count(1)
Compare(1)
Typically, the K0, KU and K23 fields should be set to the desired Cache Coherency Algorithm
(CCA) value prior to accessing the corresponding memory regions. But in the M4K core, all
CCA values are treated identically, so the hardware reset value of these fields need not be
modified.
Should be set to a known value if Timer Interrupts are used.
Should be set to a known value if Timer Interrupts are used. The write to compare will also
clear any pending Timer Interrupts (thus, Count should be set before Compare to avoid any
unexpected interrupts).
Status
Desired state of the device should be set.
Other CP0 state
Other registers should be written before they are read. Some registers are not explicitly
writable, and are only updated as a by-product of instruction execution or a taken exception.
Uninitialized bits should be masked off after reading these registers.
Note 1: When the Count register is equal to the Compare register, a timer interrupt is signaled. There is a mask bit in
the interrupt controller to disable passing this interrupt to the MCU if desired.
2.7 I/O Pin Configuration
The MCU module has EJTAG pins that may be config-
ured as user-available I/O pins. If EJTAG is used for
debug, it is important to make sure that software does
not clear DDPCON<JTAGEN>.
© 2008 Microchip Technology Inc.
Preliminary
DS61143E-page 45