Implementation
Calculation example of the PWM frequency
Background knowledge:
›
Maximum value of timer T12 is
65534
(16 bit
– 1; default configuration, configured inside
function
IfxCcu6_Icu_initModuleConfig()
)
›
Frequency of timer T12 is
781250 Hz
(stored inside variable
g_CCU6captureFrequency_Hz
; default configuration), which means that the value of timer
T12 is incremented every
1.28 µs
(1 /
781250 Hz
)
›
Overflow of timer T12 occurs after
≈
0.084 s
(65534 * 1.28 µs)
›
The total amount of increments can be calculated by comparing the current value of timer
T12 with the value of timer T12 one PWM period ago e.g.
1000
Interrupt on each rising edge:
T12 count
(value is incremented
with frequency of timer T12)
PWM signal
t
t
Period of
timer T12 overflow
Period of
PWM signal
High level
time
10
2020-01-17
Copyright © Infineon Technologies AG 2020. All rights reserved.