Dear all,
I'm developing a 1 VS 4 BLE connection system, using 1 nRF52840 as BLE central and 4 nRF52832 as BLE peripherals.
I'm trying to send the same command to 4 peripherals, how to minimize the delay between each peripherals?
For now I'm using following statement to send BLE command:
for(uint8_t i=0; i<NRF_SDH_BLE_CENTRAL_LINK_COUNT; i++) { uint8_t retry = 0; do{ err_code = ble_nus_c_string_send(&m_ble_nus_c[i], &USB_cmd, 1); retry++; }while((err_code != NRF_SUCCESS) && (retry < 10)); }
And connection parameters are as follow:
- connection interval: 30ms
- scanning interval: 30ms
- scan window: 7.5ms
- gap_event_length: 7.5ms
To test the delay, I send a test command to each peripheral, and captured the time when receive the response. For time being, 4 responses are received in two transferring, delay is about 30ms. Seems like responses are transfered in two connection intervals.
Then I tried to decrease connection parameter further:
- connection interval: 20ms
- scanning interval: 20ms
- scan window: 5ms
- gap_event_length: 5ms
The connection become very unstable.
How do I suppose to optimize the latency between peripherals? Hopefully the peripherals could receive the command at the same time, or to say, less than 5ms latency?
Thx, Ava