XMEGA A1U Xplained Pro - Trick to using ADC?

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

Greetings, All.

 

I am attempting to use the ADC on the XMEGA A1U Xplained Pro.  It's just test code, which is supposed to make conversions on four ADC input pins every second and output the results as ASCII decimal over the UART - I am faking a datalogger for some testing.  The code is working fine, but the ADC results are noisy as all get-out.  I do not have an external reference (none were supplied on the Xplained Pro), so I have tried using the internal 1.1V band-gap, the VCC/1.6, and VCC/2 references.  Regardless of the reference, the results are noisy - they bounce around by as much as 10 LSBs.  The results are less noisy if I drop the conversion clock from 1MHz to 250kHz, but still too noisy in my thinking.  The ADC is configured as signed, single-ended.  I have tried setting the MUXNEG to the pad GND and internal GND, makes no difference.  Impedance mode makes no difference.  Checking the voltage inputs to the PCA with a DMM shows them to be rock-solid.

 

Has anyone out there gotten relatively noise-free ADC conversions out of an XMEGA A1U Xplained Pro?  If so, could you please share your tricks?  Thanks!

 

Altazi

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

Altazi wrote:
Checking the voltage inputs to the PCA with a DMM shows them to be rock-solid.  

A DMM is useless for this - it is very heavily averaged -  you need an oscilloscope!

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

What is your voltage source feeding the ADC?

 

