pic32mx320f064h Microchip Technology Inc., pic32mx320f064h Datasheet - Page 488

no-image

pic32mx320f064h

Manufacturer Part Number
pic32mx320f064h
Description
64/100-pin General Purpose, 32-bit Flash Microcontrollers
Manufacturer
Microchip Technology Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
pic32mx320f064h-40I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-40I/PT
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
pic32mx320f064h-40V/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-80I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-80V/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064hT-40I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
PIC32MX
EXAMPLE 26-2:
DS61143-page 486
// sample code to determine the cause of a WDT event
// Unlock the OSCCON register
asm (“la $t3, SYSREG”);//load the address of SYSREG into t3
asm (“li $t0,0xaa996655”);// load Key value into t0
asm (”nor $t1, $0, $t0”);// complement Key1 to form Key2
// the following writes must be performed back to back
asm (”sw $t0, 0($t3)” );
asm (”sw $t1, 0($t3)”);
// OSCCON is now unlocked
OSCCONSET = 0x10;// set power save mode to Sleep
// Alternate relock code in ‘C’
SYSREG = 0x33333333;
// OSCCON is relocked
// The following code fragment is at the top of the device start-up code
WDTCONSET = 0x8000;//Enable WDT
while (1)
{
}
if ( RCON & 0x18 )
{
}
if ( RCON & 0x14 )
{
}
if ( RCON & 0x10 )
{
}
... user code ...
WDTCONSET = 0x01;// service the WDT
asm ( “wait” );// put device is selected power save mode
// code execution will resume here after wake
... user code ...
// The WDT caused a wake from sleep
asm ( “eret” );// return from interrupt
// The WDT caused a wake from idle
asm ( “eret” );// return from interrupt
// The WDT timed-out while the device was awake
SAMPLE CODE TO DETERMINE THE CAUSE OF A WDT EVENT
Advance Information
//write Key1 to SYSREG
//write Key2 to SYSREG
© 2007 Microchip Technology Inc.

Related parts for pic32mx320f064h