![](http://datasheet.mmic.net.cn/100000/IF180C52TXXX-20R_datasheet_3493957/IF180C52TXXX-20R_256.png)
256
32099I–01/2012
AT32UC3L016/32/64
The peripheral event will be generated if the corresponding bit in the Event Mask (EVM) register
is set. Bits in EVM register are set by writing a one to the corresponding bit in the Event Enable
(EVE) register, and cleared by writing a one to the corresponding bit in the Event Disable (EVD)
register.
14.5.5
AST wakeup
The AST can wake up the CPU directly, without the need to trigger an interrupt. A wakeup can
be generated when the counter overflows, when the counter reaches the selected alarm value,
or when the selected prescaler bit has a 0-to-1 transition. In this case, the CPU will continue
executing from the instruction following the sleep instruction.
The AST wakeup is enabled by writing a one to the corresponding bit in the Wake Enable Regis-
ter (WER). When the CPU wakes from sleep, the wake signal must be cleared by writing a one
to the corresponding bit in SCR to clear the internal wake signal to the sleep controller. If the
wake signal is not cleared after waking from sleep, the next sleep instruction will have no effect
because the CPU will wake immediately after this sleep instruction.
The AST wakeup can wake the CPU from any sleep mode where the source clock is active. The
AST wakeup can be configured independently of the interrupt masking.
14.5.6
Shutdown Mode
If the AST is configured to use a clock that is available in Shutdown mode, the AST can be used
to wake up the system from shutdown. Both the alarm wakeup, periodic wakeup, and overflow
wakeup mechanisms can be used in this mode.
When waking up from Shutdown mode all control registers will have the same value as before
the shutdown was entered, except the Interrupt Mask Register (IMR). IMR will be reset with all
interrupts turned off. The software must first reconfigure the interrupt controller and then enable
the interrupts in the AST to again receive interrupts from the AST.
The CV register will be updated with the current counter value directly after wakeup from shut-
down. The SR will show the status of the AST, including the status bits set during shutdown
operation.
When waking up the system from shutdown the CPU will start executing code from the reset
start address.
14.5.7
Digital Tuner
The digital tuner adds the possibility to compensate for a too-slow or a too-fast input clock. The
ADD bit in the Digital Tuner Register (DTR.ADD) selects if the prescaler frequency should be
reduced or increased. If ADD is ‘0’, the prescaler frequency is reduced:
where f
TUNED is the tuned frequency, f0 is the original prescaler frequency, and VALUE and EXP
are the corresponding fields to be programmed in DTR. Note that DTR.EXP must be greater
than zero. Frequency tuning is disabled by programming DTR.VALUE as zero.
fTUNED f0 1
1
roundup
256
VALUE
--------------------
2EXP
()
1
+
--------------------------------------------------------------------------------
–
=