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.
Solved! Go to Solution.
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
Hello @gang_wang ,
If you need to stop the PWM generation you can use the FTM PWM Enable Disable block.
Please have a look at the ftm_three_phase_pwm_s32k14x example model delivered with S32K MBDT Toolbox.
Hope this helps,
Marius
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
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).