...the world's most energy friendly microcontrollers
2014-07-02 - Tiny Gecko Family - d0034_Rev1.20
264
www.silabs.com
Figure 17.20. TIMER Up/Down-count PWM Generation
0
TIMERn_TOP
TIMERn_CCx _CCV
TIMn_CCx
Overflow
Com pare m at ch
Buffer updat e
TIMER Up/Down-count PWM Resolution Equation
R
PWM
up/down
= log(TOP+1)/log(2)
(17.9)
The PWM frequency is given by Equation 17.10 (p. 264) :
TIMER Up/Down-count PWM Frequency Equation
f
PWM
up/down
= f
HFPERCLK
/ ( 2^(PRESC+1) x TOP)
(17.10)
The high duty cycle is given by Equation 17.11 (p. 264)
TIMER Up/Down-count Duty Cycle Equation
DS
up/down
= CCVx/TOP
(17.11)
17.3.2.7.1 2x Count Mode
When the Timer is set in 2x mode, the TIMER will count up/down by two. This will in effect make any
odd Top value be rounded down to the closest even number. Similarly, any odd CC value will generate
a match on the closest lower even value as shown in Figure 17.21 (p. 264)
Figure 17.21. TIMER CC out in 2x mode
2
4
2
0
2
0
Clock
CC Out
4
2
4
2
0
2
0
4
Top = 5
CC = 1
Top = 5
CC = 2
The mode is enabled by setting the X2CNT field in TIMERn_CTRL register. The intended use of the
2x mode is to generate 2x PWM frequency when the Compare/Capture channel is put in PWM mode.
Since the PWM output is updated on both edges of the clock, frequency prescaling will result in incorrect
result in this mode. The PWM resolution (in bits) is then given by Equation 17.12 (p. 264) .
TIMER 2x PWM Resolution Equation
Summary of Contents for EFM32TG
Page 543: ......