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

What does the Nordic device actually do when oversampling is selected for the ADC

Hi

I used your example to try out the ADC.

If I have 10 or 12 bit ADC selected and I am collecting 4 samples as per the example and I select 8x oversampling I assume this effectively 32x oversampling if I add the 4 samples and divide by 4.

What I want to know is what does selecting 8x oversampling actually do

Do you take 8 samples and then provide 1 result ?  If so then I could simply take 8 samples and do the same.

Or does your HW do something different ?

I am trying to fully understand how your ADC works as we need this for our application.

Robin

  • Hi Robin,

     

     

    If I have 10 or 12 bit ADC selected and I am collecting 4 samples as per the example and I select 8x oversampling I assume this effectively 32x oversampling if I add the 4 samples and divide by 4.

    What I want to know is what does selecting 8x oversampling actually do

    Do you take 8 samples and then provide 1 result ?  If so then I could simply take 8 samples and do the same.

    Or does your HW do something different ?

    Yes, in your case, the hardware will do 32x samples and provide 4x samples to the application when it's done.

     

    The SAADC peripheral, when configured with 8x oversampling, will then take 8 samples for every 1 sample that is transferred to the application.

    When oversampling is enabled, you get a EVENTS_DONE for every sample that is taken, and a EVENTS_RESULTDONE when the oversample process is finished and the result is transferred to RAM.

    If BURST is not enabled, you then have to trigger the TASKS_SAMPLE 8 times in the case you have oversampling=8x, as described in the PS:

    http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/saadc.html?cp=2_1_0_36_4_2#saadc_operationmodes_oversample

     

    Kind regards,

    Håkon

  • Hi

    thanks for the reply

    I think I understand this but just to clarify can you answer the following

    I am using  nRF5_SDK_15.2.0_9412b96\examples\peripheral\saadc

    example as the base for this, with some modification.


    Sampling event is setup for 1ms
    With the SAMPLES_IN_BUFFER set to 1 only
    Acquisition time 10us
    ADC 10 bit
    Oversample 8x

    SO with the above settings I think the hw/sw will perform like this
    Every 1ms it will collect 8 samples but the result sample will be 8 samples divided by 8, is this correct ?

    How will the samples be collected ?
    Is the acquisition window opened 8 x 10us periods and if so what is the time between each acquisition  window opening?

    Also if I change the SAMPLES_IN_BUFFER from 1 to 4 for example
    Does this mean 4 result samples will be collected once every 1ms or does it mean there will be 4 result samples available after 4 ms.
    If all 4 result samples are collected once every 1 ms following on from previous question does that
    mean there will be 8 x 4 10us acquisition periods. IE the acquisition window opens 8 times for each result sample, meaning it opens and closes 32 times.

    Thanks Robin

  • Hi Robin,

     

     

    robin said:


    Sampling event is setup for 1ms
    With the SAMPLES_IN_BUFFER set to 1 only
    Acquisition time 10us
    ADC 10 bit
    Oversample 8x

    SO with the above settings I think the hw/sw will perform like this
    Every 1ms it will collect 8 samples but the result sample will be 8 samples divided by 8, is this correct ?

    Yes, that is correct.

    If you set 8x oversampling, and 10 acq time, it will take 8 * 10 us to finish. The finished sample will then be already averaged for you.

    robin said:

    How will the samples be collected ?
    Is the acquisition window opened 8 x 10us periods and if so what is the time between each acquisition  window opening?

    It will be 8 * 10 us for this scenario.

    robin said:
    Also if I change the SAMPLES_IN_BUFFER from 1 to 4 for example
    Does this mean 4 result samples will be collected once every 1ms or does it mean there will be 4 result samples available after 4 ms.
    If all 4 result samples are collected once every 1 ms following on from previous question does that
    mean there will be 8 x 4 10us acquisition periods. IE the acquisition window opens 8 times for each result sample, meaning it opens and closes 32 times.

     This will mean that all 4 will be available after 1 ms, resulting in 8 x 4 *10 us period.

     

    Kind regards,

    Håkon

Related