English
Language : 

PIC32MX440F256H-80I Datasheet, PDF (565/646 Pages) Microchip Technology – 64/100-Pin General Purpose and USB 32-Bit Flash Microcontrollers
PIC32MX3XX/4XX
26.3 Interrupts and Resets
The WDT will cause an NMI or a device Reset when it
expires. The Power Save mode of the device
determines which event occurs. The PWRT does not
generate interrupts or Resets.
26.3.1 WATCHDOG TIMER RESET
When the WDT expires and the device is not in Sleep
or Idle, a device Reset is generated. The CPU code
execution jumps to the device Reset vector and the
Registers and Peripherals are forced to their Reset
values.
To detect a WDT Reset, the WDTO (RCON<4>),
SLEEP (RCON<3>) and IDLE (WDTCON<2>) bits
must be tested. If the WDTO bit is a ‘1’, the event was
do to a WDT time-out. The SLEEP and IDLE bits can
then be tested to determine if the WDT event occurred
while the device was awake or if it was in Sleep or Idle.
26.3.2 WATCHDOG TIMER NMI
When the WDT expires in Sleep or Idle, a NMI is gen-
erated. The NMI causes the CPU code execution to
jump to the device Reset vector. Though the NMI share
the same vector as a device Reset, registers and
peripherals are not reset.
To detect a wake from a Power Save mode by WDT, the
WDTO (RCON<4>), SLEEP (RCON<3>) and IDLE
(WDTCON<2>) bits must be tested. If the WDTO bit is
a ‘1’ the event was caused by a WDT time-out. The
SLEEP and IDLE bits can then be tested to determine
if the WDT event occurred in Sleep or Idle.
To cause a WDT time-out in Sleep to act like an inter-
rupt, a return from interrupt instruction may be used in
the start-up code after the event was determined to be
a WDT wake-up. This will cause code execution to con-
tinue with the opcode following the WAIT instruction
that put the device into Power Save mode. See
Example 26-2.
EXAMPLE 26-1: SAMPLE WDT INITIALIZATION AND SERVICING
//This code fragment assumes the WDT was not enabled by the device configuration
// The Postscaler value must be set with the device configuration
WDTCONSET = 0x8000;
// Turn on the WDT
main
{
WDTCONSET = 0x01;
// Service the WDT
... User code goes here ...
}
© 2008 Microchip Technology Inc.
Preliminary
DS61143E-page 563