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

Two Analog Signal using SAADC nRF52-DK (nRF52832)

Hi all,

I need to take samples of a period of two periodic signals and made some DSP processing with both signals. I need at least 64 to 128 samples per signals.

I been struggled with the SDK and the examples provided (This is my first project with the nRF52-DK)

I tried to take sample by sample (blocking) to fill one buffer and then start filling the other buffer but doesn't work property. At least that is what it's seems.

I also tried to use the non-blocking method but still no luck.

I think I don't get what I want because the serial it's not printing all the info, I think there's could be another error.

There's any example with something similar of what I need to do?

I have seen some examples that take one sample of 4 analog signals and transmitted by bluetooth.But that is not what I need.

What I need is to take a single period set of samples (64 to 128), and do some maths with that samples (RMS, FFT, Peak Value, Total Distortion Harmonic, etc), for two different analog signals (ideal scenario both signals takes in the same period of time, worst case scenario take one signal in one period and the other analog signal in another period of time)

Thanks and Best Regards, JP

  • Hi,

    You can use scan mode and a timer to achieve this. By enabling two channels and use PPI to trigger the start task at the sampling rate you want. By calling nrf_drv_saadc_buffer_convert() with the desired amount of samples as a parameter, you will get a NRF_DRV_SAADC_EVT_DONE event when the buffer is full. You can then stop the timer if you do not want more samples. The timeline of the SAADC is shown in the documentation.

    I guess this is the example you are referring to? Even though this is not exactly what you want to do, I think it is still a good starting point for your application. You can strip away the parts not relevant for your application. Are you not going to use BLE at all?

    Best regards,

    Jørgen

Related