Setoffsetticks() function

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Setoffsetticks() function

ソリューションへジャンプ
1,127件の閲覧回数
alissonporto
Contributor III

I'm trying to use a timer do dim the RGB Led. I have configured the timer TU1, but the function Setoffsetticks() doesn't work.I know the counter is working because if I change the offset parameter in the initial configuration, the LED becomes more or less bright. help3.PNG.png

Could someone please help me?

ラベル(1)
0 件の賞賛
返信
1 解決策
896件の閲覧回数
marek_neuzil
NXP Employee
NXP Employee

Hello,

If you want to dim a LED (or an RGB LED) you must change duty of the signal (the change of signal frequency with the same duty will not have any effect). Therefore I recommend that you should use the PWM (or PWM_LDD component) to dim the LED. This component also use timer module but it allows runtime changing of the signal duty (use one of the SetDutyXXXXX or SetRatioXX methods).If you want to drive an RGB LED you can add three PWM components into your project and share the same FTM device (three channels of a FTM device). You must select three channels of the same FTM device in each PWM component and set the same period of the signal. Duty can be driven independently for each channel.

PWM_RGB_LED.png


You can also find additional details about PWM on the page http://mcuoneclipse.com/2013/03/16/pwm-for-processor-expert-explained/

Best Regards,

Marek Neuzil

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
897件の閲覧回数
marek_neuzil
NXP Employee
NXP Employee

Hello,

If you want to dim a LED (or an RGB LED) you must change duty of the signal (the change of signal frequency with the same duty will not have any effect). Therefore I recommend that you should use the PWM (or PWM_LDD component) to dim the LED. This component also use timer module but it allows runtime changing of the signal duty (use one of the SetDutyXXXXX or SetRatioXX methods).If you want to drive an RGB LED you can add three PWM components into your project and share the same FTM device (three channels of a FTM device). You must select three channels of the same FTM device in each PWM component and set the same period of the signal. Duty can be driven independently for each channel.

PWM_RGB_LED.png


You can also find additional details about PWM on the page http://mcuoneclipse.com/2013/03/16/pwm-for-processor-expert-explained/

Best Regards,

Marek Neuzil

0 件の賞賛
返信