EasyManua.ls Logo

Infineon GPT12 - Reload Values Calculation

Infineon GPT12
13 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Implementation
Reload Values calculation example
Calculating the correct reload value to generate a PWM signal, depending on the given
frequency f and duty cycle, is done in the initialization function initGpt12PWM():
β€Ί Get the GPT12 module base frequency 𝑓
𝐺𝑃𝑇
by calling the iLLD function
IfxGpt12_getModuleFrequency()
β€Ί Calculate the timer frequency with the following formula:
The GPT1 block prescaler is set to IfxGpt12_Gpt1BlockPrescaler_32, 𝑓
𝐺𝑃𝑇
is divided by 32
The timer prescaler is set to IfxGpt12_TimerInputPrescaler_32, 𝑓
𝐺𝑃𝑇
is divided by 32
β€Ί Calculate dutyUpTime and dutyDownTime with the following formulas:
𝑓
π‘‘π‘–π‘šπ‘’π‘Ÿ
=
𝑓
𝐺𝑃𝑇
GPT1_BLOCK_PRESCALER Γ— TimerInputPrescaler
π’…π’–π’•π’šπ‘Όπ’‘π‘»π’Šπ’Žπ’† =
𝑓
π‘‘π‘–π‘šπ‘’π‘Ÿ
Γ—
𝑑𝑒𝑑𝑦𝐢𝑦𝑐𝑙𝑒
100
𝑓
π’…π’–π’•π’šπ‘«π’π’˜π’π‘»π’Šπ’Žπ’† =
𝑓
π‘‘π‘–π‘šπ‘’π‘Ÿ
Γ— 1 βˆ’
𝑑𝑒𝑑𝑦𝐢𝑦𝑐𝑙𝑒
100
𝑓
7
2020-06-05 Copyright Β© Infineon Technologies AG 2020. All rights reserved.

Related product manuals