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

Connection Interval

Hi everyone,

I'm new to working with Bluetooth/

My problem is that the connection interval time sent by the central device does not converge with the time I see using an oscilloscope or a configured timer for 1 ms.
The principle of operation of my program is that the peripheral device sleeps for a certain time and wakes up at a specified interval. The central device at this time is trying to connect to it. Using the timer, I count the time from when the device woke up to the time of the BLE_GAP_EVT_CONNECTED event and to the time of the BLE_GAP_EVT_CONN_PARAM_UPDATE event. The time difference between these events is about 600 ms. I can not understand why such a difference in time. Maybe I did not correctly understand the meaning of the parameters MIN_CONN_INTERVAL and MAX_CONN_INTERVAL? If so, then how can you reduce the time for a full connection, so that the BLE_GAP_EVT_CONN_PARAM_UPDATE event occurs as soon as possible.

To check what the actual value is transmitted by the central device, you can make a breakpoint during the execution of the program at the time of the BLE_GAP_EVT_CONN_PARAM_UPDATE event, which I actually did.

According to the received data, the central device set the value of the maximum and minimum interval of 7.5 ms.In the peripheral device, I have the following parameters:

MIN_CONN_INTERVAL    MSEC_TO_UNITS (7.5, UNIT_1_25_MS)

MAX_CONN_INTERVAL   MSEC_TO_UNITS (30, UNIT_1_25_MS)

SLAVE_LATENCY            1

CONN_SUP_TIMEOUT   MSEC_TO_UNITS (250, UNIT_10_MS)

I also read that the connection interval can vary from 7.5 ms to 4 s, maybe this value is the connection interval for my central device?

Chip: BT840F (analog nRF52840);

SDK: nRF5_SDK_15.2.0;

Softdevice: s132_nrf52_6.1.0_softdevice;

Phone: Xiaomi Redmi 5+.

Thanks in advance for your help.

  • The Central is not obliged to use the settings you request - it tells you what settings it has actually made.

    Specifically with things like phones, tablets, etc, they impose their own limits on what settings they will give.

    This can vary from device-to-device - and can even be different from one session to another on the same device!

  • I understand it.
    The figure above just shows that the central device has set 7.5 ms.
    My question is this. Judging by the description here, the connection interval is the time between events in the connection between devices. In my program, the connection interval in the BLE_GAP_EVT_CONNECTED event is 49 ms, does this mean that the BLE_GAP_EVT_CONN_PARAM_UPDATE event will occur after this time interval?

  • Hi

    As stated in the case you linked to, "BLE devices agree on this interval at the start of the connection". So the BLE_GAP_EVT_CONN_PARAM_UPDATE event occurs at the start of the connection, if the central chooses to use your requested settings.

    Best regards,

    Simon

  • I will change the question a little. I do not know whether this is due to the connection interval or not.
    When the central and peripheral devices are connected, we first get to the BLE_GAP_EVT_CONNECTED event, then go to the BLE_GAP_EVT_CONN_PARAM_UPDATE event. So, in my case, the transition time between these events averages 600 ms. The question is: what does this time depend on, is it possible to reduce it and how?

  • Hi

    These 600ms seems to be your service discovery of the peripheral, which takes time depending on how much data you are transferring upon connection. If you want to reduce this as much as possible you could always set you MAX_CONN_INTERVAL to 7.5ms as well, to ensure the connection interval is as low as possible. Also have you at all touched the FIRST_CONN_PARAMS_UPDATE_DELAY variable? I think this is set to 5s but, you can check it to ensure that it isn't a part of the 600ms you want to slim down.

    Also if you are a bit more specific in describing what you want the application to do, it would be easier to give you exact advice.

    Best regards,

    Simon

Related