...the world's most energy friendly microcontrollers
2016-04-28 - Giant Gecko Family - d0053_Rev1.20
596
www.silabs.com
23.3.6.2 Continuous Output Generation
Example 23.2. LETIMER Continuous Output Generation
In some scenarios, it might be desired to make LETIMER generate a continuous waveform. Very simple
constant waveforms can be generated without the repeat counter as shown in Figure 23.6 (p. 593) , but
to generate changing waveforms, using the repeat counter and buffer registers can prove advantageous.
For the example in Figure 23.10 (p. 596) , the goal is to produce a pulse train consisting of 3 sequences
with the following properties:
• 3 pulses with periods of 3 cycles
• 4 pulses with periods of 2 cycles
• 2 pulses with periods of 3 cycles
Figure 23.10. LETIMER Continuous Operation
CNT
COMP0
COMP1
REP0
REP1
1
2
0
3
1
2
2
3
1
2
1
3
1
2
0
3
1
2
2
2
1
2
1
2
1
2
0
2
1
2
2
1
1
2
1
1
1
2
0
1
1
1
1
4
1
1
0
4
1
1
1
3
2
1
0
3
2
1
1
2
2
1
0
2
2
1
1
1
2
1
0
1
2
2
2
2
2
2
1
2
2
2
0
2
2
2
2
1
Init ial configurat ion,
REPB just writ t en
UFIF
REP0IF
UFIF
UFIF
UFIF
UFIF
Int . flags set
St op,
final values
Writ e
COMP1 = 2
REP1 = 2
UFIF
UFIF
UFIF
REP0IF
4
4
4
4
4
u
4
u
4
u
2
2
2
u
2
u
2
u
2
u
2
2
1
1
2
2
0
1
2
u
2
u
REP0IF
LFACLK
LETIMERn
LETn_O0
UFOA0 = 01
LETn_O1
UFOA0 = 10
Pulse Seq. 1
Pulse Seq. 2
Pulse Seq. 3
4
4
4
4
4
4
2
2
2
2
2
0
0
2
u
The first two sequences are loaded into the LETIMER before the timer is started.
LETIMERn_COMP0 is set to 2 (cycles – 1), and LETIMERn_REP0 is set to 3 for the first sequence, and
the second sequence is loaded into the buffer registers, i.e. COMP1 is set to 1 and LETIMERn_REP1
is set to 4.
The LETIMER is set to trigger an interrupt when LETIMERn_REP0 is done by setting REP0 in
LETIMERn_IEN. This interrupt is a good place to update the values of the buffers. Last but not least
REPMODE in LETIMERn_CTRL is set to buffered mode, and the timer is started.
In the interrupt routine the buffers are updated with the values for the third sequence. If this had not been
done, the timer would have stopped after the second sequence.
The final result is shown in Figure 23.10 (p. 596) . The pulse output is grouped to show which sequence
generated which output. Toggle output is also shown in the figure. Note that the toggle output is not
aligned with the pulse outputs.
Note
Summary of Contents for Giant Gecko EFM32GG
Page 842: ......