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.
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.
You wrote: "If you want multiple samples you will need to trigger the sample task multiple times, as mentioned in the continuous mode section of the SAADC documentation.:
-WHERE does your documentation say this? From what I have read it does not say that.
The documentation implies that if I pass a buffer for 25 readings, and pass the num_samples as 25, like this... nrfx_saadc_buffer_convert(buffer, 25); ... and then call nrfx_saadc_sample() that it will go get 25 samples, transfer them to the buffer and issue the callback when done. Are saying I have to call nrfx_saadc_sample 25 times, waiting in between calls for the adc to convert? That is basically blocking mode!
The documentation implies you call nrfx_saadc_sample ONCE and it will then issue the callback when the 25 samples are complete! This is where the documentation is confusing.
You wrote: "If you want multiple samples you will need to trigger the sample task multiple times, as mentioned in the continuous mode section of the SAADC documentation.:
-WHERE does your documentation say this? From what I have read it does not say that.
The documentation implies that if I pass a buffer for 25 readings, and pass the num_samples as 25, like this... nrfx_saadc_buffer_convert(buffer, 25); ... and then call nrfx_saadc_sample() that it will go get 25 samples, transfer them to the buffer and issue the callback when done. Are saying I have to call nrfx_saadc_sample 25 times, waiting in between calls for the adc to convert? That is basically blocking mode!
The documentation implies you call nrfx_saadc_sample ONCE and it will then issue the callback when the 25 samples are complete! This is where the documentation is confusing.
SentinelLighting said:-WHERE does your documentation say this? From what I have read it does not say that.
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.
So unless you are using the internal timer you will have to have the SAMPLE task be triggered externally, such as by the CPU directly (which likely will not generate a accurate periodic sampling) or through PPI. What else do you interpret this sentence to mean?
The case in which you are using the internal timer lets you trigger SAMPLE only once, but this is only available for single channel sampling.
SentinelLighting said:The documentation implies you call nrfx_saadc_sample ONCE and it will then issue the callback when the 25 samples are complete! This is where the documentation is confusing.
This is only the case when using the internal SAADC timer for sampling of a single channel. The relevant section from the continuous mode documentation reads:
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.
If you would like to use the driver for this you will have to use the nrfx_saadc_v2's advanced mode. Using the advanced mode of the nrfx_saadc_v2 driver to do continuous sampling using the internal timer is demonstrated in this example.
SentinelLighting said:Are saying I have to call nrfx_saadc_sample 25 times, waiting in between calls for the adc to convert?
If you are neither using the internal timer nor an external event to trigger the sampling you will have to call this function 25 times, correct. This is however not the recommended way of capturing a series of periodic samples, as previously mentioned.
SentinelLighting said:That is basically blocking mode!
No, what you do in-between calls to nrfx_saadc_sample is up to you.
Best regards,
Karl