180
Chapter 4
Clock Generator
Preliminary User’s Manual U17566EE1V2UM00
In this example, maskable interrupts are permitted to leave the power save
mode.
Be aware of the following notes when entering power save mode using the
above sequence:
Note
1.
It is recommended to disable maskable interrupt acknowledgement in
general by the “di” instruction (step 3.) to prevent any pending interrupt
from being served during the power save mode set-up procedure. This
makes it also possible to completely control the process after wake-up,
since no pending interrupt will be unintentional acknowledged. Before
enabling interrupt acknowledgement by the “ei” instruction (step 16.) after
wake-up, all unwanted interrupts can be discarded by setting xxIC.xxIF = 0
(step 15.).
Since the wake-up capability of the unmasked wake-up interrupts is not
affected by “di”, such interrupts shall be masked (step 1.) by
IMRm.xxMK = 1.
2.
The store instruction to PRCMD will not allow to acknowledge any interrupt
until processing of the subsequent instruction is complete. That means, an
interrupt will not be acknowledged before the store to PSC. This
presupposes that both store instructions are performed consecutively, as
shown in the above example.
If another instruction is placed between steps 7 and 8, an interrupt request
may be acknowledged in between, and the power save mode may not be
entered.
However if the “di” instruction was executed before (step 3.) none interrupt
will be acknowledged anyway.
3.
At least 5 “nop” instructions must follow the power down mode setting, that
means after the write to PSC. The microcontroller requires this time to
enter power down mode.
4.
The data written to the PRCMD register must be the same data that shall
be written to the write-protected register afterwards.
The above example ensures this method, since the contents of r10 is first
written to PRCMD and then immediately to PSC.
1.
// xxIC.xxMK = 0
// mask all none wake-up interrupts
2.
// xxIC.xxMK = 1
// unmask all wake-up interrupts
3.
di
4.
mov
0x02,r10
5.
st.b
10,PSM[r0]
// PSM.PSM[1:0] = 10B: WATCH mode
6.
mov
0x62,r10
7.
st.b
r10,PRCMD[r0]
// enable write to PSC
8.
st.b
r10,PSC[r0]
// wake up by maskable interrupts
// and enter power save mode
9.
nop
10.
nop
11.
nop
12.
nop
13.
nop
14.
// after wake-up
15.
// xxIC.xxIF = 0
// discard all unwanted pending interrupts
16.
ei
electronic components distributor