Configure Xenon/Argon/Boron for differential analog input

The datasheet for the xenon/argon/boron indicates the analog inputs can be configured for differential input (default is single-ended inputs). How do I configure this in code, and how do I make the proper connections?

Can you point me to where it states this - I can’t seem to find it as it seems an interesting feature?

1 Like

It should be possible but is not supported and it will require some effort to get it to work as there is no support for it in Device OS. It should be possible to do it entirely from user firmware, not requiring a custom build of Device OS, however it will be hard to switch between built-in and custom differential ADC, so if you’re using a combination you’ll probably want to just take over all ADC functions manually.

In addition to the nRF52 product spec, you’ll probably want to look at my ADCDMAGen3_RK library. It shows how to initialize the ADC peripheral from user firmware.

The Device OS code for reading the ADC will also be helpful:

Also, you don’t have to write to the ADC hardware directly, you can use functions in the nRF52 ADC driver like nrfx_saadc_channel_init which make it easier. Just search for that and you should be able to find some examples online.

In differential mode two ADC inputs are required for each measurement so you won’t have as many inputs as in single-ended mode.