Interrupt on PWM

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

Interrupt on PWM

1,478件の閲覧回数
bricesup
Contributor I

Hello,

I want to make an interrupt on my PWM signal i use this function :

vAHI_TimerEnable(E_AHI_TIMER_1,1,FALSE,TRUE,TRUE);

and my PWM is this :

vAHI_TimerStartRepeat(E_AHI_TIMER_1,PWM1,20000);

With a button I modify the variable PWM but for have a perfect signal I want to modify the PWM signal with the new time of low signal(0 Volt) when the actual signal is at 0 Volt. For that i detect the falling and I use this command :

vAHI_Timer1RegisterCallback(Timer1); 

PRIVATE void Timer1(uint32 u32DeviceId, uint32 u32ItemBitmap)
{
         vAHI_TimerStartRepeat(E_AHI_TIMER_1,PWM1,20000); //Repeat the PWM with a new PWM1 value

}

I think it's possible but nothing happen when I make that.

Thanks for your answers.

ラベル(1)
タグ(2)
0 件の賞賛
返信
1 返信

1,227件の閲覧回数
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi,

Did you configure the timer 1 and the output pin? Could you please check the output voltage?

You can take as a reference the next code. The JN-AN-11989 provides this example as a Dimmable Light

vAHI_TimerEnable(E_AHI_TIMER_0, 0, FALSE, FALSE, TRUE);
vAHI_TimerConfigureOutputs(E_AHI_TIMER_0, TRUE, TRUE); /* Invert PWM and disable gating */
vAHI_TimerClockSelect(E_AHI_TIMER_0, FALSE, TRUE);

Please let me know your findings.

Best Regards,

Mario

0 件の賞賛
返信