This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SAADC pins switch

Hi,

I use the SAADC to sample 2 pins. I use the nrf_drv_saadc, and a timer to call the sample task.

I was trying out several gains for SAADC and I noticed that for gains 1 and 2 (4 not tested), the output buffer switched around the results of the 2 pins.

Can anyone think of a reason for this to happen?

Note: starting at gain 1, the input gets clipped because the input signal goes above 0.6V

Config:

NRF_SAADC_RESOLUTION_12BIT
NRF_SAADC_OVERSAMPLE_DISABLED
NRF_SAADC_RESISTOR_DISABLED
NRF_SAADC_REFERENCE_INTERNAL
NRF_SAADC_ACQTIME_10US
NRF_SAADC_MODE_SINGLE_ENDED
Parents
  • Update

    Answered here.

    Update

    Looks like it's fixed by defining NRF52_PAN_28, even though i'm on a PCA10040, which doesn't have that PAN listed in the docs as far as i know.

    Note: The first sample in the batch is sometimes still incorrect.

    Old answer

    I may have found the bug: I used the pin number also as channel number, so in my case i initialized channel 1 and 2. So it was probably luck that it worked at all. nrf_drv_saadc_channel_init(pinNum, &channelConfig); should've been nrf_drv_saadc_channel_init(channelNum, &channelConfig);

  • Hi Bart, which version of the PCA10040 are you using? Can you also provide the chip marking of the nRF52832 IC on the PCA10040? You are correct that the PCA10040 should not have this issue as the different versions use the Engineering B (PCA10040 v0.9.0), Engineering C(PCA10040 v1.0.0) and revision 1(PCA10040 v1.1.x). Anomaly 28 (aka [28] SAADC: Scan mode is not functional for some analog inputs) was only present in Engineering A versions and was fixed in Eng. B.

Reply
  • Hi Bart, which version of the PCA10040 are you using? Can you also provide the chip marking of the nRF52832 IC on the PCA10040? You are correct that the PCA10040 should not have this issue as the different versions use the Engineering B (PCA10040 v0.9.0), Engineering C(PCA10040 v1.0.0) and revision 1(PCA10040 v1.1.x). Anomaly 28 (aka [28] SAADC: Scan mode is not functional for some analog inputs) was only present in Engineering A versions and was fixed in Eng. B.

Children
No Data
Related