Timer0 Output JN5169

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

Timer0 Output JN5169

965 次查看
huy_phamhuu_hus
Contributor I

Hello,

I am making an application using the output of timer 0 (DIO4/DIO10) in JN5169. But It is not working(No Output, No Interrupts). The others timer output(timer1,2,3,4) are okay.  Can you help me find the problem with timer 0 configuration bellow?

vAHI_TimerSetLocation(E_AHI_TIMER_0, TRUE, FALSE);
vAHI_TimerDIOControl(E_AHI_TIMER_0, TRUE);
vAHI_TimerConfigureOutputs(E_AHI_TIMER_0, FALSE, TRUE);
vAHI_TimerEnable(E_AHI_TIMER_0, 10, TRUE, TRUE, TRUE);
vAHI_TimerClockSelect(E_AHI_TIMER_0, FALSE, FALSE);

vAHI_TimerStartRepeat(E_AHI_TIMER_0, 15625, 31250);

Thanks for your help!

Huy

标签 (1)
0 项奖励
回复
1 回复

814 次查看
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hello Huy, I hope you're doing well!

 

To get an output in the alternative pins for timer 0, you need to execute at least these following instructions (but first you need to enable the timer you'll want to work with, by using the vAHI_TimerEnable function):

 

vAHI_TimerEnable(E_AHI_TIMER_0, 10, FALSE, FALSE, TRUE);
vAHI_TimerConfigureOutputs(E_AHI_TIMER_0, FALSE, TRUE);
vAHI_TimerSetLocation(E_AHI_TIMER_0, TRUE, FALSE);
 
vAHI_TimerStartRepeat(E_AHI_TIMER_0, 15625, 31250);

 

By using these functions, you'll get a PWM output from DIO pin 4.

 

To get an interrupt from timer 0, you first need to register it's callback function (by using the vAHI_Timer0RegisterCallback function) and enable interrupt on a certain condition (by changing the corresponding value in the vAHI_TimerEnable function).

You can read more information about these functions in the JN516x Integrated Peripherals API User Guide, here.

 

Best regards,

Sebastian

0 项奖励
回复