XMEGA ADC transfer function

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

Hi all,
There are some problems with AVR1300 and XMEGA transfer function:
1- In signed mode(GAIN=1) the conversion result from the ADC is: Result=(VINP-VINN)*TOP/VREF..The problem arises with:

Quote:
doc8077-Revision H - page 294:
With 12-bit resolution, the TOP value of a signed result is 2047 and the results will be in the range -2048 to +2047 (0xF800 - 0x07FF).

Quote:
doc8032-Revision E - page 12:
TOP is the top value given by the configured resolution, which is 2048 for 12-bit mode and 128 or 8-bit mode.

Quote:
With 12-bit resolution the range from "“VREF to +VREF will be -2048 to +2047 (0xF800-0x07FF).

If the second case is true, the maximum input value must be (2047/2048)*VREF and VREF as muximum input is not correct.

2- In unsigned mode the conversion result from the ADC is: Result=(VINP + ΔV)*TOP/VREF

Quote:
doc8077-Revision H - page 294:
In unsigned mode the TOP value is 4095

Quote:
doc8032-Revision E - page 12:
For 12-bit mode TOP is 4096 and 8-bit mode TOP is 256.

Quote:
doc8032-Revision E - page 12:
With 12-bit resolution the range from GND to VREF "“ ΔV will be from approximately 200 to +4095 (0x00C8 - 0x0FFF).

If the second case is true, the maximum input value must be (4095/4096)*VREF - ΔV.

Ozhan KD
Knowledge is POWER

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

Discard older DS revisions, use the most recent one.

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

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

MBedder wrote:
Discard older DS revisions, use the most recent one.

Problems are due to most recent revisions!

Ozhan KD
Knowledge is POWER

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

Stealing Proteus doesn't make you an engineer.

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

ArnoldB wrote:
Ask support@atmel.com

I asked atmel and I'm waitng for response.

Ozhan KD
Knowledge is POWER

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

If you haven't done so already, make certain you read these two blog postings regarding the Xmega ADC:

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

There are certainly some real issues with the Xmega ADC.

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

Thanks frank for your good hints.Please Read the new revision of ATxmega datasheets and some blog contents should be modified.For example:

Quote:
Singled-Ended Vs Differential

The Xmega is a differential 12-bit ADC that can be used in either singled-ended or differential mode. Initially I’d been using it in single-ended mode, just because it’s easier, and I’d been getting errors of magnitude well in excess of 30 counts (LSBs). Obviously that’s enormous. In fact the errata implies that errors of up to 60 LSBs are possible. That’s almost 6 bits!


Atmel changed "single-ended" to "unsigned" and "differential" to "signed" in new Revision of datasheets and above text should be modified.

Ozhan KD
Knowledge is POWER

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

Quote:
Thanks frank for your good hints.Please Read the new revision of ATxmega datasheets and some blog contents should be modified.For example:

Are you sure? The one I'm looking at says single-ended and differential. Besides, single ended and differential refer to analog hardware configurations, whereas signed and unsigned are mathematical issues.

Tom Pappano
Tulsa, Oklahoma

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

Quote:
Are you sure?

doc8068-Revision O-page 97:

Quote:
In differential mode INL is increased to:
– 6 LSB for sample rates above 1 Msps, and up to 8 LSB for 2 Msps sample rate.
– 6 LSB for reference voltage below 1.1V when VCC is above 3.0V.
– 20 LSB for ambient temperature below 0 degree C and reference voltage below 1.3V.
In single ended mode, the INL is increased up to a factor of 3 for the conditions above.

doc8068-Revision S-page 104:
Quote:
In signed mode INL is increased to:
– 6 LSB for sample rates above 1 Msps, and up to 8 LSB for 2 Msps sample rate.
– 6 LSB for reference voltage below 1.1V when VCC is above 3.0V.
– 20 LSB for ambient temperature below 0 degree C and reference voltage below 1.3V.
In unsigned mode, the INL is increased up to a factor of 3 for the conditions above.

Ozhan KD
Knowledge is POWER

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

One wonders what sort of errors one will get when using the "signed" "single-ended" mode then, as described in the manual 8-) I think a lot of the wording on the adc is awkward and even erroneous, particularly, the Vref/2 business.

Tom Pappano
Tulsa, Oklahoma

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

Am I to understand that after two years this is still not fixed? Is it possible that you are working with older releases and the the newer releases are working properly?

Smiley

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

I'm testing a rev 5 xplain board that is dated 22 Sep 2010. The adc is pretty much useless using an internal reference (for 12 bits, anyway). I am getting some encouraging results using an external reference with differential mode. More testing as we speak, hooking it up to the K5 to test the linearity.

