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

APP High interrupt latency

Hi,

I have application where I drive LEDs with shift registers. I need to send 14 bytes via SPI every 200us while I am in BLE connection. Timing should be exact as shift reg STROBE signal is taking place every 200us. I think to use Timer1 to generate STROBE signal on pin and also call Timer compare interrupt with app_high_priority. Inside this interrupt I want to send new 14byte packet and return back to main and wait for next Compare interrupt. So data could be sent anywhere between those STROBE signals (data send timing is not so critical), but finished until incoming STROBE. My question: Can softdevice corrupt my data if I am not actively doing any BLE data transactions, just keeping connection? Can I somehow forward my short interrupt routine (max 50us) to softdevice to achieve highest priority or at least determine when BLE lower stack interrupt is coming that I can synchronise?

Some thoughts: It would be nice to have highest priority interrupts at least for short durations. Because hey, interrupts are made to do tasks fast and soon and more important at determined intervals. If they do not have those properties, then what they are good for? As I read SD specification it seems that BLE lower stack interrupts can occur anytime anywhere and suspend my operations. I doubt that lets say 50us app interrupt could harm BLE protocol. Think of that. :)

  • As specified in the S110 SDS, BLE connection event blocks the CPU from approximately 1ms-6ms, depending on the number of packets sent in each connection event. Even though you are not sending any payload data, BLE protocol will send empty packets to maintain the connection. A BLE connection event with no payload data will still block the CPU for ~800us.

    The above is true for the second revision nRF51 hardware. For the Third revision hardware and S110 v7.1.0, shorter blocking time is possible. How to unblock the CPU and enable the short CPU time is described on this thead. To identify the nRF51 hardware revision is described on this thread. This thread might also be helpful.

    There will soon be released a new S110 SDS which will specify the CPU blocking times for 3rd revision nRF51 hardware.

    To know when BLE advertising/connection events take place, there are some pointers on this thread.

Related