This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Global Clock on nRF51822?

Seems like the timer API uses low priority interrupts. Now, I dont need the timer triggers to be exactly delivered so that is fine ... however, i do need to know the exact time between current and last timer trigger. Is there a way to query a clock tick counter or some kind of global counter which i can use to calculate the time elapsed between timer events?

Thanks!

Parents
  • Hi,

    Are you going to use a timer to track time? Like having a variable that shows minutes/seconds/ms/etc?

    If you use the app_timer library, you can setup functions that are called every x millisecond. Using this you can setup a global variable that is incremented (in the app_timer callback function) each time it's called.

    Best regards Håkon

  • Hmm, not really, its for an integration of a gyroscope signal. I do 100 samples / millisecond so looking for something on the order of microseconds if possible.

    The problem i see is that, if say the app_timer interrupt was pushed back due to a high priority interrupt (like BLE stack) it would cause delayed calls to the timer interrupt handler.

Reply
  • Hmm, not really, its for an integration of a gyroscope signal. I do 100 samples / millisecond so looking for something on the order of microseconds if possible.

    The problem i see is that, if say the app_timer interrupt was pushed back due to a high priority interrupt (like BLE stack) it would cause delayed calls to the timer interrupt handler.

Children
No Data