s32k312 emios pwm period

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

s32k312 emios pwm period

ソリューションへジャンプ
1,536件の閲覧回数
fengba_360
Contributor III

我想设置 s32k312 emios PWM 周期。你能帮我检查一下我使用的公式是否正确吗?例如,如果我想将 10ms 设置为一个周期, 下图中的周期 字段是否等于 coreclock / DIV / 100 ?

微信图片_20240808235953.png

0 件の賞賛
返信
1 解決策
1,516件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @fengba_360 

EMIOS module setting in ConfigTools are named as Clock_Divider Value, Master_Bus Prescaler, and Master BusAlternate Prescaler. How to know their relationship and their usage? When Emios is used as PWM (OPWMB, OPWFMB, ...), it divides the CORE_CLK clock by the Clock Divider Value (global prescaler (MCR[GPRE] + 1)) and routes the resulting prescaled clock output to the Master Bus Prescaler (channel internal prescaler (Cn[UCPRE] + 1)). Thus channel internal counter counts (CORE_CLK/global prescaler/internal prescaler) clock.

For example: assuming the channel running in for example OPWFMB mode, its PWM frequency is calculated as: 

PWM frequency = CORE_CLK / global prescaler / internal prescaler / (B1+1)

Where B1 is the period ticks. 

With this information, if we want a PWM of 1KHz and the clock frequency of our eMIOS is 48Mhz and we define the global prescaler and the internal prescaler equal to 1, with this we would only need one parameter to obtain our 1KHz signal, which is the period (ticks) which we can obtain by solving the formula given above:

Period = CORE_CLK/1KHz, giving 48000.

 

BR, VaneB

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,517件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @fengba_360 

EMIOS module setting in ConfigTools are named as Clock_Divider Value, Master_Bus Prescaler, and Master BusAlternate Prescaler. How to know their relationship and their usage? When Emios is used as PWM (OPWMB, OPWFMB, ...), it divides the CORE_CLK clock by the Clock Divider Value (global prescaler (MCR[GPRE] + 1)) and routes the resulting prescaled clock output to the Master Bus Prescaler (channel internal prescaler (Cn[UCPRE] + 1)). Thus channel internal counter counts (CORE_CLK/global prescaler/internal prescaler) clock.

For example: assuming the channel running in for example OPWFMB mode, its PWM frequency is calculated as: 

PWM frequency = CORE_CLK / global prescaler / internal prescaler / (B1+1)

Where B1 is the period ticks. 

With this information, if we want a PWM of 1KHz and the clock frequency of our eMIOS is 48Mhz and we define the global prescaler and the internal prescaler equal to 1, with this we would only need one parameter to obtain our 1KHz signal, which is the period (ticks) which we can obtain by solving the formula given above:

Period = CORE_CLK/1KHz, giving 48000.

 

BR, VaneB

0 件の賞賛
返信