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

ADC Sampling with Softdevice

Hi Everyone,

I am working on a hobby project with nRF51822 which needs me sample upto 4 signals reliably at 500Hz each at 10bit resolution. I have read through few posts in the forum([1],[2],[3]) and found that with softdevice installed ADC sampling rate drops to 1KHz(Or Is it 2KHz? As one forum post was suggesting so)

So for my requirement, I am assuming nRF51822 might not be good enough as sampling rate would drop to 1KHz/4 = 250Hz as I have four channels? I would like to know what my options are to implement this spec at 500Hz/channel?

  1. Is there way to do 500Hz/channel for 4 inputs with latest softdevice installed? (Connection Interval: 7.5ms, Slave latency: 0ms, 1 packet(<20bytes of data) of data transfer per connection interval)
  2. If I compromise on the sampling rate to 250Hz/channel(or dropping it to 8bit resolution), would I be able to reliably sample all channels with SD installed?
  3. If its No to the Question 1, is my only option to go for an external ADC with higher sampling rate and transferring data to nRF51822 via SPI?
  4. Is it better for me switch to nrf52840(Preference is still towards nRF51822)? I have PDK which I can work with for this project. I haven't searched around in the forum for ADC performance of nRF52840 with s140 SD.

Thanks in advance.

Parents
  • Hi,

    Have you tested this with your own application? As Stefan mentioned in the 3rd post you linked:

    If you use softdevice and have 3rd revision nRF51, you can obtain sampling frequency approximately 2-8 kHz, depending on how much data you send over the air.

    Your data requirements does not look that high, that you should not be able to maintain the sample rate you desire. Here is an example that you can try if you want a ready-made example.

    The nRF52840 PDK (or nRF52 DK) would be a better choice, as it has a faster SAADC peripheral and support for EasyDMA, allowing you to continue sampling directly to RAM, while BLE activity is going on.

    Best regards,

    Jørgen

  • There is no way to calculate this exact for your application, as it will depend on many factors. You should get at least 2 kHz with one channel. If using PPI and a timer to trigger the ADC sampling, you should be able to get beyond your requirements. There are some examples available in this GitHub repo. You will have to try it out to see what the maximum sampling rate for your application is.

Reply Children
No Data
Related