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

nRF52840 sending SAADC data over Bluetooth

Hi,

I'm currently doing a project where I want to sample an SAADC and send it over Bluetooth to another nRF52840 device with different sampling frequencies. The problem is that my sampling seems inconsistent from what I can see from my logs when I'm sending over Bluetooth. I'm using J-Link RTT Viewer with NRF_LOG_INFO() and I'm working with the NUS examples from the SDK 14.2.0. Here is what my logs show when I use a sampling of 1kHz without the ble_nus_send function (left value = time in ms, right value = ADC): 

When I'm uncommenting the ble_nus_send function, I'm getting this : 

It seems like the data is in group of 4 before sending. Since I don't want to lose any data, I'm sending only the ADC value with the ble_nus_send function in a "do while" loop.

Sender =>

 

Receiver =>

Portion of code =>

Also, when I use a sampling frequency >=2kHz, it seems like some data aren't even sampled by the SAADC. I thought maybe the logs aren't showing fast enough and some lines are lost. I also tried to change some variables in the sdk_config without success.

Thank you for your help,

Keven

Parents Reply
  • My apologies for the very delayed answer, I have been out of office.

    I'm having trouble with running your application. What environment are you developing in? 

    Kind regards,
    Øyvind

Children
No Data