Any way to vary the duty cycle in the runtime? And also LED Brightness?

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

Any way to vary the duty cycle in the runtime? And also LED Brightness?

跳至解决方案
732 次查看
Shrini
Contributor I

I want to vary the duty cycle in the run time. So that I can observe the pwm signal. And also want to change the LED brightness using potentiometer. Is it possible to do in the s32ds using s32k144 board? 

0 项奖励
1 解答
704 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @Shrini 

SDK: FTM_DRV_UpdatePwmChannel

RTD: Ftm_Pwm_Ip_UpdatePwmChannel

MCAL: Pwm_SetDutyCycle

在原帖中查看解决方案

0 项奖励
4 回复数
720 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @Shrini 

Yes, it is possible to change the duty cycle of a PWM. You need to change the value of the CnV register
FTM_->CONTROLS[channel].CnV= value;
I suggest you look at the included examples on the SDK/RTD or in the S32K1xx Series Cookbook.

 

B.R.

VaneB

0 项奖励
713 次查看
Shrini
Contributor I
Hello @VaneB, I am thinking to do this task using API's not in register level coding.
0 项奖励
705 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @Shrini 

SDK: FTM_DRV_UpdatePwmChannel

RTD: Ftm_Pwm_Ip_UpdatePwmChannel

MCAL: Pwm_SetDutyCycle

0 项奖励
696 次查看
Shrini
Contributor I
Thank you @VaneB
0 项奖励