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?

ソリューションへジャンプ
728件の閲覧回数
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 解決策
700件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @Shrini 

SDK: FTM_DRV_UpdatePwmChannel

RTD: Ftm_Pwm_Ip_UpdatePwmChannel

MCAL: Pwm_SetDutyCycle

元の投稿で解決策を見る

0 件の賞賛
4 返答(返信)
716件の閲覧回数
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 件の賞賛
709件の閲覧回数
Shrini
Contributor I
Hello @VaneB, I am thinking to do this task using API's not in register level coding.
0 件の賞賛
701件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @Shrini 

SDK: FTM_DRV_UpdatePwmChannel

RTD: Ftm_Pwm_Ip_UpdatePwmChannel

MCAL: Pwm_SetDutyCycle

0 件の賞賛
692件の閲覧回数
Shrini
Contributor I
Thank you @VaneB
0 件の賞賛