...the world's most energy friendly microcontrollers
2014-07-02 - Gecko Family - d0001_Rev1.30
321
www.silabs.com
LETIMERn_CNT becomes equal to their value. When LETIMERn_CNT becomes equal to the value
of LETIMERn_COMP0, the interrupt flag COMP0 in LETIMERn_IF is set, and when LETIMERn_CNT
becomes equal to the value of LETIMERn_COMP1, the interrupt flag COMP1 in LETIMERn_IF is set.
21.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. Else, the timer wraps
around to 0xFFFF. The underflow interrupt flag UF in LETIMERn_IF is set when the timer reaches zero.
21.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.
21.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 21.1 (p. 321) .
Table 21.1. LETIMER Repeat Modes
REPMODE
Mode
Description
00
Free
The timer runs until it is stopped
01
One-shot
The timer runs as long as
LETIMERn_REP0 != 0.
LETIMERn_REP0 is decremented at
each timer underflow.
10
Buffered
The timer runs as long as
LETIMERn_REP0 != 0.
LETIMERn_REP0 is decremented
on each timer underflow. If
LETIMERn_REP1 has been written,
it is loaded into LETIMERn_REP0
when LETIMERn_REP0 is about to be
decremented to 0.
11
Double
The timer runs as long as
LETIMERn_REP0 != 0 or
LETIMERn_REP1 != 0.
Both LETIMERn_REP0 and
LETIMERn_REP1 are decremented at
each timer 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.
21.3.3.2.1 Free Mode
In the free running mode, the LETIMER acts as a regular timer, and the repeat counter is disabled.
When started, the timer runs until it is stopped using the STOP command bit in LETIMERn_CMD. A
state machine for this mode is shown in Figure 21.2 (p. 322) .
Summary of Contents for EFM32G
Page 505: ......