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

The achievable shortest CPU blocking time and longest interval while being detectable by other BLE devices

Assuming the system is composed of one device using nRF51822 and iPhone/PC, If we want nRF51822 detectable by iPhone/PC so that iPhone/PC can connect nRF51822 when they want, how short CPU blocking time and how long interval between two blocking time can we achieve?

Thanks!

  • Maybe the exact number can't be said easily. But these should be related to a few certain parameters and how these parameters affect should be describable. So, the estimation should be possible. I read <S110_SoftDevice_Specification v1.1.pdf>, <nRF51 Reference Manual> and posts in the Developer Zone. There were a few useful information, ex. the post "https://devzone.nordicsemi.com/index.php/adc-softdevice-sample-rate-on-nrf51822#reply-1791&quot;. But I haven't figure it out. Hope somebody can help on this question.

  • The CPU will be blocked for each radio event, either an advertising event or a connection event. These happen with user configurable intervals, advertising events every advertising interval and connection events every connection interval. The advertising interval will determine how fast it is possible to create a connection, while the connection interval will set a limit for maximum throughput.

    The length of an advertising interval will be dependent on the size of the advertisement packet, and whether or not someone sends a scan request, which will be responded to with a scan response. The minimum time should be around 2 ms.

    The length of a connection interval will be dependent on the data transmitted and the accuracy of low frequency crystal on both Central and Peripheral. If no data is transmitted and 20 ppm crystals are used, the time for a connection event should be a little less than 1 ms.

    Edit: Logic analyzer screenshots added, for code that does a continuous GPIO toggle in the main loop, thereby essentially showing the blocking time. Advertising data is ~28 B, no data transmitted in the connection event. Time to run between advertising channels is ~0.2 ms, blocking time ~0.8 ms. Block in prepare is ~0.1 ms, block time last channel ~1 ms.

    Connection interval is 500 ms, Central device is Master Control Panel. Main blocking is ~1 ms, prepare is ~0.1 ms.

    Please note that this should be considered experimental data and not specification, just an example of how this can work in a specific application.

    advertising_event.png

    connected-event.png

  • Hi Ole, Do you mean the minimum time of "advertising event" (blocking-CPU time) is around 2 ms?

  • Yes, for an advertising event, the minimum blocking time will be about 2 ms with current softdevice version. You will however be allowed to run for a short period in between channels.

  • Thanks, Ole. You gave very clear answer to the posted question.

    I have a few further detailed questions. Hope you can help. "You will however be allowed to run for a short period in between channels." Q1: Do you know how long these short periods are usually? Q2: If these short periods are considered, how long can the minimu blocking time be? Can they be consistent?

    In further detailed, if it help to express the questions more clearly...... If I understand correctly, there are three channels for advertising - ch37, 38 and 39.

    • In each advertising event (let's say it's always the minimum 2ms), is the duration distribution always the same - ch37 -> short_period1 -> ch38 -> short_period2 -> ch39?
    • are the durations of ch37, 38 and 39 the same? and how long are they?
    • Is short_period1 equal to short_period2? and how long are they?
Related