Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
rodl
PostPosted: Feb 15, 2011 - 06:16 AM
Newbie


Joined: Aug 19, 2002
Posts: 17


Sad
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.
 
 View user's profile Send private message  
Reply with quote Back to top
indianajones11
PostPosted: Feb 15, 2011 - 07:33 AM
Raving lunatic


Joined: Nov 28, 2004
Posts: 3552
Location: San Diego, Ca

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

_________________
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
 
 View user's profile Send private message  
Reply with quote Back to top
tpappano
PostPosted: Feb 15, 2011 - 08:07 AM
Raving lunatic


Joined: Dec 01, 2003
Posts: 2502


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

_________________
Tom Pappano
Tulsa, Oklahoma
 
 View user's profile Send private message  
Reply with quote Back to top
rodl
PostPosted: Feb 17, 2011 - 03:27 AM
Newbie


Joined: Aug 19, 2002
Posts: 17


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.
 
 View user's profile Send private message  
Reply with quote Back to top
tpappano
PostPosted: Feb 17, 2011 - 04:37 PM
Raving lunatic


Joined: Dec 01, 2003
Posts: 2502


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
 
 View user's profile Send private message  
Reply with quote Back to top
rodl
PostPosted: Feb 19, 2011 - 05:22 AM
Newbie


Joined: Aug 19, 2002
Posts: 17


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?
 
 View user's profile Send private message  
Reply with quote Back to top
tpappano
PostPosted: Feb 19, 2011 - 08:41 AM
Raving lunatic


Joined: Dec 01, 2003
Posts: 2502


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
 
 View user's profile Send private message  
Reply with quote Back to top
GordonFreeman
PostPosted: Feb 19, 2011 - 08:41 PM
Hangaround


Joined: Oct 30, 2008
Posts: 333
Location: Minnesota, USA

indianajones11 wrote:

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?
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
rodl
PostPosted: Mar 03, 2011 - 11:39 AM
Newbie


Joined: Aug 19, 2002
Posts: 17


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.
 
 View user's profile Send private message  
Reply with quote Back to top
Pathma
PostPosted: Mar 03, 2011 - 03:27 PM
Newbie


Joined: Sep 17, 2006
Posts: 12
Location: Malaysia

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

M.Pathma
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
electronic.designer
PostPosted: Mar 04, 2011 - 12:05 PM
Hangaround


Joined: May 27, 2010
Posts: 396
Location: The land of Cyrus the Great

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 K.
 
 View user's profile Send private message  
Reply with quote Back to top
Pathma
PostPosted: Mar 27, 2011 - 12:34 PM
Newbie


Joined: Sep 17, 2006
Posts: 12
Location: Malaysia

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
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: Mar 27, 2011 - 02:22 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62320
Location: (using avr-gcc in) Finchingfield, Essex, England

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.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
electronic.designer
PostPosted: Mar 28, 2011 - 12:23 PM
Hangaround


Joined: May 27, 2010
Posts: 396
Location: The land of Cyrus the Great

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 K.
 
 View user's profile Send private message  
Reply with quote Back to top
tpappano
PostPosted: Mar 29, 2011 - 03:24 AM
Raving lunatic


Joined: Dec 01, 2003
Posts: 2502


Quote:
And what about responsibility?


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

_________________
Tom Pappano
Tulsa, Oklahoma
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits