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

ADC Conversion using 4096Hz for nRF52832 Chip?

Hello Sir,

We are using nRF52832 chip and Softdevice is S132. Is it possible to sample an analog signal using internal ADC conversion using 4096Hz?. Its look like it does at 3900Hz.

Thanks in Advance..

Parents
  • I don't know how you have setup RTC, but you should make sure you do not enable interrupt if you want to trigger the sampling through PPI. You also need to clear the RTC after getting the compare event. This can also be done using PPI. I will edit my answer above with a working main.c file for ble_app_uart__saadc_timer_driven__scan_mode that implement sampling using RTC over PPI. Note that you need to include the nrf_drv_rtc.c source file, and enable RTC in sdk_config.h.

Reply
  • I don't know how you have setup RTC, but you should make sure you do not enable interrupt if you want to trigger the sampling through PPI. You also need to clear the RTC after getting the compare event. This can also be done using PPI. I will edit my answer above with a working main.c file for ble_app_uart__saadc_timer_driven__scan_mode that implement sampling using RTC over PPI. Note that you need to include the nrf_drv_rtc.c source file, and enable RTC in sdk_config.h.

Children
  • Thanks you so much Jorgen, Now my program is working as per you refer me, But problem is current consumption. In my old program using Timer peripheral ADC the current consumption is 5mA with BLE advertising. But now when i implement my code into RTC over PPI current consumption is 5.78mA. If i use RTC the current consumption it will reduce because RTC is low power consumption instead of timer. Can you tell why current consumption increase in my device. My device is operate on battery so to reduce current consumption is important for me.

  • How do you measure the current? If 5 mA is your average current consumption with only advertising, this seems quite high. switching to RTC for sampling should not increase your current consumption. Do you have approximately the same sample rate with both setups? The EasyDMA current (~2mA) enabled with the SAADC could be limited by disabling the SAADC between samples, as shown in the low power SAADC example, but with your samplerate, you might not gain much on this either. Could you upload your applications for debugging?

  • I measure the current using multi meter which is connected serial of positive power supply. I measure 5.78mA current during advertising only when i reading ADC value at that it goes to 6-7mA with BLE connectivity in android apps. In new RTC code i am not set sampling rate only set frequency and CC value is 32768 and 8. So sir Can you guide me how i can reduce this high current consumption because my device is operate on AA battery cell. For long battery life is important for me. In my new RTC program where i need to define sampling rate, and also How i can control EasyDMA for less current consumption. You saying are upload my main program.

  • You might need to get some better equipment than a multimeter for doing presice measurements of these quickly switching currents. I would recommend the Power Profiler Kit. I did some measurements on the ble_app_uart__saadc_timer_driven__scan_mode code with timer and RTC, and did not see large differences in current (TIMER - RTC). The timer in the example runs on PCLK1M, which gives the timer a run current of 5 µA typical + HFINT Clock run current of 60 µA. The run current of RTC is 0.1 µA typical, pluss run current of LFCLK of 0.25-1 µA. There are some differences here, but compared to the total consumption of the application, this is not the part you should be concerned about. The ~2mA base current of the consumption comes from the EasyDMA current. You should consider if you need such a high sample frequency in your application, or if you could lower this and shut down the SAADC between sampling. This will save you much current.

Related