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

How to know when radio is active without interrupts

Hi,

I'm using the nrf52 and in my application I need to sample a sensor after applying an IR pulse; the pulse length influences the sampling thus cannot be disturbed by the radio.

I know there is the "radio notification" feature that informs the application when the radio will be active, but this is done through an interrupt and from my tests the interrupt will eventually disturb the IR pulse.

My question is, there is another method to know when the radio is active without using the interrupts (e.g. polling some register, workarounds, ...)?

Thank you.

  • Hi Stefano,

    Is there any timing requirement for the IR pulse ? Like it has to be executed at a specific time ?

    If not, you can either use the radio notification to set a flag. And in the mainloop or in the scheduler you can check the flag if it telling that the radio is switched from active from inactive, then you know that you have sometime to do IR pulse before the radio is active again. Or you can use the timeslot API to request the Softdevice to give the application a timeslot that there will be no Radio activity in that period.

  • Hi,

    actually the pulse has to be done at 30 Hz, as much precise as possible.

    As I said I tried with radio notifications, but the problem is that the interrupt could happen in the middle of the pulse, thus making the pulse longer with a consequently "outlier" sampled value.

    Now I implemented the timeslot API, but I get a jitter of about 3-4 ms when the timeslot cannot be given and this is a bit too much but I would accept this solution at the moment.

    Anyway if someone has some better solution it is welcome.

    Thanks.

Related