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

nrf52 application Using ADC 2 channles 12Khz 12Bit

Hi ,

Please advise, what the Low Power option I have if I want to sample Two channels of analog input at the same time. The sample rate in every channel is 12K, 12Bit. And to fills 512 samples word for every channel.

The application is DSP light that is looking for patterns in the sample data, therefore the samples its endless It is essential not to lose data, and the data from the analog channels must be continuous.

if I cut the application... there are three major task that it can be

  1. task_adc: sample and fill buffer ( must be low power less as can )
  2. task_process: Process buffers
  3. task_radio: Advertising the resulting refresh rate every 10Sec 10Bytes

The timing is:

90% is only executed task_adc, 10% task_adc+task_process 1%< only task_radio

what options I have? DMA or not? Continuous mode? There is an example for it? It possible to enter to "Stop mode" between samples? What is the timing

And What the power consumption of nRF52 in every task?

Thanks, ZVIKA.

  • Hi ZVIKA,

    You can find an example of Low-power SAADC in this GitHub repository. Unfortunately, with two channels and a sample frequency og 12 kHz, this example won't help much.

    This example use RTC instead of a TIMER to trigger samples, to keep low power. The RTC runs at 32.768 kHz, meaning that the closest you can come to 12 kHz sampling frequency is 32768/3 = 10922.67 Hz. The example also disables the SAADC peripheral between samples, to eliminate the EasyDMA current of ~1.5 mA and put the chip in system on sleep mode. With an aquisition time of 10 us pr. channel, wakeup latency, and overhead, there won't be much time to save power. To achieve the timing you desire, you also need to enable constant latency mode. This will keep HFCLK enabled at all times, increasing the current consumption even more.

    To get close to 12 kHz sampling rate, you can use a TIMER to trigger the samples. With the timer running at a frequency of 16 MHz, you can set a compare value of 1333, giving you a sample frequency of 12003 Hz. Timers also require the HFCLK to be running.

    The SAADC peripheral will always use EasyDMA for sampling, and you should use continuous mode to achieve correct timing. Note that if you will be using softdevice to advertise the result over BLE, this will have highest priority, for timing-critical tasks. If continuous mode is enabled by sampling through PPI, the sampling will not be affected by this, but note that any processing might be delayed.

    I did some quick testing, with various setups, both with RTC and TIMER, and the average current consumption of samling only veryed between 2-4 mA.

    The SAADC example in our SDK should be a great starting point for the SAADC peripheral and TIMER, but don't expect to get very low power.

    Best regards,

    Jørgen

  • Thanks for your answer. After I receive my EVB next week, I try to make few test and start with yours advice.

    Zvika.

Related