View previous topic :: View next topic |
Author |
Message |
karlos
Joined: 03 Apr 2015 Posts: 107
|
Posted: Fri May 13, 2016 5:49 am Post subject: Xmega ADC offset and linearity calibration |
|
|
Hi
I see a topic related to calibration of xmega adc offset using factory set registers previous week ,but now i can not find that topic.
who can i calibrate xmaga adc using this registers?
if the value of offset is not important for me, and difference of two value be important,is it need to calibrate offset? can the offset affect the linearity of adc?
thanks
(BASCOM-AVR version : 2.0.7.8 )
Last edited by karlos on Fri May 13, 2016 10:44 am; edited 1 time in total |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Fri May 13, 2016 8:27 am Post subject: Re: Xmega ADC offset and linearity calibration |
|
|
karlos wrote: | I see a topic related to calibration ...
...but now i can not find that topic. |
Talk about an oxymoron. |
|
Back to top |
|
|
Deanus
Joined: 26 May 2006 Posts: 188 Location: Adelaide
|
|
Back to top |
|
|
karlos
Joined: 03 Apr 2015 Posts: 107
|
Posted: Fri May 13, 2016 10:48 am Post subject: |
|
|
thanks Deanus
it was related to Xmega offset,the topic you mentioned is good also. but i read in that topic that xmega has a register that hold the value of offset measured in company and set in a fixed value in registers. i want to find that topic. or if you know about it,please help me.
thanks |
|
Back to top |
|
|
laborratte
Joined: 27 Jul 2005 Posts: 299 Location: Berlin
|
Posted: Fri May 13, 2016 11:32 am Post subject: |
|
|
There are calibration values in the production signature row for ADC linearity. I.E. for a xmega128D4 the values for ACA can be found at position &H20 and &H21. See datasheet (chapter memories) for the correct positions for your device.
To calibrate use code like this:
Code: |
adca_call = readsig(&H20)
adca_calh = readsig(&H21)
|
The offset depends on VREF, so there can't be an fixed value for that. As shown in datasheet (chapter ADC) the offset has to calculated as VREF * 0.05. |
|
Back to top |
|
|
JC
Joined: 15 Dec 2007 Posts: 585 Location: Cleveland, OH
|
Posted: Fri May 13, 2016 5:17 pm Post subject: |
|
|
Also know that the actual calibration values might not exist!
See the Errata section of the data sheet for the exact Xmega you are using.
For at least some of the Xmegas, the calibration wasn't performed, and the data wasn't loaded into the registers.
Next, have you actually made your own graph of Vin vs the ADC reading, (converted to a voltage, if that is easier)?
On many of the Xmegas the ADC is very good without additional corrections, I guess it depends on just how accurate you need to be.
For a large production run it would clearly be easier if the internal calibration registers worked.
If you are only building a couple of boards, the it might be easier to measure and calibrate them manually.
Again, depending upon how accurate you need to be, and how many "spare pins" you have, you can connect one ADC input to Ground, and another to an on board Vref, and have your software automatically measure the offset and slope. This won't be quite as perfect as making the measurements with a single ADC input pin, but the pin to pin difference feeding the same ADC module, on the same die, will be very low, therefore it is often a very reasonable method of performing a self calibration.
JC |
|
Back to top |
|
|
karlos
Joined: 03 Apr 2015 Posts: 107
|
Posted: Sat May 14, 2016 5:22 am Post subject: |
|
|
thanks a lot laborratte and JC.
Regards |
|
Back to top |
|
|
|