The final result is shown in
Figure 19.12 LETIMER Continuous Operation on page 656
. 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:
Multiple LETIMER cycles are required to write a value to the LETIMER registers. The example in
Figure 19.12 LETIMER Continuous
assumes that writes are done in advance so they arrive in the LETIMER as described in the figure.
Figure 19.13 LETIMER LETIMERn_CNT Not Initialized to 0 on page 657
shows an example where the LETIMER is started while LE-
TIMERn_CNT is nonzero. In this case the length of the first repetition is given by the value in LETIMERn_CNT.
CNT
TOP0
TOP1
REP0
REP1
3
2
4
3
3
3
2
3
3
3
2
2
3
3
2
1
3
3
2
0
3
3
2
2
2
3
2
1
2
3
2
0
2
3
2
2
1
3
2
1
1
3
2
0
1
3
3
3
3
3
3
2
3
3
3
1
3
3
3
0
3
3
3
3
2
3
3
2
2
3
3
1
2
3
3
0
2
3
3
3
1
3
3
2
1
3
3
1
1
3
3
0
Initial configuration,
REP1 just written
UFIF
REP0IF
UFIF
UFIF
UFIF
UFIF
UFIF
REP0IF
Int. flags set
Stop,
final values
LFACLK
LETIMERn
LETn_O0
UFOA0 = 01
LETn_O1
UFOA0 = 10
3
3
3
3
3
3
3 3
u
3
u
3
u
3
u
3
u
3
u
3
u
3
3
3
3
u
3
u
3
u
1
3
u
3
u
3
3
0
0
3
u
Figure 19.13. LETIMER LETIMERn_CNT Not Initialized to 0
19.3.6.3 PWM Output
There are several ways of generating PWM output with the LETIMER, but the most straight-forward way is using the PWM output
mode. This mode is enabled by setting UFOA0 or UFOA1 in LETIMERn_CTRL to 3. In PWM mode, the output is set idle on timer un-
derflow, and active on LETIMERn_COMP1 match, so if for instance COMP0TOP = 1 and OPOL0 = 0 in LETIMERn_CTRL, LETI-
MERn_COMP0 determines the PWM period, and LETIMERn_COMP1 determines the active period.
The PWM period in PWM mode is LETIMERn 1. There is no special handling of the case where LETIMERn_COMP1 > LE-
TIMERn_COMP0, so if LETIMERn_COMP1 > LETIMERn_COMP0, the PWM output is given by the idle output value. This means that
for OPOLx = 0 in LETIMERn_CTRL, the PWM output will always be 0 for at least one clock cycle, and for OPOLx = 1 LETI-
MERn_CTRL, the PWM output will always be 1 for at least one clock cycle.
To generate a PWM signal using the full PWM range, invert OPOLx when LETIMERn_COMP1 is set to a value larger than LETI-
MERn_COMP0.
19.3.6.4 Interrupts
The interrupts generated by the LETIMER are combined into one interrupt vector. If the interrupt for the LETIMER is enabled, an inter-
rupt will be made if one or more of the interrupt flags in LETIMERn_IF and their corresponding bits in LETIMER_IEN are set.
EFM32JG1 Reference Manual
LETIMER - Low Energy Timer
silabs.com
| Smart. Connected. Energy-friendly.
Preliminary Rev. 0.6 | 657