how to pause pwm generation in runtime

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

how to pause pwm generation in runtime

跳至解决方案
1,254 次查看
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,243 次查看
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,187 次查看
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,244 次查看
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,229 次查看
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 项奖励