Which timer to use for microsecond timings in JN-AN-1218-Zigbee-3-0-Light-Bulb based project

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

Which timer to use for microsecond timings in JN-AN-1218-Zigbee-3-0-Light-Bulb based project

Jump to solution
1,329 Views
jacco_bezemer
Contributor III

I'm converting a project based on JN-AN-1171 to a project based on JN-AN-1218.

The project that i'm converting uses OS_eStartSWTimer to start a task every 78 microseconds. What timer can i use in a Zigbee 3 project?

I tried vAHI_TickTimerConfigure but it messes with the Driver_bulb timings. I can't use ZTIMER because it uses milliseconds.

0 Kudos
Reply
1 Solution
1,315 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @jacco_bezemer,

You could use the next timer, but I do not know the requirements that you have

vAHI_TimerEnable

Please look at the next setup

PUBLIC void TMR_vInit(void)
{

 /* Make sure no DIO claimed by timer */
 vAHI_TimerDIOControl(E_AHI_TIMER_0, FALSE);

 /*Enable the Timer0*/
 vAHI_TimerEnable( E_AHI_TIMER_0,
 8, //uint8 u8Prescale,
 TRUE, //enable interupt on rising edge
 TRUE, //enable interupt on falling edge
 FALSE); //bool_t bOutputEnable);

 // Registering the callback function
 vAHI_Timer0RegisterCallback(APP_isrTimer0);

 vAHI_TimerStartRepeat( E_AHI_TIMER_0, //uint8 u8Timer,
 312, //uint16 u16Lo,
 625); //uint16 u16HI
}

 

In this code, the timer 0 interrupt is generated but not call this function at every 10ms, and also in the callback must clear the interrupt flag.

(void) u8AHI_TimerFired(E_AHI_TIMER_0);

Please let me know if you have any other questions.

Regards,

Mario

View solution in original post

0 Kudos
Reply
3 Replies
1,308 Views
jacco_bezemer
Contributor III

Hi Mario, that makes sense.

I can see that the timer is running but no interrupt is generated. Should i change something else?

And i don't understand this sentence "the timer 0 interrupt is generated but not call this function at every 10ms"

Kind regards,

Jacco

1,304 Views
jacco_bezemer
Contributor III

Sorry, mixed up irq_JN516x.S. Corrected it and now it works.

Thanks again Mario.

1,316 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @jacco_bezemer,

You could use the next timer, but I do not know the requirements that you have

vAHI_TimerEnable

Please look at the next setup

PUBLIC void TMR_vInit(void)
{

 /* Make sure no DIO claimed by timer */
 vAHI_TimerDIOControl(E_AHI_TIMER_0, FALSE);

 /*Enable the Timer0*/
 vAHI_TimerEnable( E_AHI_TIMER_0,
 8, //uint8 u8Prescale,
 TRUE, //enable interupt on rising edge
 TRUE, //enable interupt on falling edge
 FALSE); //bool_t bOutputEnable);

 // Registering the callback function
 vAHI_Timer0RegisterCallback(APP_isrTimer0);

 vAHI_TimerStartRepeat( E_AHI_TIMER_0, //uint8 u8Timer,
 312, //uint16 u16Lo,
 625); //uint16 u16HI
}

 

In this code, the timer 0 interrupt is generated but not call this function at every 10ms, and also in the callback must clear the interrupt flag.

(void) u8AHI_TimerFired(E_AHI_TIMER_0);

Please let me know if you have any other questions.

Regards,

Mario

0 Kudos
Reply