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

Including libraries for ADC usage

Hello, I am trying to develop an application using the ADC of the nrf52832. For this, I have included the "nrfx_adc.h" library into my main code. When I try compiling the project though, I get loads of errors saying that basically every variable in the "nrf_adc.h" library (which is referenced in "nrfx_adc.h") is undefined. For reference, I tried looking up the "nrf_saadc.h" library and wanted to know where those definitions are, and apparently they are in a library called "nrf52_bitfields.h". But there's none for the variables in "nrf_adc.h"!

Are they in a different file and I am just not finding them? Can I simply use the "nrfx_saadc.h" library? I've checked the main file of the ADC sample application and there seems to be some extra methods so I don't know how much of those methods I would actually need to copy into my program?

Help would be much appreciated, thanks in advance.

Parents Reply
  • The difference between the SAADC driver and the ADC driver, is that the former is intended to use for the nRF52 series while the latter originates from the nRF51 series. Also, as mentioned here, SAADC has direct memory access and can move its samples into RAM without using the CPU. The reason nrf_adc.h is still included in SDK 15 is for backwards compatibility. 

    I would recommend you to implement ADC using the SAADC driver. Using the SAADC Example as a reference might help you with that.

    Please ask if you encounter any problems while doing this.

    Best regards, Simon

Children
Related