19.3.3 Top Value
If COMP0TOP in LETIMERn_CTRL is set, the value of LETIMERn_COMP0 acts as the top value of the timer, and LETIMERn_COMP0
is loaded into LETIMERn_CNT on timer underflow. If COMP0TOP is cleared to 0, the timer wraps around to 0xFFFF. The underflow
interrupt flag UF in LETIMERn_IF is set when the timer reaches zero.
19.3.3.1 Buffered Top Value
If BUFTOP in LETIMERn_CTRL is set, the value of LETIMERn_COMP0 is buffered by LETIMERn_COMP1. In this mode, the value of
LETIMERn_COMP1 is loaded into LETIMERn_COMP0 every time LETIMERn_REP0 is about to decrement to 0. This can for instance
be used in conjunction with the buffered repeat mode to generate continually changing output waveforms.
Write operations to LETIMERn_COMP0 have priority over buffer loads.
19.3.3.2 Repeat Modes
By default, the timer wraps around to the top value or 0xFFFF on each underflow, and continues counting. The repeat counters can be
used to get more control of the operation of the timer, including defining the number of times the counter should wrap around. Four
different repeat modes are available, see
Table 19.1 LETIMER Repeat Modes on page 646
.
Table 19.1. LETIMER Repeat Modes
REPMODE
Mode
Description
0b00
Free-running
The timer runs until it is stopped.
0b01
One-shot
The timer runs as long as LETI-
MERn_REP0 != 0. LETIMERn_REP0 is de-
cremented at each timer underflow.
0b10
Buffered
The timer runs as long as LETI-
MERn_REP0 != 0. LETIMERn_REP0 is de-
cremented on each timer underflow. If LE-
TIMERn_REP1 has been written, it is loa-
ded into LETIMERn_REP0 when LETI-
MERn_REP0 is about to be decremented
to 0.
0b11
Double
The timer runs as long as LETI-
MERn_REP0 != 0 or LETIMERn_REP1 !=
0. Both LETIMERn_REP0 and LETI-
MERn_REP1 are decremented at each tim-
er underflow.
The interrupt flags REP0 and REP1 in LETIMERn_IF are set whenever LETIMERn_REP0 or LETIMERn_REP1 are decremented to 0
respectively. REP0 is also set when the value of LETIMERn_REP1 is loaded into LETIMERn_REP0 in buffered mode.
EFM32JG1 Reference Manual
LETIMER - Low Energy Timer
silabs.com
| Smart. Connected. Energy-friendly.
Preliminary Rev. 0.6 | 646