how to pause pwm generation in runtime

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

how to pause pwm generation in runtime

ソリューションへジャンプ
1,236件の閲覧回数
gang_wang
Contributor II

Hi ,

 

I am using S32K144 to run my simulink model. I wonder how to pause PWM signal generation when keeping the program running. I try to set constant 0 as duty cycyle for ch0 in runtime, but pwm signals remain unchanged. Annotation 2021-04-26 163517.jpg

 

タグ(1)
0 件の賞賛
1 解決策
1,225件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @gang_wang,

The duty-cycle is probably not updated because of the C(n)V and C(n+1)V register synchronization (S32K1xx, RM rev13, Section 47.5.13.6)

There are other FTM features that can be used: Software Output Control Mode (Section 47.5.15), Output mask (Section 47.5.17).

But it also requires synchronization: Section 47.5.13.9 SWOCTRL register synchronization, Section 47.5.13.7 OUTMASK register synchronization.

Regarding MBDT, please post your questions in the MBDT community: https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/bd-p/mbdt

 

Regards,

Daniel

元の投稿で解決策を見る

0 件の賞賛
3 返答(返信)
1,169件の閲覧回数
mariuslucianand
NXP Employee
NXP Employee

Hello @gang_wang ,

If you need to stop the PWM generation you can use the FTM PWM Enable Disable block.

mariuslucianand_0-1620148402155.png

Please have a look at the ftm_three_phase_pwm_s32k14x example model delivered with S32K MBDT Toolbox.

Hope this helps,

Marius

0 件の賞賛
1,226件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @gang_wang,

The duty-cycle is probably not updated because of the C(n)V and C(n+1)V register synchronization (S32K1xx, RM rev13, Section 47.5.13.6)

There are other FTM features that can be used: Software Output Control Mode (Section 47.5.15), Output mask (Section 47.5.17).

But it also requires synchronization: Section 47.5.13.9 SWOCTRL register synchronization, Section 47.5.13.7 OUTMASK register synchronization.

Regarding MBDT, please post your questions in the MBDT community: https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/bd-p/mbdt

 

Regards,

Daniel

0 件の賞賛
1,211件の閲覧回数
gang_wang
Contributor II

hi @danielmartynek ,

 

Do i have to use S32DS IDE to flash the registers for applying changes from my simulink model on S32K144 LQFP100( so that i can pause pwm generation or apply changes on variable's value without rebuilding in simulink)? I find there's a module called freemaster serial driver could do this job. But the board doesn't support the code warrior which is needed in AN4752.PDF( FreeMASTER Usage
Serial driver implementation).

0 件の賞賛