Hi,
We are using an nRF52832 in a bare-metal project. (No SDK)
We have three input channels to the ADC that we wish to use. These must be oversampled. (256x)
To simplify the code, we would like to have it behave such that we configure the ADC, trigger a sample and get an interrupt when the results have been transfered to RAM by EasyDMA.
However, we find some conflicting information in the specification.
First, it say it can't be done.
Scan mode and oversampling cannot be combined.
- Section 37.5
Oversampling and scan should not be combined, since oversampling and scan will average over input channels.
- Section 37.5.3
I don't exactly understand what the last one tries to say, but it seems to try to tell me you can get unexpected results.
But then you read about burst and it says:
Scan mode can be combined with BURST=1, if burst is enabled on all channels.
- Section 37.5.3
This seems to imply that it is possible, if you enable burst. It doesn't say, however, if "all channels" are all available channels (0-7), or just the once the enabled. ("A channel is considered enabled if CH[n].PSELP is set." - Section 37.5.4)
Finally, in the scan section it says:
In this mode, the RESULTDONE event signals has the same meaning as DONE when no oversampling takes place.
- Section 37.5.4
The next thing that is unclear to me is what tasks and events are associated with this. For instance, it says that DONE will be generated when a sample is completed. But is this the "256x samples", or a single sample? What is the difference with RESULTDONE?
My concrete questions:
- Is it possible to combine oversample and scan, if you enable burst? If so, do you need to enable it on all available channels, or just the active ones?
- What tasks do I need to set to start the sampling? Which events should I monitor in my interrupt handler?
- Do I need to repeatedly trigger the SAMPLE task? Once per channel, or 256 times per channel?
Thanks in advance!