Tom Pappano
Tulsa, Oklahoma

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

I've been waffling on whether to move to the Xmega or one of the Philips ARM chips. While I've tried to ignore most of the trollish BS that passes for advice on this topic, I'm no longer certain that the Xmega is really viable if they can't - in two years - fix a problem like this. Frankly the 2.048 external voltage reference sounds kind of nice being a millivolt per bit, but the idea that I have to add this to my PCB to fix a problem that shouldn't be there in the first place puts me off.

Tom, I trust your opinion so I'll ask what you think about the Xmega especially when compared an equivalently priced ARM?

Smiley

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

Hi Smiley,

First some good news- The external reference+diff mode seems to give acceptable results (for what I want to do, anyway). Doing a small gain + offset cal, which you would be doing anyway, over the full span it seems to track within 2 to 3 counts. For a full scale range of 2.500 volts, Vref was tweaked to 1.2614 volts while a -20 count offset was applied. (Of course the actual product would use a fixed reference and the tweaks would be all in software, but my test setup has an adjustable reference)

Down sides:

Two adc pins tied up for ext Vref and -diff

Adding the reference device itself

General irritation at having to do a work-around at all

Up sides:

No new tools to figure out!

Not having to add a $7.00 external a/d

I almost always use external precision references anyway to simplify my test procedures

I'm attracted to the xmega's multiple uarts and timers/pwm channels with their uniform features/setup, for a new product.

I can't speak to the "arms", I just have not looked into them yet, but I am curious because of all the chatter about them here.

I will try the xmega in this new widget, but it is definitely on probation. I can switch to a mega and external 12 bit a/d in a heartbeat if need be!

Tom Pappano
Tulsa, Oklahoma

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

Quote:
I've been waffling on whether to move to the Xmega or one of the Philips ARM chips.

Some XMEGA advantages over NXP Arm7 (LPC 2000):

1- LPC does not have any analog comparator and EEPROM(LPC21xx-LPC24xx).
2- LPC2000: 4 UART - XMEGA: 8 USART.
3- LPC2000: 2 SPI - XMEGA: 4 SPI.
4- LPC2000: 3 I2C - XMEGA: 4 I2C.
5- LPC2000: 1 DAC output with 10 bit resolution - XMEGA: 4 DAC outputs with 12 bit resolution.
6- LPC2000: 10 bit ADC - XMEGA: 12bit ADC.
7- Crypto Engine, quadrature decoder, Advanced waveform extension( for motor control applications) in XMEGA.
8- 128 MHz clock for PWM outputs in XMEGA(HIRES).
9- Inter peripheral hardware connection (Event system)in XMEGA.

...

Ozhan KD
Knowledge is POWER

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

electronic.designer wrote:
ArnoldB wrote:
Ask support@atmel.com

I asked atmel and I'm waitng for response.

What is the usual time for atmel replies? I have not receive anything.
Edit:Is support@atmel.com a valid email? I checked my email and yahoo is refusing to deliver this email.

Ozhan KD
Knowledge is POWER

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

Then try avr@atmel.com

Stealing Proteus doesn't make you an engineer.

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

Update:

A single port pin can serve as the external reference input *and* provide the -diff signal, leaving 7 pins available for analog input.

Tom Pappano
Tulsa, Oklahoma

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

Atmel replied:

Quote:
Dear Customer,
The datasheet is correct. TOP is 2047/4095. I will report this error.

But I asked again:
Quote:
For 4095, everything is correct. But for 2047 as TOP value, there are still problems in signed differential mode.
The transfer function is:
Result=(VINP-VINN)*TOP/VREF
and if VINP-VINN= -VREF then Result= -2047.But Result must be -2048!
I think TOP=2048 is correct with (2047/2048)*VREF as maximum input.

Ozhan KD
Knowledge is POWER

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

Atmel second answer(Does not seem to be correct):

Quote:
You are correct that the equation does not fit perferctly for the signed
mode. However, the error it introduces is far smaller than all the other
factors that makes up an actual physical system. The ADC goes from -2048 to
2047 and the equation as it is stated is valid from -2047 to 2047. The
equation is simplified, but in most cases it will give a close enough
picture of the reality.

In practice there are digital noise, inaccuracies of the power supply etc.
There are also offset and gain errors in all ADCs that has to be removed by
calibration. So in reality you will not be able to fit a real life ADC
perfectly into an equation. Thus a simplification of the equation make life
a little bit easier for the designer/engineer.

Ozhan KD
Knowledge is POWER