Xmega ADC problems & "solutions"

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

For the last little while I've been working with a couple of Xmega parts (the 16 & the 128) trying to get the A/D converter to work right. As we all know, it's currently pretty badly broken. I've posted the results of my efforts, and "solutions" I've found, here:

http://blog.frankvh.com/2010/01/03/atmel-xmega-adc-problems-solutions/

Hopefully this will be of use to anyone else trying to work with the Xmega ADC.

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

It is a nicely put-together summary, and may be helpful to many.

[full disclosure: I'm not an Xmega person yet, so like Will Rogers all I know is what I read in the papers]

Since time immemorial, or at least since 'Freaks actually got an Xmega clasped in a sweaty palm, there have been ADC discussions. Much of what you learned has already been covered in threads here. (One interesting aspect is that some of what I dug up >>advocates<< the use of the 1V ref, contrary to your findings.

A forum search for "xmega adc" uncovered threads with postings from ninevoltz9 jcrollman bpaddock and other Xmega early adopters. From earlier to later, you might want to compare these postings with your experience:
https://www.avrfreaks.net/index.p...
https://www.avrfreaks.net/index.p...
https://www.avrfreaks.net/index.p...
https://www.avrfreaks.net/index.p...
https://www.avrfreaks.net/index.p...
https://www.avrfreaks.net/index.p...

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Thanks, yes, I've read those posts (and more - I've been doing a lot of searches of these forums over the last month). It's tough to find everything put together in one place - hopefully I've consolidated at least a good chunk of it. I understand that not everyone may agree with every conclusion I've reached (eg the use or lack thereof of the 1.00V reference), and given the problems with the ADC I expect there will be significant part-to-part variations. Still, I hope this will be of benefit to some folks, and perhaps provide a starting point for those trying to get the ADC to at least somewhat work.

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

when using 1V internal ref I got values 512...431 (difference almost 10 %), with internal Vcc/1.6 ref values was 313...317. Measured voltage was stable 0.070 V. So internal 1V ref is unusable. Vcc=3.3 V, 32Mhz, prescaler =512, single ended input.

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

ana57 wrote:
So internal 1V ref is unusable. Vcc=3.3 V, 32Mhz, prescaler =512, single ended input.

I'm doing a 60-point automated calibration over the entire range using the internal 1V reference, single-ended, 29.4912Mhz, prescaler = 512, vcc=3.2V. The numbers look great to me. I hardly think the 1V reference is unusable.

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

Below is some results (excel table) using internal 1 v ref and Vcc/1.6 ref, other conditions are same, input voltage about 69.58 mV. Diff is calculated from average value. Test voltage is from Usb, 10 k potentiometer filtered with 200 uF cap.

						
		Vref=1V						Vref=Vcc/1.6	
						
	ADCA.CH0	Diff		Diff%		ADCA.CH0	Diff		Diff%
	424,000	24,038	5,365		314,000	-0,962	-0,307
	512,000	-63,962	-14,276	313,000	0,038		0,012
	430,000	18,038	4,026		311,000	2,038		0,651
	512,000	-63,962	-14,276	314,000	-0,962	-0,307
	429,000	19,038	4,249		310,000	3,038		0,971
	421,000	27,038	6,035		316,000	-2,962	-0,946
	426,000	22,038	4,919		314,000	-0,962	-0,307
	512,000	-63,962	-14,276	314,000	-0,962	-0,307
	430,000	18,038	4,026		314,000	-0,962	-0,307
	437,000	11,038	2,464		312,000	1,038		0,332
	420,000	28,038	6,258		313,000	0,038		0,012
	430,000	18,038	4,026		314,000	-0,962	-0,307
	431,000	17,038	3,803		313,000	0,038		0,012
	431,000	17,038	3,803		309,000	4,038		1,290
	439,000	 9,038	2,017		313,000	0,038		0,012
	434,000	14,038	3,133		311,000	2,038		0,651
	437,000	11,038	2,464		312,000	1,038		0,332
	424,000	24,038	5,365		315,000	-1,962	-0,627
	434,000	14,038	3,133		316,000	-2,962	-0,946
	512,000	-63,962	-14,276	311,000	2,038		0,651
	512,000	-63,962	-14,276	314,000	-0,962	-0,307
	430,000	18,038	4,026		314,000	-0,962	-0,307
	430,000	18,038	4,026		312,000	1,038		0,332
	419,000	29,038	6,481		312,000	1,038		0,332
	421,000	27,038	6,035		315,000	-1,962	-0,627
	512,000	-63,962	-14,276	313,000	0,038		0,012

AVG   448,038			      		313,038		
						
					
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'll attach an xy plot of some readings. Note that this is before linear calibration coefficients have been applied, but the response looks pretty linear throughout the entire range. Each reading is an average of app. 200 samples (dropping the first sample for each reading)

These readings were taken using an HP 34401A 6.5 Digit meter and an Agilent E3640A programmable power supply. Software steps the power supply through the range and averages multiple readings for each level. The GPIB-Ethernet bridge communicating with the instruments was developed using an Xmega128a1 :)

[edit]
I forgot to mention that the source is a voltage follower with a 2k/4.7k divider to bring the input within 1v range. Maybe your 10k pot is a little too much resistance?

Attachment(s): 

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

Averageing 200 samples can hide all sorts of problems. You should be able to get a good graph off 1 sample...

Looking at ana57's numbers the fact that the realy bad samples are all 512 is a bit stricking to me with those removed things improve considerably but there is still a big range compared to the V/1.6 referance. The V/1.6 numbers are not briliant but probobly what you should exxpect from the errata about the 2bit sawtooth problem.

Have not got an xmega to play with yet but have one on order ut I may stay away from the ADC initaly there is plenty of other stuff for me to try out that should be working....

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

ifor wrote:
Averageing 200 samples can hide all sorts of problems. You should be able to get a good graph off 1 sample...

Looking at ana57's numbers the fact that the realy bad samples are all 512 is a bit stricking to me with those removed things improve considerably but there is still a big range compared to the V/1.6 referance. The V/1.6 numbers are not briliant but probobly what you should exxpect from the errata about the 2bit sawtooth problem.

I guess it depends on the application. I'm not saying there aren't any issues with the A/D. My point was that the 1V reference appears to be quite usable to me. I didn't even try to change the sample count to 1. I always average many samples to get a better SNR. I'm designing dataloggers though.. so your application might require faster response than that. I did notice that the first sample after sensor power-up was not good. Settling time after sensor power-up is also necessary.

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

I have read some posts, and got some info from Atmel, saying that the ADC behaves a lot better in signed differential mode than in unsigned single ended.

I use unsigned single ended and I must say the ADC just sucks.

Is anyone usgin the Rev.B silicon of the ATxmega32A4?