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

Restarting timer inside its own IRQ

Hello all!

I have a timer that sometimes gets started inside the IRQ of the ESB and sometimes needs to be restarted inside its own IRQ

I'm running it in a "one shot" mode, so it stops after it interrupts, and then you need to use code to start it again.

This works fine when this is done inside the ESB IRQ. But when I try to configure it to interrupt again inside its own IRQ, it will interrupt again, but at the wrong time.

I'm trying to make it interrupt 200ms after it is started, but no matter what value I load into the CC register, it always interrupts after around 70ms-80ms

But I'm using the same function to configure it in both the ESB IRQ and in its own IRQ (the code is the same then), so the only thing that I can think of is that it's not recommended to configure a timer to interrupt again inside its own IRQ. Maybe this causes undefined behaviour?

Thank you so much!

Parents Reply Children
  • I switched to another instance of the timer and that worked! So the recommendation is that user code never uses TIMER_2 and TIMER_3 when also running the ESB?
    Thanks!

  • Another question:
    Is the TIMER3 only used for the esb stack in the NRF2832?
    Cause the only references to TIMER3 in the sdk are:

    // nRF52 address fix timer and PPI defines
    #define     NRF_ESB_PPI_BUGFIX1                 9
    #define     NRF_ESB_PPI_BUGFIX2                 8
    #define     NRF_ESB_PPI_BUGFIX3                 7
     
    #define     NRF_ESB_BUGFIX_TIMER                NRF_TIMER3
    #define     NRF_ESB_BUGFIX_TIMER_IRQn           TIMER3_IRQn
    #define     NRF_ESB_BUGFIX_TIMER_IRQHandler     TIMER3_IRQHandler
    #endif


    So it looks like its just used on the NRF2832 device as bugfix

Related