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

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

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

ソリューションへジャンプ
1,331件の閲覧回数
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 件の賞賛
返信
1 解決策
1,317件の閲覧回数
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 件の賞賛
返信
3 返答(返信)
1,310件の閲覧回数
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,306件の閲覧回数
jacco_bezemer
Contributor III

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

Thanks again Mario.

1,318件の閲覧回数
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 件の賞賛
返信