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.
-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!