This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Maximizing BLE Throughput Using CC2541 and ADS1299

Other Parts Discussed in Thread: CC2541, ADS1299

Hi,

I am attempting to interface a CC2541 with the ADS1299 module, and I'd like to maximize the bandwidth I can achieve using the CC2541 BLE software stack V1.4 in order to achieve higher sample rates. I am using an iPhone 6 running iOS 8.1.2 to connect to my device. In my current configuration, my data packet consists of

(6 channels x 3 bytes per channel) + (1 byte timestamp) = 19 bytes

I use the osal_GetSystemClock() function to get the time in ms and send this as the timestamp byte. 

Using the OSAL timer, I sample the ADS1299 every 10 ms and update the data characteristic, which has notifications enabled. With the iOS default connection interval of 30 ms, I can reliably achieve 3 notifications per connection event.

This results in successfully sampling 6 channels at 1 / (10 ms) = 100 Hz, and streaming data at (19 bytes / 10 ms) = 1900 bytes/second. 

If possible, I would like to increase my sampling rate to 200 or 400 Hz. Specs and literature I've found online suggest that I am not reaching the full potential of my data bandwidth for BLE. For example, the forum post below indicates that I should be able to achieve 4 notifications per connection event. However, when I decrease my sampling period to 7 ms or 6 ms, the BLE Packet Sniffer shows I am still only getting 3 notifications per connection event (in addition to sample times which are not consistently 6 or 7 ms apart). 

e2e.ti.com/.../194407

Using connection update requests, I have been able to decrease the connection interval to 20 ms or even 18.75 ms (though not reliably). However, at these lower connection intervals and while keeping my sampling period the same (10 ms), I find that the samples are not reliably 10 ms apart. This makes me wonder whether expiration of the 10 ms timer and sampling of the ADS1299 is overlapping with other processes running on the CC2541 (e.g., BLE connection processes, etc.). 

For my particular project, I have a constraint on the time between samples. Once the data has been sent over BLE, I am applying digital filters to the data, which requires data sampled at constant intervals. Increasing throughput with varying time between samples (e.g., sometimes 10 ms then 11 ms or 9 ms) would not be useful for my particular application. 

Any help would be greatly appreciated. I would just like to know whether or not I have reached the limit of BLE or whether I can make any improvements to increase my sample rate. 

Thank you!

  • Hi,

    First of all you can reduce your connection interval to minimum value of 7.5ms. Along with that, enable update parameter request using GAPRole_SetParameter( GAPROLE_PARAM_UPDATE_ENABLE, size, TRUE );

    Also, to achieve better throughput you need to enable overlapped processing. That you can do --
    LL_EXT_OverlappedProcessing(LL_EXT_ENABLE_OVERLAPPED_PROCESSING);
    HCI_EXT_OverlappedProcessingCmd(HCI_EXT_ENABLE_OVERLAPPED_PROCESSING);

    Hope this helps!!

    Thanks,
    Dhaval

    Note : If this has answered your question and/or helps to resolve your problem, you may want consider to click Verify Answer.
  • Thank you so much Dhaval!

    Overlapped processing did indeed help significantly. I did a little more research based upon your reply and came upon this wiki page:

    processors.wiki.ti.com/.../OverlappedProcessing

    Upon first implementing your suggested commands, it did not noticeably increase my sample rate. However, after adding the command suggested on the wiki:

    HCI_EXT_HaltDuringRfCmd(HCI_EXT_HALT_DURING_RF_DISABLE);

    it seems that the CPU is no longer halted during Rx/Tx operations. This allowed me to double my sampling period to 5 ms. I have tried reducing it to 4 ms and lower, and while I do get more total throughput, I do not reliably see all data packets coming in at these speeds. In total, I now have the following four commands related to overlapped processing. Any suggestions on changes or how to implement them better are welcome.

    HCI_EXT_HaltDuringRfCmd(HCI_EXT_HALT_DURING_RF_DISABLE);
    HCI_EXT_OverlappedProcessingCmd(HCI_EXT_ENABLE_OVERLAPPED_PROCESSING);
    HCI_EXT_NumComplPktsLimitCmd(HCI_MAX_NUM_DATA_BUFFERS, HCI_EXT_ENABLE_NUM_COMPL_PKTS_ON_EVENT);
    LL_EXT_OverlappedProcessing(LL_EXT_ENABLE_OVERLAPPED_PROCESSING);

    I would also note that while the BLE spec does indicate 7.5 ms connection intervals are permitted, iOS guidelines are more conservative. The iOS guidelines indicate that the update request needs to have a minimum connection interval >= 20 ms. I have, however, successfully achieved faster connection intervals using the parameters min = 10 ms and max = 20 ms. These faster connection intervals definitely help increase my throughput, though I am not sure these settings will be supported in future iOS software updates.