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

S120 interrupt latency

We have an NRF51822 running S120 at 32MHz.

Our system has two removable batteries. If a battery is removed we need to switch to the other battery as fast as possible. We would like to do this in an interrupt service routine. ie detect battery fail signal and run a very brief ISR which just flips a GPIO to select the other battery. With the current power supply design that would need to happen in 70 usec. Without the soft device, or other interrupt disabling, I am confident we could do this within 20 usec.

From reading the S120 specification it seems there are times when interrupts are disabled, or otherwise locked out, for up to 1400usec.

Is there any way to "cheat" the system? We don't even worry if the BTLE stack falls over and has to be restarted.

For example, one thing I was thinking of was changing the radio priority etc to one level lower and run a pin change interrupt at the highest level. I fully realise this could cause instability, but we could restart the BTLE stack if one of these events occurs.

Parents
  • Hi Charles,

    I don't think we can do anything to reduce the 1400usec maximum latency.

    However, the idea of using the PPI is not a bad idea. You can use the PPI to connect the GPIO task with the event from the LPCOMP to detect the drop in the input voltage compare to a reference voltage. Please have a look at chapter 32 in the RM. But be aware that using PPI, GPIO task and LPCOMP will of course draw some extra current.

Reply
  • Hi Charles,

    I don't think we can do anything to reduce the 1400usec maximum latency.

    However, the idea of using the PPI is not a bad idea. You can use the PPI to connect the GPIO task with the event from the LPCOMP to detect the drop in the input voltage compare to a reference voltage. Please have a look at chapter 32 in the RM. But be aware that using PPI, GPIO task and LPCOMP will of course draw some extra current.

Children
No Data
Related