[SOLVED] Problem Reading ADC data with ATSAMD10C14A

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

I am using ATSAMD10C14A mcu.

 

I have connected potentiometer to Analog Input pin ANI0 (PA02). I have configured my ADC for 12 bit resolution and I am trying to read the ADC data.

I have attached the screenshot of my register configuration.

 

My configuration:

 

-12bit, right adjusted result

 

-REFSEL = 0x0 - 1.0V voltage reference, However my input at FULL Scale potentiometer position is 1.79V

 

-I have used 16 samples averaging (SAMPLENUM = 0x04)

 

-MUXNEG = 0x18 (internal ground)

 

As I change the potentiometer from zero towards max, I see that the ADC output is increasing.

 

I am expecting that at voltage level 1.0V It should give me reading 4.96 as its 12bit ADC

BUT to my surprise it gives me TOOTH WAVE within 0V to 1.0V range.

It starts with value 200 then within 25% of the potentiometer movement from zero it reaches max 4096. As I move potentiometer further beyond 25%, it starts over again from 200 and so on.

I have attached the Actual behaviour and expected behaviour in the figure.

 

I Appreciate any pointers to resolve the issue.

 

Thanks in Advance!

 

 

Attachment(s): 

This topic has a solution.
Last Edited: Sun. Oct 30, 2016 - 02:10 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hurraaayyy.. I could resolve the issue...

 

Solution:

I had set SAMPLENUM=4 and RESSEL=0(12bit) when I was facing the problem.

 

Then I set SAMPLENUM=0 (No Averaging) it works like a charm.... steady increase in the ADC reading till it reaches to the reference.

 

I guess for averaging output I have to set RESSEL=1 for 16bit averaging output

 

Thanks

/SP