19.3.3.5 Buffered Mode
The Buffered repeat mode allows buffered timer operation. When started, the timer runs LETIMERn_REP0 number of times. If LETI-
MERn_REP1 has been written since the last time it was used and it is nonzero, LETIMERn_REP1 is then loaded into LETI-
MERn_REP0, and counting continues the new number of times. The timer keeps going as long as LETIMERn_REP1 is updated with a
nonzero value before LETIMERn_REP0 is finished counting down. The timer top value (LETIMERn_COMP0) may also optionally be
buffered by setting BUFTOP in LETIMERn_CTRL.
If the timer is started when both LETIMERn_CNT and LETIMERn_REP0 are zero but LETIMERn_REP1 is non-zero, LETIMERn_REP1
is loaded into LETIMERn_REP0, and the counter counts the loaded number of times.
Used in conjunction with a buffered top value, both the top and repeat values of the timer may be buffered, and the timer can for in-
stance be set to run 4 times with period 7 (top value 6), 6 times with period 200, then 3 times with period 50.
A state machine for the buffered repeat mode is shown in
Figure 19.4 LETIMER Buffered Repeat State Machine on page 649
.
REP1
USED
shown in the state machine is an internal variable that keeps track of whether the value in LETIMERn_REP1 has been loa-
ded into LETIMERn_REP0 or not. The purpose of this is that a value written to LETIMERn_REP1 should only be counted once.
REP1
USED
is cleared whenever LETIMERn_REP1 is written.
RUNNING
YES
CNT == 0
CNT = CNT - 1
NO
REP0 < 2
YES
!REP1
USED
and !REP1 != 0
CNT = TOP**
If (BUFTOP)
COMP0 = COMP1
REP0 = REP1
REP1
USED
= 1
NO
YES
STOP = 1
REP0 = 0
NO
CNT = TOP*
If (!START)
REP0 = REP0 - 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** = 0xFFFF
Else if (BUFTOP)
TOP** = COMP1
Else
TOP** = COMP0
If (COMP0TOP)
TOP* = COMP0
Else
TOP* = 0xFFFF
TOP*
TOP**
NO
START
YES
CNT == 0
REP0 == 0
YES
CNT = CNT - 1
CNT = TOP**
If (BUFTOP)
COMP0 = COMP1
REP0 = REP1
REP1
USED
= 1
CNT = TOP*
NO
NO
YES
REP1 == 0
NO
YES
NO
Figure 19.4. LETIMER Buffered Repeat State Machine
EFM32JG1 Reference Manual
LETIMER - Low Energy Timer
silabs.com
| Smart. Connected. Energy-friendly.
Preliminary Rev. 0.6 | 649