SAADC vs ADC

Good afternoon,

I noticed in the nrfx driver folders there are two differente implementations for ADC: "nrfx_adc.c" and "nrfx_saadc.c"

What is the difference? Why two different implementations? Are they for different peripherals?

I am using nrf52 so I presume I should use SAADC. Could you elaborate a little bit on this?

Thanks a lot!

David

  • Hello,

    Are they for different peripherals?

    Yes, and the differentiation here is made with the HAS_HW_NRF_ADC or HAS_HW_NRF_SAADC defines for the respective SoC.

    I am using nrf52 so I presume I should use SAADC. Could you elaborate a little bit on this?

    Correct - if you go into \v1.8.0\zephyr\dts\arm\nordic\YOUR_SOC you will see which peripherals it has got, and which drivers are compatible with that peripheral. For the nRF52840 for example, it has:

    ..
        compatible = "nordic,nrf-saadc";
    ..


    While if you check an older nrf device, such as the nrf51822 it will have this instead:

    ..
        compatible = "nordic,nrf-adc";
    ..


    Best regards,
    Karl

Related