ADC not going full scale in R21

Discussions around product based on ARM Cortex M0+ core.

Moderator: nferre

gussabina
Posts: 12
Joined: Sat Mar 28, 2015 6:49 am

ADC not going full scale in R21

Sun Apr 10, 2016 9:43 pm

Hello:

I'm using the ADC in the R21 device (same as D21) and I'm seeing I'm not getting the zero value even when I connect the AIN5 pin to ground. I'm getting about 10% of full scale which is too high to be considered a close zero. I tried with both internal 1V reference and external reference (0.6V below Vcc), and result is the same. Accuracy is set to 12-bit but in 8-bit I get same thing.

I also had trouble getting full scale (0xFFF) when I supply same voltage than Vref (external reference); the maximum I got was around 0xD00 (rather than 0xFFF). Using internal 1V reference, it seems to work fine, although I didn't measure the exact value at which the 0xFFF is reached. I will get a better voltmeter to do these measurements.

Did someone experiment this?

Thanks in advance
Gus
sarlacii
Posts: 68
Joined: Mon Jan 26, 2015 2:33 pm

Re: ADC not going full scale in R21

Wed Apr 13, 2016 12:05 pm

Hi there

IMHO you have to be very careful with analog measurements on a GPIO pin. Are the internal pull-ups and pull-downs disabled or not? Is the pin not also configured for output drive to some logic level? These will affect the range, as you are reading the combination of whatever is connected to the port externally, together with the internal connections.

To get closest to full range, you need to disable pull and then disable GPIO. Even so, you will not always get FF.. for "VCC" or 00.. for "GND". Analog input needs to be filtered and post-processed (calibrated) to get sane readings.

Go well.

Return to “SAM D20 Cortex-M0+ MCU”

Who is online

Users browsing this forum: No registered users and 1 guest