[START][SAMD21 XPLAINED PRO] Unexpected values from ADC

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello all,

 

I am trying to test out the ADC using the example driver code provided, but I am getting unexpected values from the ADC, and the most likely reason is that I've configured something wrong.

 

I have the ADC connected to AIN/2 (PB08). the other end is connected to a 50kohm/10kohm voltage divider sourced from the board's 3.3V output. The compare source is the internal 1V source. According to my multimeter, I'm getting the expected .559V from the voltage divider, which should give me a result from the adc of around 0x8F in 8-bit mode, but instead I'm getting values of 0x25

 

I've attached my project below (if there's an easier way to show START configurations, please let me know) and any help would be greatly appreciated. I have a feeling it has something to do with the channels, since I've successfully used many single-channel ADCs in the past, but this is the first multi-channel one I've ever worked with.

 

EDIT: I ran it again, realizing I had the compare source wrong.  Now it's giving me values of 0x74, which seems closer, but is still pretty far off. Is that just how accurate the sensor is? I can't find it anymore, but I thought it said the accuracy was 1 LSB +- 5%, which this is way higher than.

Attachment(s): 

Last Edited: Tue. May 1, 2018 - 01:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

uploaded wrong file by accident, give me a second to fix it.

 

Fixed now.

Last Edited: Tue. May 1, 2018 - 01:32 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

...And now the atmel START website appears to be down. I can't create or modify START projects, not even in an external browser.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note that the source impedance of your resistor divider is quite high. When the adc samples, this has the effect of loading the input. Put a 100nF cap between the adc input and 0V. If the reading improves, then this confirms an impedance problem.