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!

Parents
  • 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

Reply
  • 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

Children
  • 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?
  • Hi Ole, I have one more question:) I saw "Table 14 Radio Notification timing ranges" in <S110_SoftDevice_Specification v1.1.pdf>. t_evnt is: 550 to 1300us Advertiser - 0 to 31 bytes payload, 3 channels). P is: <=150 us. According to this, for an advertising event, the blocking time can be P+t_event: 700us ~1450us. The minimum 700us is less than 2ms. Does your 2ms count a scan response in? or I have some misunderstanding here? Thanks.

  • Please take a look at the screenshots I added to my answer here. 550 µs is the time for one channel, my 2 ms is total time over all channels, excluding the time you get to run in between.

    If you need specific data on this, I'd recommend you to do a similar test to the one I did, just making a GPIO toggle in main and capture the pin with a logic analyzer.

    The sequence will always be 37, 38, 39.

Related