Other than FTM0_CH0, I am unable to get any PWM output to work on the S32K116. Starting from example project ftm_pwm_s32k116 in S32K14x RTM SDK v3.0.0 Example Projects, I have used Processor Expert to change component pin_mux, FTM Channel 3 to use PTC3 as an Output. Using Processor Expert I have changed component flexTimer_prm1, PWM independent Configuration, Channel Hw Id from Channel 0 to Channel 3. As expected, the PWM signal on PTD15 (FTM Channel 0) stops working, but no PWM signal appears on PTC3. I am using S32 Design Studio for ARM - Version 2018.R.1 with Update 11 installed. PTD15 fine as a GPIO output, so its not a hardware problem.
I don't have S32K166, so test it on S32K144EVB-Q100.
After configure channel 3, and PTD1 as FTM0_CH3 output function.
I was able to observe the PWM waveform at PTD1 pin.
FTM_DRV_UpdatePwmChannel requires the hardware channel id.
//FTM_DRV_UpdatePwmChannel(INST_FLEXTIMER_PWM1, 0U, FTM_PWM_UPDATE_IN_DUTY_CYCLE, dutyCycle, 0U, true); /* old code */
hwChanId = flexTimer_pwm1_PwmConfig.pwmIndependentChannelConfig->hwChannelId;
FTM_DRV_UpdatePwmChannel(INST_FLEXTIMER_PWM1, hwChanId, FTM_PWM_UPDATE_IN_DUTY_CYCLE, dutyCycle, 0U, true); /* new code */
Thanks for your help.
So the S32K116 code works on the S32K144 processor.
Therefore it’s not a coding error.
I tried your example (using PTD1 instead of PTC2) on a S32K116 and PWM output does not work.
Is there any way you can try it on a S32K116?
Sr. Embedded Software Engineer
Industrial Group – Arens Controls
3602 North Kennicott Ave., Arlington Heights, IL 60004
firstname.lastname@example.org<mailto:email@example.com> | www.cw-industrial.com<http://www.cw-industrial.com/>;
For my test, I am using S32K144EVB-Q100 board with S32K144 project.
The screenshots of the S32K116 project are generated later so that you can refer to the modified location.
S32K116 code can not works on the S32K144 processor.
I have ordered the S32K116EVB-Q048 development board so that I can test it directly.
During debug, does the FTM counter increasing?
You can also check the value of FTM0_C3SC\ PORT_PCRn