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

Interrupt from timer2 at 0.5 ms using Softdevice

Hi,I have need to set TIMER2 interrupt at high priority because I need a interrupt at 0.5ms. This interrupt must comes while Softdevice is enable and my device(nrf51822 beacon) is connect with NRF51822 dongle.I set timer period right,and timer2 function ok if I dont't have another interrupts. I have tried with NVIC_SetPriority(TIMER2_IRQn, 1),but don't work.Interrup comes at 0.5 ms but sometimes comes at 2-3 ms. How can I fix that interrupt to come at 0.5ms?

Parents
  • I wonder how many times this question is going to be asked.

    You can't do accurately timed interrupts with the softdevice running. Look at the softdevice spec for the softdevice you're using (and which softdevice are you actually using, S110? which revision?)

    The softdevice is of higher priority while it's communicating over bluetooth. The latest softdevice processes for less time than the older ones, but they all will beat any user interrupt and the older softdevices also suspend the CPU. There are tables in the spec which show you for how long interrupts can be delayed. For the latest softdevice that's up to .5ms, for the older softdevice it's several milliseconds.

Reply
  • I wonder how many times this question is going to be asked.

    You can't do accurately timed interrupts with the softdevice running. Look at the softdevice spec for the softdevice you're using (and which softdevice are you actually using, S110? which revision?)

    The softdevice is of higher priority while it's communicating over bluetooth. The latest softdevice processes for less time than the older ones, but they all will beat any user interrupt and the older softdevices also suspend the CPU. There are tables in the spec which show you for how long interrupts can be delayed. For the latest softdevice that's up to .5ms, for the older softdevice it's several milliseconds.

Children
No Data
Related