I have previously worked on Nordic’s nRF52840 as a standalone module and I chose to switch development on the RAK4631 since it embeds the very same chip, to gain leverage on my experience.
However, I have trouble finding the equivalent functions to configure the ADC, and reading posts in this forum does not help. From what I can infer, everything that can be done on nRF52840 (regarding the ADC at least) should be also feasible on RAK4631, but information on this subject is scarce.
Here are my questions :
Is the RAK4631 really using the ADC from nRF52840?
Is there a proper ADC API documentation?
Can the following be configured: Voltage reference, Gain, Sampling rate, Acquisition time, Burst?
If so, how?
Regarding my setup, I am using Arduino IDE to program a RAK4631 mounted on a RAK5005-O through a USB cable.
Yes, the RAK4631 is using the ADC of the nRF52840 and the setup and usage of the ADC is done the same way in Arduino as it is done with other nRF52 boards.
Here is an example how to use the ADC.
Keep in mind, that there are only 2 ADC channels exposed on the RAK4631.
They are named WB_A0 and WB_A1 in the Arduino variants.h file.
WB_A0 is attached to the battery voltage already and cannot be used for other purposes. WB_A1 is available.
Thank you for your answer! There is still one point that I am not sure to understand. Looking through the GitHub repository for mentions of “Burst” mode or “Sampling rate”, I only find references pointing to the bootloader.
Is it possible to modify the ADC’s behaviour at runtime? I see for example the “nrfx” driver which looks promising. Can it be imported to modify the ADC?