If you are not measuring high frequency signals, then add a cap, perhaps 0.1 uf, from the ADC pin to ground to help[ filter out some of the noise.

 

Additionally, of course, you can take the average of several readings to also eliminate some of the jitter in the signal.

 

JC

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

If short the inputs then can evaluate total noise due to internal reference, ADC noise, and gain amp (if it's enabled)

There's one typical value for this in the datasheet (0.4mVrms) at one specific case though that's likely for an external reference.

 

"Dare to be naïve." - Buckminster Fuller

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

Altazi wrote:
I do not have an external reference (none were supplied on the Xplained Pro), so I have tried using the internal 1.1V band-gap, the VCC/1.6, and VCC/2 references.  Regardless of the reference, the results are noisy - ...
Appears that the several instances of noise data in the datasheet are typical values with an external reference.

There's no PSRR values in the XMEGA A1U datasheet; measure Vcc (noise, stability) (wall wart - noise, stability) (USB hub VBUS - noise, stability) (USB host VBUS - noise, stability)

When in doubt, replace USB VBUS with a battery (power header, http://www.atmel.com/webdoc/xmegaa1uxplainedpro/xmegaa1uxplainedpro.connectors.power_connector.html)

4S AAA fully charged NiMH is about 5.2V (not on a charger), almost discharged is 4.4V (enough drop for the board's LDO, spec'd at 1V drop, Exar SPX3819R2-L/TR, adjustable set for 3.3V, not the low noise configuration, minimal PSRR data in SPX3819 datasheet)

 

PA0, Port A AREF, alternate signals header pin 1 (well, there's pads)

PB0, Port B AREF, alternate signals header pin 2

, GND, alternate signals header pin 12

per http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42211-XMEGA-A1U-Xplained-Pro_User-Guide.pdf (page 17)

 

XMEGA128A1U rev L errata :

ADC is non-functional in SE unsigned mode with VREF below 1.8V

so you're good to go with the as stated signed SE or could try differential.

 


https://www.exar.com/product/power-management/power-conversion/ldos-and-regulators/linear-ldos/spx3819

 

"Dare to be naïve." - Buckminster Fuller

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

The voltage is just as solid when measured with a scope.  The ADC is being fed with voltage dividers connected to a battery pack, impedance to ADC input is 9.0k ohms.  Thanks.

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

I did an experiment with a custom target PCA that I designed, which also uses the ATxmega128A1U MCU, and added the same ADC measurement code. Here are graphs made from the resulting data.  All other conditions are the same, except the target PCA power supply hardware.  The ADCs are configured to use the internal 1.1V bandgap reference, both have the same input circuitry & voltage - a resistive divider on a battery pack.

 

.XMEGA_XPLAINED_PRO_ADC

The above graph shows the ADC bouncing around all over the place.  Edit: This is the data from the Xplained Pro.

 

CUSTOM_TARGET_ADC

This graph shows the improved stability of the data.  No filtering, averaging, or other tricks.  Edit: This data is from my custom target.

 

So, I ask my original question - has anyone achieved good performance with the XPLAINED PRO A1U ADC?  If so, how?  Thanks!

 

Altazi

 

Attachment(s): 

Last Edited: Mon. Oct 30, 2017 - 05:21 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Altazi wrote:
The above graph shows the ADC bouncing around all over the place

Not really.

 

It shows ~10 count variation on ~500; so around 2% - which is not so bad. Certainly it's not "all over the place".

 

Admittedly, your own board is a lot better.

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

Hi awneil,

 

My board was the one I was using as a comparison, when I said the data was 'all over the place.'  Unfortunately, my board is a dedicated design, and not really suited for generic testing & experimentation - most of the I/Os are used up.  <sigh>

 

Back to the drawing board (?)

 

Altazi

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

Altazi wrote:
Back to the drawing board (?)
or operate a third party board.

The MattairTech XMEGA128A1U board has an LDO with some PSRR and noise data (versus LDO on Microchip's board) and an optional voltage reference; if need memory on EBI then that's on a MattairTech plug-in board (1MB SRAM)

The Alvidi board's LDO is a common 1117 with the XMEGA's analog reference inputs on two of the board's pins.

Mcuzone has two XMEGA128A1U boards.

 

https://www.mattairtech.com/index.php/development-boards/mt-x1s-atxmega128a1-u-usb-development-board.html

(schematic, page 2 of 2)

Schematic for MattairTech XMEGA128A1U board, page 2 of 2

http://www.ti.com/product/LP38690/datasheet/specifications#snvs32215704

http://www.alvidi.de/products/EN/AVR_Development_Boards/avr_modul_xavrb_v20.php

http://www.taiwansemi.com/en/products/details/TS1117BCW33

https://www.aliexpress.com/store/product/ATxmega128A1U-EK-development-board-1-8-TFT-LCD-12Bit-ADC-and-DAC-8-USARTs-PDI-JTAG/800571_32827450345.html

https://www.aliexpress.com/store/product/ATMEL-ATxmega128A1U-mini-board-12Bit-ADC-12Bit-DAC-8UART-USB-2-0-Full-Speed-Device-JTAG/800571_1345195217.html

 

Edit: Mcuzone

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Mon. Oct 30, 2017 - 05:02 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Altazi wrote:
My board was the one I was using as a comparison (sic?), when I said the data was 'all over the place.' 

I think we're losing something in translation here!

 

You mean, your board was the one you were referring to when you said that the data was 'all over the place.'  ?

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

Haha!  No, my board was the less noisy one.  I had previous experience with its ADC performance, and was kind of expecting similar results from the Xplained Pro.  But NO . . . The Xplained Pro's ADC data was 'all over the place'.

 

Your suggestions are welcome.  Of course, I have two of the Xplained Pro boards . . . a bird in the hand.  I will look into these other boards, or maybe I will just create another custom board that will be exactly what I want.

 

Thanks!

 

Altazi

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

The Xplained boards are clearly general purpose, show off the hardware boards, but are clearly NOT optimized for any specific purpose, such as low noise ADC readings.

 

One of the first Xmega boards, (I don't recall which one), had the DAC feeding a small amplifier and a speaker on the PCB, used to show off the internal DAC module which the normal Tiny and Mega micros don't have.

 

Unfortunately, it was a rather poor layout signal routing wise, and when the DAC was holding on a value the amp would pick up the micro's noise and one heard a loud background electronic hiss noise.

One had to mute the amplifier if one didn't have a loud, dynamic, audio signal to drown out the electronic hiss.

 

Anyway, I suspect your custom PCB, with attention to signal routing and analog ground connections, will give superior performance.

 

JC  

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

DocJC wrote:
One of the first Xmega boards, (I don't recall which one), had the DAC feeding a small amplifier and a speaker on the PCB, used to show off the internal DAC module which the normal Tiny and Mega micros don't have.

Microchip Technology Inc

Microchip

AVR Xplain

http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=ATAVRXPLAIN

...

... and the DAC can be used to generate sound on a mono speaker.

...

"Dare to be naïve." - Buckminster Fuller

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

You are being very confusing!

 

Altazi wrote:
 my board was the less noisy one

That's what I thought.

 

That's why I said, in #8:

your own board is a lot better

 

As DocJC said, the XPro is not particularly optimised, so wouldn't be expected to give "great" performance - but, as noted, it's "not bad"