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

Fixed and repeatable latency in BLE

Hi,

Our setup includes two devices, a central and peripheral. For both devices, nRF52840 is used.

We are working with nRF5 SDK version 16.0.

In our application, the central device sends a specific command, which needs to arrive in a fixed latency, with a variance of +/- 1ms,

to the peripheral device.

The latency should be fixed amongst different central-peripheral pairs and power-ups.

1. Are such latency requirements feasible using BLE 5, nRF52840, and nRF5 SDK?

2. What are the recommended BLE connection parameters, which will bring us to a deterministic latency as possible?

We are using a 20byte payload packet for the transmitted command currently (this can be changed).

3. Also, a SW method, which will enable us to measure the time between command-send from the central device, and command-received by the peripheral device, is

a good solution - providing the measurement is with +/- 1ms accuracy 

Thank you,

Parents
  • Hi,

    When you send data from your application code, it will be queued by the SoftDevice, and then (usually) sent in the next connection event. A new connection event happens every connection interval. This means that the time from when you queue the packet on the central-side, until it will be received by the peer depends on the time the packet was queued in relation to when the next connection event starts.

    Note that even if you are only sending a single command with 20 byte payload, it’s not 100% guaranteed to be received by the peer in the next connection event. Due to interference, packets can be lost, and would need to be resent in the next connection event.

    Also note that if you are sending a lot of data, and depending on e.g. how the GAP event length is configured, what connection interval is used, etc, you might not be able to send all the data in the next connection event, and you might need several connection events to send all the data.

  • Hi,

    If I understand correctly, configuring both minimum and maximum connection intervals to 7.5ms, for example, will result in latency between 0 to 7.5ms - right? 

    Is there a way to measure the time a specific packet is queued by the SoftDevice, till it is actually sent?

Reply Children
Related