Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

using app_timer_cnt_get() inside uart_fifo interrupt?

I developing applciation based on nrf51822, sdk11. I have read several posts about using app_timer_cnt_get() and get only 0 value. As far as I understand, this is because the RTC1 has LOW_APP priority therefore it can not use inside other interrupt which has higher priority. How to fix this problem since I really need to measure time that the fifo_uart interrupt used? 

Parents
  • No your understanding is entirely incorrect. app_timer_cnt_get() doesn't use an interrupt and you can call it from absolutely anywhere you like. If you just look at the code you can see it just reads the register directly. 

    So if you are receiving 0 every time then either you have a code bug or the timer's not actually running. 

Reply
  • No your understanding is entirely incorrect. app_timer_cnt_get() doesn't use an interrupt and you can call it from absolutely anywhere you like. If you just look at the code you can see it just reads the register directly. 

    So if you are receiving 0 every time then either you have a code bug or the timer's not actually running. 

Children
Related