TWR-K60N512-KEIL Freescale Semiconductor, TWR-K60N512-KEIL Datasheet - Page 60

no-image

TWR-K60N512-KEIL

Manufacturer Part Number
TWR-K60N512-KEIL
Description
K60N512 Keil Tower Kit
Manufacturer
Freescale Semiconductor
Series
Kinetisr
Type
MCUr

Specifications of TWR-K60N512-KEIL

Rohs Compliant
YES
Contents
4 Boards, Documentation, DVD
Peak Reflow Compatible (260 C)
Yes
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
For Use With/related Products
Freescale Tower System, K60N512
Using the low leakage wakeup unit
For our example we allow the processing of the pin PTE1 we add this initialization code:
__VECTOR_RAM[107] = (uint32)porte_isr; // Replace ISR
NVICICPR2|=(1<<27);
NVICISER2|=(1<<27);
Then there is a need for an interrupt service routine for the LLWU and one for the port
enabled as a wakeup source.
5.3.2.4 Wakeup sequence
The wakeup sequence is not obvious for some of the modes. For most of the wait and
stop modes code execution follows a predictable flow. For LLS mode which requires the
LLWU, the LLWU vector is fetched and taken right after the wakeup event. If the
wakeup source’s interrupt flag is not cleared by the LLWU interrupt handler, then the
next interrupt vector for the wakeup source is taken and the flag in the port or module can
be cleared. Code execution then continues with the instruction following the WFI
instruction that sent the MCU into the low power mode.
For VLLS1, VLLS2, or VLLS3, the exit is always through the reset vector and then
through the interrupt vector of the LLWU. There is a WAKEUP bit in the SRS register
that allows the user to tell if the reset was due to an LLWU wakeup event.
An example of wakeup test code is shown here.
if (MC_SRSL & MC_SRSL_WAKEUP_MASK){
printf("[outSRS]Pin Reset wakeup from low power modes\n");
The I/O states and the oscillator setup are held if the wakeup event is from VLLS1,
VLLS2, or VLLS3. The user is required to clear this hold by writing to the ACKISO bit
in the LLWU_CS register. Prior to releasing the hold the user must re-initialize the I/O to
the pre-low-power mode entry state, so that unwanted transitions on the I/O do not occur
when the hold is released.
if (( LLWU_CS & LLWU_CS_ACKISO_MASK) == 1) {
The RTC may be powered by a separate power source and therefore would not need to
re-initialized. A simple check of the state of the RTC registers to see if they are already
enabled would work.
60
if ((MC_PMCTRL & MC_PMCTRL_LPLLSM_MASK) == 2)
LLWU_CS != LLWU_CS_ACKISO_MASK;
//The state of PMCTRL[LPLLSM] prior to clearing due to update
// of PMPROT indicates which power mode was exited and should be
// used by initialization software for proper power mode recovery.
if ((MC_PMCTRL & MC_PMCTRL_LPLLSM_MASK) == 0)
if ((MC_PMCTRL & MC_PMCTRL_LPLLSM_MASK) == 3)
printf("[outSRS]Pin Reset wakeup from Normal Stop\n");
printf("[outSRS]Pin Reset wakeup from Very Low PowerStop(VLPS)\n");
printf("[outSRS]Pin Reset wakeup from Low Leakage Stop (LLS)\n"); }
//
RE-INITIALIZE MODULES and PORT OUTPUTS HERE
//Clear pending interrputs on Port E
//Enable interrupts from Port E
Kinetis Quick Reference User Guide, Rev. 0, 11/2010
}
Freescale Semiconductor

Related parts for TWR-K60N512-KEIL