S32K116 FTM0_CH3 Output doesn't work

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

S32K116 FTM0_CH3 Output doesn't work

1,625 Views
lleviton
Contributor III

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.

Labels (2)
Tags (4)
4 Replies

1,427 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Larry,

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.

step1.png

setp2.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,427 Views
lleviton
Contributor III

Robin,

Problem resolved.

FTM_DRV_UpdatePwmChannel requires the hardware channel id.

Example:

//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.

1,427 Views
lleviton
Contributor III

Hi Robin,

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.

Should it?

Is there any way you can try it on a S32K116?

Larry Leviton

Sr. Embedded Software Engineer

Industrial Group – Arens Controls

Curtiss-Wright

3602 North Kennicott Ave., Arlington Heights, IL 60004

T: +1.847.844.4783

lleviton@curtisswright.com<mailto:lleviton@curtisswright.com> | www.cw-industrial.com<http://www.cw-industrial.com/>;

0 Kudos

1,427 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Larry,

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

Best Regards,

Robin

0 Kudos