For my project I need to measure the battery voltage while transmitting data to get a good indication of the battery capacity. I've found an old example (link text) that goes into detail on how to set the SAADC up where the ADC event can be manually triggered instead of using a timer and the PPI to start a conversion. The example also initializes and disables the ADC after the conversion is completed for lower power consumption.
However, I can't get it to initialize. When the function "nrf_drv_saadc_buffer_convert" is called, an fatal error occurs. I've checked with the SAADC example, but i can't find the reason the fatal error occurs. I've included "nrf_drv_saadc.h", "nrf_saadc.h" and enabled the SAADC in "sdk_config.h" with default settings in my project.
I could not get the code snippets to be displayed properly, so I've added it as a text file to this post: saadc.txt I usethe nRF52832 and SDK13.1 with Keil uVision 5.
Any help is greatly appreciated!