Relate to :
https://community.nxp.com/message/943998
https://community.nxp.com/message/1138312
For test timer, I have added function App_vInitTimer0();
Add the service interrupt in theIn the irq_JN516x.S:
.byte 5 # timer0 priority
.word vTimer0ISR # 5
It does not call callback function.
anything wrong? Please let me know!
Thanks
Hi Tran,
Could you please try the code below?
/* Make sure no DIO claimed by timer */
vAHI_TimerDIOControl(E_AHI_TIMER_0, FALSE);
vAHI_Timer0RegisterCallback(APP_isrTimer0);
vAHI_TimerEnable(E_AHI_TIMER_0, 8, TRUE, TRUE, FALSE);
vAHI_TimerConfigureOutputs(E_AHI_TIMER_0,FALSE,TRUE);
vAHI_TimerStartRepeat(E_AHI_TIMER_0, 350,700);
Hope it helps,
Regards,
Mario
Thanks for reply
It is my mistake when config timer0 in irq_JN516x.S
It work well :smileygrin:
Dear Mario Ignacio Castaneda Lopez
How to caculate timer to call irsTimer?
as i know: time delay = 700 * 16us = 4.2 ms.
for ex: I want delay 1s , 10s , 1h
Thanks
Hi Tran,
For example, if you want 10 ms for the interrupt,
Timer clock frequency = Source clock frequency / 2u8Prescale
The clock is 16MHz so the time period is 0.0625micro seconds
Pre-escaler= 8
Clock by 2^8 = 256 hence multiplying the time period by 256
Timer clock will be 0.0625 * 256 = 16us
Time High =(10ms/16us)=625
vAHI_TimerStartRepeat(E_AHI_TIMER_0, 312,625);
For a better reference, please look at the JN516x Integrated Peripherals API User Guide
Regards,
Mario
Many thanks!
It help a lot. Have nice day :smileygrin: