SAMD21 Using additional ADC pins PB03

Hi there,

I'm busy attempting to test a custom board using the SAMD21G18A and the arduino zero variant. I've followed the steps in changing the variant file and have had success for all ADC pins except one, PB03.
The line in my variant file is as follows
{ PORTB, 3, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel11, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // ADC/AIN[11]

When using analogRead(pin_that_correlates_to_PB03_on_my_variant), it returns spurious noise, although when I use my multimeter, I get a fixed, constant voltage which is coming from one of my sensors, measured on the actual PB03 pin. The same is not true for all other ADC channels. They behave as expected.

I've been puzzling over this for days - any help would be much appreciated!

Hi @mikesoper

It's a difficult question to answer, seeing as there are so many variables.

Is the sensor in question external to your custom board? What I mean is, is it possible to connect it to your other ADC inputs to compare results?

I notice that you're using a multimeter and not oscilloscope to measure noise? Might I ask how you are measuring the noise? Also, might I ask what you mean by "spurious noise"?

The PB03 is connected to the VDDANA analog supply, have you filtered VDDANA on your custom board, as suggested in the SAMD21 datasheet, section 42. Schematic Checklist?

Hi there @MartinL ,

Thank you for your speedy response.
I have now tried to connect my external sensor to a different ADC and it turns out that it wasn't the ADC at all, rather the input signal itself. The ADC of AIN11 does in fact work :slight_smile: Thanks for the suggestion.

I don't have an oscilloscope at my disposal sadly. The reason I didn't suspect noise on the input signal is because its a DC voltage sensor measuring the output voltage of a power supply (which generally wouldn't have a large peak to peak ripple voltage. My fix will be to increase the impedance between my analogue ground and the ground of the power supply (which is currently being sensed through a differential to single ended op amp).

Thanks again for your help.

@mikesoper Glad to hear that your board's working correctly :smiley:.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.