how to pause pwm generation in runtime

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to pause pwm generation in runtime

Jump to solution
1,163 Views
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

 

Tags (1)
0 Kudos
1 Solution
1,152 Views
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

View solution in original post

0 Kudos
3 Replies
1,096 Views
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 Kudos
1,153 Views
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 Kudos
1,138 Views
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 Kudos