Timer0 Output JN5169

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Timer0 Output JN5169

645 Views
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

Labels (1)
0 Kudos
1 Reply

494 Views
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 Kudos