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

SoftDevice Timers - Real-life Requirement(s) vs SoftDevice Spec

A quick question. I've made an App based on the peripherals not required by the SoftDevice, in particular s112 states RTC0 and TIMER0 are used.

I'm moving onto the Bluetooth side and I noticed in several nrf libraries there are additional? timer's being used. It looks like there's one timer per peer connection, though I'm struggling to navigate my way through the non existent code documentation.

Can anyone share some light?

  • The app_timer library actually only uses one RTC hardware timer. it is intended for use cases with timeouts in seconds or minutes.

    In your example the conn params are checked (and negotiated)  and if that fails it causes a disconnect after some time. This allows somewhat faster conn pars during connection setup (key exchange, discovery) and then you switch to low power (=long interval) after 30 sec or a minute.

  • So to confirm, the softdevice (s112) consumes one RTC and one TIMER internally (from datasheet) and the ble library blocks off another RTC for scheduling?

    My app requirements are currently one RTC and two timers for-

    RTC1 = 0.5s tasker runner
    TIMERB = ADC @ ~500Hz
    TIMERC = falling edge counter.

    RTC1 and TIMERC start at the same time and TIMERC stops counting by PPI event when RTC1 reaches it's compare point, so a fairly accurate frequency is determined (measuring upto 255Hz so pretty low).

    If the BLE is also taking up RTC1 then I'll have to look again at how do do it. I can see the scheduler library is being used, perhaps I should use that to start the ADC instead (accuracy isn't needed).






Related