
...the world's most energy friendly microcontrollers
Figure 21.4. LETIMER Buffered Repeat State Machine
Wait for positive clock edge
If (STOP)
RUNNING = 0
Else if (START)
NO
RUNNING
RUNNING = 1
End if
NO
START
YES
START = 0
STOP = 0
YES
CNT = CNT - 1
NO
CNT = = 0
CNT = = 0
NO
CNT = CNT - 1
YES
YES
CNT = TOP*
CNT = TOP*
NO
REP0 = = 0
REP0 < 2
NO
If (! START)
REP0 = REP0 - 1
CNT = TOP* *
If (BUFTOP)
YES
YES
CNT = TOP*
If (BUFTOP)
COMP0 = COMP1
NO
REP1 = = 0
! REP1 USED and ! REP1 ! = 0 YES
COMP0 = COMP1
REP0 = REP1
REP0 = REP1
REP1 USED = 1
YES
NO
REP1 USED = 1
STOP = 1
REP0 = 0
TOP*
If (COMP0TOP)
TOP* = COMP0
Else
TOP* = 0xFFFF
TOP* *
If (! COMP0TOP)
TOP* * = 0xFFFF
Else if (BUFTOP)
TOP* * = COMP1
Else
TOP* * = COMP0
21.3.3.2.4 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 LETIMERn_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 21.5
(p. 293) .2011-04-12 - d0001_Rev1.10
292
www.energymicro.com