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.
解決済! 解決策の投稿を見る。
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
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
Sorry, mixed up irq_JN516x.S. Corrected it and now it works.
Thanks again Mario.
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