AnsweredAssumed Answered

Problems with callback for timer Jn5169

Question asked by dostshah on Sep 18, 2017
Latest reply on Sep 21, 2017 by David Ashraf

I am trying to use Timer3 on JN5169 with a callback on falling edge.

 

The clock source is the main clock source and I am configuring it with a pre-scaler value of 8. PWM output is disabled.

// 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_3,
                             8,// pre-scaler
                         FALSE, // disable interupt on rising edge
                         TRUE,  // enable falling edge interupt
                         FALSE); //no output on pin


vAHI_TimerClockSelect(E_AHI_TIMER_3,
                               FALSE,    //use internal 16MHz clock
                               FALSE);   //for PWM only


// Registering the callback function

vAHI_Timer3RegisterCallback(vTimer3ISR);



// Starting the timer for single shot
uint16 timePeriod = 500;  // 16us *500 = 8000 us (8ms)

vAHI_TimerStartSingleShot(E_AHI_TIMER_3, 78, timePeriod);


 

Here is the interrupt callback function.

 

PRIVATE void vTimer3ISR(uint32 u32DeviceId, uint32 u32ItemBitmap) {
     DBG_vPrintf(TRUE, "\n callback ISR ");
// rest of the code

}

 

The problem here is that the callback never happens.

 

It's worth mentioning that I am working with the DimmableLight implementation of the sample provided in ZigbeeHADemo  GitHub - jdeltoft/NXP-Home-Automation 

Outcomes