Download User Manual ST10F272

Transcript
UM0381
Power reduction modes
routine which can save the internal state into RAM. After the internal state has been saved,
the trap routine may set a flag or write a certain bit pattern into specific RAM locations, and
then execute the PWRDN instruction. If the NMI pin is still low at this time, power down
mode will be entered, otherwise program execution continues.
Exiting power down mode
In this mode, the only way to exit power down mode is with an external hardware reset.
The initialization routine (executed upon reset) can check the identification flag (see
WDTCON - Section Section 14: Watchdog timer on page 290) or bit pattern within RAM to
determine whether the controller was initially switched on, or whether it was properly
restarted from Power Down mode.
24.2.2
Interruptible power down mode
This mode is selected by setting the bit PWDCFG in register SYSCON to ‘1’.
In this mode, the power down mode can be entered if enabled Fast External Interrupt pins
(EXxIN pins, alternate functions of Port2 pins, with x = 7...0) are in their inactive level. This
inactive level is configured with the EXIxES bit field in the EXICON register, as follow:
EXICON (F1C0h / E0h)
15
14
13
12
ESFR
11
10
9
8
Reset Value: 0000h
7
6
5
4
3
2
1
0
EXI7ES
EXI6ES
EXI5ES
EXI4ES
EXI3ES
EXI2ES
EXI1ES
EXI0ES
RW
RW
RW
RW
RW
RW
RW
RW
Bit
Function
External Interrupt x Edge Selection Field (x = 7...0)
0 0: Fast external interrupts disabled: standard mode
EXxIN pin not taken in account for entering/exiting Power Down mode.
EXIxES
(x = 7...0)
0 1: Interrupt on positive edge (rising)
Enter power down mode if EXiIN = ‘0’, exit if EXxIN = ‘1’ (ref as ‘high’ active level)
1 0: Interrupt on negative edge (falling)
Enter power down mode if EXiIN = ‘1’, exit if EXxIN = ‘0’ (ref as ‘low’ active level)
1 1: Interrupt on any edge (rising or falling)
Always enter Power Down mode, exit if EXxIN level changed.
Exiting power down mode
When Interruptible power down mode is entered, the CPU and peripheral clocks are frozen,
and the oscillator and PLL are stopped (when RTC is disabled, so there is no need for a
clock reference). Interruptible power down mode can be exited by either asserting RSTIN or
one of the enabled EXxIN pin (Fast External Interrupt). In case the Real Time Clock module
needs to be running during Power Down, either the main or the low-power oscillator is not
stopped. The PLL, on the contrary is nevertheless switched off.
If power down mode is exited by a hardware RESET, RSTIN pin must be held low until the
oscillator (if not already running for Real Time Clock operation) and PLL have restarted and
stabilized.
EXxIN inputs are normally sampled interrupt inputs. However, the power down mode
circuitry uses them as level-sensitive inputs. An EXxIN (x = 7...0) Interrupt Enable bit (bit
479/537