View previous topic :: View next topic |
Author |
Message |
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Wed Aug 11, 2010 10:18 pm Post subject: XMega ADC performance |
|
|
Does anyone have experience with the XMega ADC systems ? I am looking at using one of these to get better throughput and 12 bit performance instead of the 10 bit ADC on the AtMega series. In particular, can you really get full 12 bit resolution ?
The application calls for full 12 bit performance on single measurement samples, no time for averaging. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
JC
Joined: 15 Dec 2007 Posts: 585 Location: Cleveland, OH
|
Posted: Thu Aug 12, 2010 2:41 am Post subject: |
|
|
Adrian,
There are quite a few threads about the Xmega's ADC(s) over at AVR Freaks, you may want to use the Search option on that site and read a few of the threads.
If I recall the gist of them correctly, there are several modes for the XMega's ADC, and not all of them work as advertised. Have a look at the Atmel site for the latest data sheet and the errata list for the Xmega chip you are intending to use.
Two additional thoughts:
You may also consider using both of the ADCs in the Xmega to sample your signal, alternating rapidly between them. Each one then has to sample at one half of the speed it would otherwise have to sample at.
I've not used a 12 bit ADC before, except when playing around. Several people noted that the layout of the analog front end, a "noiseless" power supply, and a "noiseless" reference voltage are critical to obtaining 12 bits of meaningful data. But you probably already knew this...
JC |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Thu Aug 12, 2010 2:57 am Post subject: |
|
|
Thanks for that. I have looked at the comments on the AVRFreaks site, sounds like the ADCs in particular are still a work-in-progress.
I have plenty of experience with 12 bit ADCs, we use Texas TLC2543 in current designs, but they are a bit slow/processor intensive for the current application. So I was hoping to use something with a bit less processor load, and the Xmegas certainly have that end sorted out, with pipelining and DMA.
But the noise and reference stability seems still to be an issue, depending on what exact mode is used. Looks like I will have to get a development board and test, as usual. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
Per Svensson
Joined: 03 Oct 2004 Posts: 235 Location: Gothenburg, Sweden
|
Posted: Thu Aug 12, 2010 11:44 am Post subject: XMega ADC performance |
|
|
Hi Adrian
I am currently using the Xmega ADC.
Too early to judge the noise figures. Maybee next week...
But worth to notice is that if you have more than one input the xmega is very efficient. One 12 bit conversion takes 8 adc-clocks for one input, whilst 4 inputs can be measured in 12 cycles. Using both ADC's you can get 8 more or less simultanous conversions in 12 cycles.
I have written a routine that uses all four channels in one go if you are interested.
By the way, Is there anybody who knows how to read out the calibration parameters from the "Signature row" via Bascom. They are needed for full 12 bit accuracy.
/Per |
|
Back to top |
|
|
s_sergiu
Joined: 25 Sep 2006 Posts: 81
|
Posted: Thu Aug 12, 2010 8:41 pm Post subject: |
|
|
Hi Adrian,
I spent lot of time with XMEGA ADC (see older post here in forum about "XMEGA ADC problem").
Here is what I got so far:
-Do not use internal reference but external one (in VREFA or VREFB)
- The reference voltage SHOULD be 0.6V smaller than AVCC so go for 3.6V supply and 3V REF.
- You must add 100nF capacitor close to VREF pin.
- In my experience, adding calibration registers (you can read them with AVR Studio) make no difference in accuracy. So far I worked with more than 10 XMEGA chips (revision 7) and all of them have same calibration registers values (HFF and H00).
- Conversion speed is fantastic and accuracy is indeed 12bit ! (tested with FLUKE 189 multimeter)
- The ONLY PROBLEM is you can not read one channel after another or you will find some voltage from first channel in conversion result of second one !!. So far I was not able to trace this problem. BUT if you read each channel two times and keep the second result ,problem is solved !
- The ADC example from Bascom did not work for me.
- Following is code from one XMEGA Autopilot I'm currently successfully testing in one HEXA copter( see attached pictures).
Frequency is 32MHZ from external 16Mhz XTAL.
Dim out_adc as word
Adca_call = &HFF
Adca_calh = 0
Adcb_call = &HFF
Adcb_calh = 0
Adca_refctrl = &B0010_0000 'REFA selected
Adca_prescaler = &B0000_0011 'prescaler 32
Adca_ch1_ctrl = &H01
Adca_ch1_muxctrl = 32
Adca_ctrla = &H01
do
Adca_ch1_ctrl.7 = 1
Bitwait Adca_intflags.1 , Set
Adca_ch1_intflags = 1
out_adc = Makeint(adca_ch1_resl , Adca_ch1_resh)
print #6, out_adc
loop |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Thu Aug 12, 2010 10:05 pm Post subject: |
|
|
Thanks for that, sounds like most of the early problems are solved. It is indeed good to know that full 12 bit resolution is achievable, which means with the fast throughput we can get probably another couple of bits resolution by averaging.
Love the hexacopter !! _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
Kiedro
Joined: 08 Mar 2006 Posts: 81
|
Posted: Fri Aug 13, 2010 10:02 pm Post subject: |
|
|
A bit off topic, but what I really like in this forum is that things are moving on. Great work, thanks Sergiu! |
|
Back to top |
|
|
|