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

App timer high current consumption

I have a need for an interrupt to go off at a 4khz rate. For this, I am using a repeated App Timer (running off the 32k crystal).

Prior to adding this extra timer, we used to have a power consumption of about 60ua. If I enable the timer to run at 4khz (and do nothing at all within the interrupt handler), power consumption goes up significantly - ~1.3ma. Is there any obvious reason why this happens?

I am setting up the app timers in the same way as the other 5 timers used in the project (which work with the low 60ua current consumption). With a couple of mods (to toggle a pin within the interrupt routine), we have checked on an oscilloscope, and the interrupt appears to be serviced very quickly.

I am currently using Softdevice v3.0.0, NRF52832, SDK version 12.2.

Parents
  • The question that comes to mind is, "what was the period of your other app timers?" 4kHz is pretty fast for an interrupt rate. Every time the interrupt happens the processor has a lot of work to do even if nothing is in the handler. Also, since this pulls it out of power manage main runs until it starts power manage again. So you could have a lot of code running in main.

    You should be careful trying to have so many ISR's with the SD running. Unless you use timeslotting there is no coordination between the SD and your code so your ISR's will occasionally be delayed and queued.

    If your 4kHz is just toggling gpio or causing a comms task to run that has DMA then instead use ppi/gpiote to trigger the task and keep it out of code.

Reply
  • The question that comes to mind is, "what was the period of your other app timers?" 4kHz is pretty fast for an interrupt rate. Every time the interrupt happens the processor has a lot of work to do even if nothing is in the handler. Also, since this pulls it out of power manage main runs until it starts power manage again. So you could have a lot of code running in main.

    You should be careful trying to have so many ISR's with the SD running. Unless you use timeslotting there is no coordination between the SD and your code so your ISR's will occasionally be delayed and queued.

    If your 4kHz is just toggling gpio or causing a comms task to run that has DMA then instead use ppi/gpiote to trigger the task and keep it out of code.

Children
No Data
Related