Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Unblocked saadc and buffer size

Does unblocked saadc sample the buffer size and stop or does it start re-sampling after the callback?  In other words, if the buffer is 100 entries in length, will it issue a callback every 100 samples, continuously.  The documentation isn't clear.

Parents
  • Again, the documentation doesn't say you need to setup an internal timer to trigger samples.  To me (and other people who have read this documentation) "Sampling" implies multiple samples, not just one!  You are basically saying that the nrfx_saadc_sample will only create one sample in 'cpu mode' if no timer is set up, despite the fact that the nrfx_saadc_buffer_convert allows you to setup a buffer with NUM_SAMPLES (25 in my case!).  The implications is that nrfx_saadc_buffer_convert sets up the 'unblocked' mode to do multiple samples!  I don't understand how you don't see that this is confusing

Reply
  • Again, the documentation doesn't say you need to setup an internal timer to trigger samples.  To me (and other people who have read this documentation) "Sampling" implies multiple samples, not just one!  You are basically saying that the nrfx_saadc_sample will only create one sample in 'cpu mode' if no timer is set up, despite the fact that the nrfx_saadc_buffer_convert allows you to setup a buffer with NUM_SAMPLES (25 in my case!).  The implications is that nrfx_saadc_buffer_convert sets up the 'unblocked' mode to do multiple samples!  I don't understand how you don't see that this is confusing

Children
  • SentinelLighting said:
    Again, the documentation doesn't say you need to setup an internal timer to trigger samples.

    I would argue that it does, in the very first line of the continuous mode documentation:

    Karl Ylvisaker said:

    An exempt of the very first sentence of the Continuous mode documentation reads:

    Continuous sampling can be achieved by using the internal timer in the ADC, or triggering the SAMPLE task from one of the general purpose timers through the PPI.


    Followed up by:

    Karl Ylvisaker said:
    The SAMPLERATE register can be used as a local timer instead of triggering individual SAMPLE tasks. When SAMPLERATE.MODE is set to Timers, it is sufficient to trigger SAMPLE task only once in order to start the SAADC and triggering the STOP task will stop sampling. The SAMPLERATE.CC field controls the sample rate.


    I would say that this clearly states that it is sufficient to trigger the SAMPLE task only once in the case that you are working with an internal timer to achieve continuous sampling. Thus, in the case that you are not using the internal timer you should trigger the SAMPLE task externally, such as by a TIMER instance over PPI.

    SentinelLighting said:
    You are basically saying that the nrfx_saadc_sample will only create one sample in 'cpu mode' if no timer is set up, despite the fact that the nrfx_saadc_buffer_convert allows you to setup a buffer with NUM_SAMPLES (25 in my case!).  The implications is that nrfx_saadc_buffer_convert sets up the 'unblocked' mode to do multiple samples!  I don't understand how you don't see that this is confusing

    I am indeed saying that nrfx_saadc_sample will only create 1 sample - if not used with the internal timer.
    Readying a buffer and filling said buffer is two entirely separate operations, I would argue.

    I might of course be biased because I have worked with this for some time now, but I cant say that it would make sense to have the SAADC fill up a provided buffer without specifying in any capacity the interval or frequency of these samples. For most any signal processing purposes these measurements would be useless since you do not know the frequency the samples are sampled at. Is this not a fair assessment?
    I do see how 'sampling' could imply more than one sample, but I guess this then refers to the case in which the internal timer is used - since there exists a case in which triggering SAMPLE once is sufficient to perform multiple samples - but seen in light of the continuous mode documentation I would not say that this is ambiguous.

    If you have a specific suggestion for an improvement of the documentation we would of course welcome any such feedback!

    Best regards,
    Karl

Related