ADC on ATXmega128A1

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

:(
Has anyone managed to setup the ADC in the Xmeag128A1 for single ended 12 bit operation. I would like to get 0 to 4096 bits. All of Atmels single ended examples are differential inputs which gives half the resolution.
The data sheets are not clear as to which registers to set. The ASF and example codes are different. The examples use two different drivers, ADC_driver.c and ADC.c. Not sure why.
Sample code would help.

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

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

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

Search the forum for adc and xmega, and try what I did

Tom Pappano
Tulsa, Oklahoma

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

tpappano wrote:
Search the forum for adc and xmega, and try what I did
Hey Tom,

What did you try?

I have pretty managed to get most modes running using the examples, but the single ended unsigned mode has eluded me. Oh for 4096 bits.
I am still waiting for a reply from support.Atmel.no ,but it looks like from what I have read on blogs that this option may be wishfill thinking.

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

Try doing this, it will give you a 4096 count single-ended behavior and good performance. (do let us know if the latter proves true for you)

Quote:
From the "XMega ADC Question" thread:

Quote:
I'll save you some pain, it will work this way:

Use external 1.22v (or thereabouts) reference

Use differential input mode

Route "-" differential input to 1.22 Vref (using mux options)

Read result as "signed"

The adc range will be 0-(Vref*2) volts

Apply whatever math you need to correct gain and offset, and create whatever numerical presentation you want.

Let us know if this seems to work for you. There will likely be a small offset (maybe ~20 counts) that needs to be compensated arithmetically, and which may prevent you from reading the first couple mv above ground, unless you do a slight external level shift with a couple resistors.

_________________
Tom Pappano
Tulsa, Oklahoma

Tom Pappano
Tulsa, Oklahoma

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

The PCB is finished. I cannot fit an external Vref. I am also waiting for answers from Atmel support. The last answer was to use the AVR1300 example. I cannot see the example doing 12 bits single ended. I have tried them.
I am starting to believe there is a hugh problem with the Xmega ADC. I am not sure why Atmel support are so silent about it?

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

If you want to get 12 bits and usable accuracy, you may have to glue a reference on somehow, or redo the board. The data sheets detailed a lot of the adc problems, but sadly the descriptions of the adc operating modes seemed like gibberish to me. That 11 bit nonsense didn't show up until I actually wired one up and tested it.

Tom Pappano
Tulsa, Oklahoma

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

indianajones11 wrote:
All I have is this:
http://blog.frankvh.com/category...

Wow! It's like you have an auto reply set up whenever someone posts with the words 'xmega' and 'adc' :wink:

Really nice on the blog though. It saved me a LOT of time, that's for sure. I think my solution is to just tie a clean 2V signal into the VREF pin.

rodl wrote:
The PCB is finished. I cannot fit an external Vref.

That really sucks. Can you reorder?

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

It does seem Atmel cannot do what it says in the manual that it can do. I have dropped the Xmega ADC for a trusted mega ADC. When I have some time I will add a external vref.

Thanks for all your help.

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

Hi,
Is the problem with XMega ADC solve.
I am also about to kick start a project using XMega and ADC.

M.Pathma

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

Pathma wrote:
Hi,
Is the problem with XMega ADC solve.
I am also about to kick start a project using XMega and ADC.

XMEGAs have still some resolution problems. What are your resolution and conversion time requirements?

Ozhan KD
Knowledge is POWER

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

Hi, Electronic Designer,

After reading all the issue on Xmeage, I took in some Xmega board from MikroE, I was unit release ID :7, which should be stable.

So far I did not see any major issue on this chip, I am using BASCOM-AVR, have not played with AVR-GNU.

My management decide to go with PIC24FJ for this project because worry of the stock and hidden issue.

Atmel should really concentrate the 100s and 1000s customer base.

Honestly, as Product Developer, I love XMega, it has the possibility to be the defector chip in our design needs. If Atmel can ensure the low volume supply stability like PIC.

M.Pathma

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

Quote:

Atmel should really concentrate the 100s and 1000s customer base.

Why? They probably sell more AVRs to their top ten customers than the rest of the world combined - it's their needs they'll concentrate on.

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

clawson wrote:

Why? They probably sell more AVRs to their top ten customers than the rest of the world combined - it's their needs they'll concentrate on.

And what about responsibility?

Ozhan KD
Knowledge is POWER

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

Quote:
And what about responsibility?

Atmel's primary (and, practically only) responsibility would be to their stockholders.

Tom Pappano
Tulsa, Oklahoma