19.3.3.6 Double Mode
The Double repeat mode works much like the one-shot repeat mode. The difference is that, where the one-shot mode counts as long
as LETIMERn_REP0 is larger than 0, the double mode counts as long as either LETIMERn_REP0 or LETIMERn_REP1 is larger than
0. As an example, say LETIMERn_REP0 is 3 and LETIMERn_REP1 is 10 when the timer is started. If no further interaction is done with
the timer, LETIMERn_REP0 will now be decremented 3 times, and LETIMERn_REP1 will be decremented 10 times. The timer counts a
total of 10 times, and LETIMERn_REP0 is 0 after the first three timer underflows and stays at 0. LETIMERn_REP0 and LETI-
MERn_REP1 can be written at any time. After a write to either of these, the timer is guaranteed to underflow at least the written number
of times if the timer is running. Use the Double repeat mode to generate output on both the LETIMER outputs at the same time. The
state machine for this repeat mode can be seen in
Figure 19.5 LETIMER Double Repeat State Machine on page 650
.
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
Figure 19.5. LETIMER Double Repeat State Machine
19.3.3.7 Clock Source
The LETIMER clock source and its prescaler value are defined in the Clock Management Unit (CMU). The LFACLK
LETIMERn
has a fre-
Figure 19.6 LETIMER Clock Frequency on page 650
f
LFACKL_LETIMERn
= 32.768/2
LETIMERn
Figure 19.6. LETIMER Clock Frequency
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.
EFM32JG1 Reference Manual
LETIMER - Low Energy Timer
silabs.com
| Smart. Connected. Energy-friendly.
Preliminary Rev. 0.6 | 650