Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Xmega ADC offset and linearity calibration

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
karlos

Bascom Member



Joined: 03 Apr 2015
Posts: 107

PostPosted: Fri May 13, 2016 5:49 am    Post subject: Xmega ADC offset and linearity calibration Reply with quote

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
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Fri May 13, 2016 8:27 am    Post subject: Re: Xmega ADC offset and linearity calibration Reply with quote

karlos wrote:
I see a topic related to calibration ...
...but now i can not find that topic.

Talk about an oxymoron.
Back to top
View user's profile
Deanus

Bascom Member



Joined: 26 May 2006
Posts: 188
Location: Adelaide

australia.gif
PostPosted: Fri May 13, 2016 8:54 am    Post subject: Reply with quote

Maybe this one ?

http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13394&highlight=offset
Back to top
View user's profile
karlos

Bascom Member



Joined: 03 Apr 2015
Posts: 107

PostPosted: Fri May 13, 2016 10:48 am    Post subject: Reply with quote

Deanus wrote:
Maybe this one ?

http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13394&highlight=offset


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
View user's profile
laborratte

Bascom Expert



Joined: 27 Jul 2005
Posts: 299
Location: Berlin

germany.gif
PostPosted: Fri May 13, 2016 11:32 am    Post subject: Reply with quote

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
View user's profile
JC

Bascom Member



Joined: 15 Dec 2007
Posts: 586
Location: Cleveland, OH

usa.gif
PostPosted: Fri May 13, 2016 5:17 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
karlos

Bascom Member



Joined: 03 Apr 2015
Posts: 107

PostPosted: Sat May 14, 2016 5:22 am    Post subject: Reply with quote

thanks a lot laborratte and JC.

Regards
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum