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

[Doubt] Accurate sampling with softdevice and ble_app_uart

Hello everyone.

I have been working on a project that involves DSP and BLE on nRF52832.

The firmware needs to sample an accelerometer signal every 1ms with high accuracy and having a total of 1024 samples. After the signal is sampled I perform a fft of the sampled signal. I would like to send the fft data series using a way like ble_app_uart example code.

I have tried the Timer interrupt, sampling process and ARM FFT without Softdevice, and they worked very well. When I tried to integrate this first code with ble_app_uart the code didn't work like before.

In this case, softdevice interruptions have a higher priority than the timer priority. I would like to know how to do a sampling with high precision and work with the softdevice.

I have seen similar topics, some people using the Radio Timeslot API and others using the PPI API. I need guidance on how to proceed with this project. I am using the nRF SDK 16.0.0. I am evaluating the possibilities of how to proceed in the development. Shall I need to implement a Radio Timeslot API or PPI Channel ?

Best Regards.
Parents Reply Children
  • How often did you transmit data on UART, I mean to ask what is the interval of data transmission of your 1024 samples. If you choose a large connection interval and select a larger MTU packet to transmit data ONLY WHEN available, I think you should be able to do this.

    Can you let me know your

    1. connection interval used for BLE 
    2. size of your 1024 samples to be transmitted
    3. time it takes for the FFT to process your data
    4. MTU size of the BLE packets

    Based on this information you can tell if you are processing the samples too fast to fit into your connection interval/MTU configuration. This is something you need to fine tune to suit your application.

Related