User manual

...the world's most energy friendly microcontrollers
2012-04-24 - Giant Gecko Family - d0053_Rev0.96 585
www.energymicro.com
Figure 23.5. LETIMER Double Repeat State Machine
RUNNING
YES
CNT = = 0
CNT = CNT - 1
NO
REP0 < 2
And
REP1 < 2
YES
NO
STOP = 1
REP0 = 0
CNT = TOP*
If (REP0 > 0)
REP0 = REP0 - 1
If (REP1 > 0)
REP1 = REP1 - 1
If (STOP)
RUNNING = 0
Else if (START)
RUNNING = 1
End if
START = 0
STOP = 0
Wait for positive clock edge
YES
If (COMP0TOP)
TOP* = COMP0
Else
TOP* = 0xFFFF
TOP*
NO
START
YES
CNT = = 0
REP0 = = 0
and
REP1 = = 0
YES
CNT = CNT - 1
CNT = TOP*
NO
NO
YES
NO
23.3.3.3 Clock Source
The LETIMER clock source and its prescaler value are defined in the Clock Management Unit (CMU).
The LFACLK
LETIMERn
has a frequency given by Equation 23.1 (p. 585) .
LETIMER Clock Frequency
f
LFACKL_LETIMERn
= 32.768/2
LETIMERn
(23.1)
where the exponent LETIMERn is a 4 bit value in the CMU_LFAPRESC0 register.
To use this module, the LE interface clock must be enabled in CMU_HFCORECLKEN0, in addition to
the module clock.
23.3.3.4 RTC Trigger
The LETIMER can be configured to start on compare match events from the Real Time Counter (RTC).
If RTCC0TEN in LETIMERn_CTRL is set, the LETIMER will start on a compare match on RTC compare
channel 0. In the same way, RTCC1TEN in LETIMERn_CTRL enables the LETIMER to start on a
compare match with RTC compare channel 1.
Note
The LETIMER can only use compare match events from the RTC if the LETIMER runs
at a higher than or equal frequency than the RTC. Also, if the LETIMER runs at twice the
frequency of the RTC, a compare match event in the RTC will trigger the LETIMER twice.
Four times the frequency gives four consecutive triggers, etc. The LETIMER will only
continue running if triggered while it is running, so the multiple-triggering will only have an
effect if you try to disable the RTC when it is being triggered.