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

Interrupt when ACI data event available

Hi, I have an nRF8001 on a Red Bear Lab BLE shield mounted on an Arduino Uno. I'm using BLE to trigger the execution of potentially long running (well, a few seconds anyway) sequences of LED light patterns in, for example, nested for loops in my Arduino sketch.

I'd like to be able to respond immediately to new BLE data events, even when an LED sequence is running, so I can immediately change the pattern. As things stand, the for loops block retrieval of ACI events from my ACI event loop and I was hoping I could somehow use interrupts. For example maybe I can have an interrupt signalled when a BLE data event is available and in my interrupt handler I can then set a variable which means "exit current operation" so that control can return to my ACI event loop.

Is this possible and if so how should I approach this?

Thank you

Parents
  • Hi,

    I maybe not the best to answer question on nRF8001 and Arduino. But as far as I know, the nRF8001 has the RDYN pin to interrupt the MCU when it has data want to transmit (events), it's mentioned here :

    "If BLE Shield has data to transmit to master, it will put the RDYN to low to indicate master, even though master havn't requested data and REQN is idle. If master detectes a low level condition on RDYN, it will put REQN to low and generate the clock to read out the data.After reading out the data, both REQN and RDYN will be put to high.Note that REQN is controlled by master while RDYN is controlled by BLE Shield."

    Most likely you will have an interrupt when there is a write event from the central device.

Reply
  • Hi,

    I maybe not the best to answer question on nRF8001 and Arduino. But as far as I know, the nRF8001 has the RDYN pin to interrupt the MCU when it has data want to transmit (events), it's mentioned here :

    "If BLE Shield has data to transmit to master, it will put the RDYN to low to indicate master, even though master havn't requested data and REQN is idle. If master detectes a low level condition on RDYN, it will put REQN to low and generate the clock to read out the data.After reading out the data, both REQN and RDYN will be put to high.Note that REQN is controlled by master while RDYN is controlled by BLE Shield."

    Most likely you will have an interrupt when there is a write event from the central device.

Children
Related