xmega32A4: how many ADC inputs?

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

Hi,

According to the xmega32A4 datasheet there are 12 ADC inputs: 8 on port A and 4 on port B, labelled ADC0-11. So I designed a circuit with an xmega32A4 using all the ADC pins. When I went program the ADC I looked at the mega A datasheet for info, only to find no mention of these extra ADC pins. I am stuck until I can get the info on how to set up the ADC system to read these inputs.

Thanks for the help!

--TimR

Tim Ressel
Portland, OR
timr@earthling.net

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

madhun,

I had a similar problem with the comm ports when I designed my first AtXmega PCB. I was relying on my previous AtMega expereince a bit too much and didn't realize that the X-Mega data sheets are composed differently and it took a bit of "relearning" to get used to the new presetnation. (Just what I have time for!)

Anyway, I don't have direct experience with the 12 ADC channels yet, but I think if you look at Table 30-2 on Page 51 (My data sheet appears to be the "12/10" version) you will see that the other four ADC inputs are "alternate" functions for Port B.

Now, how you actually route signals these into the ADC, I don't know how to do that yet.

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

madhun,

Another point...

Do you have a copy of the Atmel "XMEGA A MANUAL". It's 445 pages long. This is different from the 32A4's "data sheet" which is only 108 pages long. The "A Manual" has all of the nuts-&-bolts details about he ADC.

This is part of what I mean by the new format of the X-Mega Data Sheets. Information is spread around over different documents.

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

Yes I do have the xmega A manual. That is where I tried to find the mux programming info for the funky A4 ADC pins.

Tim Ressel
Portland, OR
timr@earthling.net

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

From the MUXCTRL register description: in the XMEGA A manual:
"For devices with more then 8 inputs into an ADC multiplexer, the MUXPOS3 bit is used to select
ADC channels 8 (ADC8) and above."

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

Boy, you really have to read the data sheet carefully!

Thanks so much!

--TimR

Tim Ressel
Portland, OR
timr@earthling.net

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

Quote:

Boy, you really have to read the data sheet carefully!


Surely if you were planning to use ADC you'd read the ADC chapter in both d/sheets until you understood every last detail? How is this different to the use of any other CPU?

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

madhun,
I recently wrote my first routine for reading the AtXmega128A. Very simple exercise, just read a single ended voltage from a potentiometer on AD0 using the 1.0 Volt internal reference.

Before I started to write the very simple routine this turned out to be, and realizing the ADC in these XMega chips is quite complex, I made a Xerox copy of the ADC chapter of the "A Manual". I then read the chapter very carefully and underlined in red pencil everything I considered to be important, unusual for ADC's I am more familiar with, odd bit assignments and polarities, dependencies, etc.

Then I went thru the chapter a second time and marked up the register settings I thought I would need to read just that one AD0 input in a simple single-ended way.

Then I wrote the routine itself and tested it on my XPLAINED board. It worked!

I will be using this ADC in much more complicated and complex ways for future projects. But I will "dabble" with a few simple test set-ups first to get my feet wet and learn te ways of this complex XMega ADC in a few carefully taken "bites" before I subject myself to a dose of computerized torture I know this thing is capable of inflicting on me if I jump in headfirst.

I don't know your level of expertise, but unless you are genius-level, I'd suggest a similar approach.

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

If using ADC then if you haven't read this already see:

http://blog.frankvh.com/2010/01/...

and

http://blog.frankvh.com/2010/09/...

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

clawson,

Thanks for those links. Very enlightening!

This is a good example of one of the problems I have with Atmel's documentation. The AVR1300 App Note is not mentioned in the XMega A Manual or in the three XMega Data Sheets I've been working with (128A, 32A4
and 128D4).

Why not? When I search for it by title (i.e. AVR1300) on the Atmel site it shows up for sure and I now have a copy, which I could have used when I was writing my first XMega ADC code snippets. But how would I know to go looking for this in the first place?

And that's one of my big complaints with the Atmel documetnation, you just kinda have to stumble into things.

Love the chips, but their documentation needs to have alotta love paid to it by somebody at the factory!!!

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

Chuck-Rowst wrote:

This is a good example of one of the problems I have with Atmel's documentation. The AVR1300 App Note is not mentioned in the XMega A Manual or in the three XMega Data Sheets I've been working with (128A, 32A4
and 128D4).

Why not? When I search for it by title (i.e. AVR1300) on the Atmel site it shows up for sure and I now have a copy, which I could have used when I was writing my first XMega ADC code snippets. But how would I know to go looking for this in the first place?

And that's one of my big complaints with the Atmel documetnation, you just kinda have to stumble into things.

Love the chips, but their documentation needs to have alotta love paid to it by somebody at the factory!!!

Just for future experiments; If you go to the product page of your device (search for atxmega32a4, or browse to microcontrollers -> 8bit -> xmega -> atxmega32a4) you will get a "Documents" tab at the top of the data card that shows application notes, trainings, manuals and datasheets that are relevant to that part. The list includes the "Using peripheral X" application notes.

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

Hi,
in xmega a4 datasheet it says that there are 8x4 differential inputs for ADC. What does it mean?
For example, how many two wire sensors can you connect in differential mode?
I have xmega32a4 mcu.
In my opinion it is only possible to connect 4. Am I right?
Thanks

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

No, you really do have 8X4 differential input "pairs", for a total of 32 (depending on how you want to look at it).

On Port A, you have 8 input pins. 4 of these must be used for the "Negative" input of a differential measurement. That leaves the other 4 for the "Positive" input of a differential measurement. Port B also alternately can provide 4 additional inputs, all of which must be used as the "Positive" input of a differential measurement.

Okay, so you have 8 Positive Pins, and 4 negative pins. That means you have 8x4 possible combinations of differential pairs, although you are stuck with only 4 distinct "Negative" inputs.

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

Also tell me what is the maximum number of input voltages can be measured with ATxmega32A4U? 

What does the datasheet say?(1st page)  Also please start a new thread, this is already 4 years old. [[Done. Ross]]

 

We appreciate the effort you have put in in doing a search anyway.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Wed. Jan 21, 2015 - 11:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi John, 

 

I guess the New Forum's split a Thread function still isn't working quite right, I saw the Thread I think you split off of this (old) Thread, but your follow up comment remained here.

 

Either that, or you got a little too much heat and sun out on the beach, and now you are just running around having conversations with yourself!

 

JC

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

Thread I think you split off

Not responsible, I don't split threads (or atoms or hair...)  smiley

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly