AnsweredAssumed Answered

USING INTERRUPT TIMER IN EXAMPLE JN-AN-1218-Zigbee-Light-Bulb

Question asked by Giau Nguyen on Apr 11, 2019
Latest reply on Apr 18, 2019 by Giau Nguyen

I working on JN-AN-1218-Zigbee_Light-Bulb application. I want to use interrupt timer (e.g Timer 0). My configuration is below.

/*Initiate timer */
// clock is 16MHz so the time period is 0.0625micro seconds
// we are using pre-scaler value of 8 so it will divide the
// clock by 2^8 = 256 hence multiplying the time period by 256
// so the timer clock will be 0.0625 * 256 = 16 ,micro sec
vAHI_TimerEnable(E_AHI_TIMER_0, 8, FALSE, TRUE, FALSE);
vAHI_TimerClockSelect(E_AHI_TIMER_0, FALSE, FALSE);
// Registering the callback function
vAHI_Timer0RegisterCallback(vTimer0ISR);
// Starting the timer for single shot
vAHI_TimerStartSingleShot(E_AHI_TIMER_0, 500, 500); // 16us *500 = 8000 us (8ms)

 

My callback function:

PUBLIC void vTimer0ISR(uint32 u32DeviceId, uint32 u32ItemBitmap) {
DBG_vPrintf(TRUE, "\n callback ISR ");
//rest code
}

 

It don't call callback function.

anything wrong?

For this configuration, if I run it on simple project (without OS and ZPS), it is OK.

Outcomes