spamiam
Joined: 13 Nov 2005
Posts: 666
|
|
Posted: 25 August 2010, 18:00 PM Post subject: ZX-24X ADC resolution |
|
|
I was looking at the specifications of the ZX-24X. It says that the ADC resolution is 10 bits. The ATXmega device it uses is capable of 12 and 8 bits resolution. I presume that the 2 least siginficant bits of the 12 bit sample are lost in order to maintain compatibility with the ZBasic standard 10 bit software.
Is this true that the 2 bits are lost? If so, is it possible to read the ADC register directly to get the full 12 bits? Is it possible to know when there is a new ADC result available, rather than just re-read the old result?
-Tony |
|
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 25 August 2010, 20:30 PM Post subject: Re: ZX-24X ADC resolution |
|
|
| spamiam wrote: | | Is this true that the 2 bits are lost? |
No, the result returned is a 12-bit value but there are issues on the xmega chip that render the result accurate only to 10 bits or so. There have been several discussions on AVR Freaks about this defect.
| spamiam wrote: | | Is it possible to know when there is a new ADC result available, rather than just re-read the old result? | A new result will never be available until some time after a new conversion cycle is begun. Although GetADC() doesn't use it, you can configure the ADC on both mega and xmega devices to "free run", meaning that as soon as one conversion is completed it automatically begins another. In this mode, you have to read bits of the status register to know when a new result is available. The device datasheet describes what is necessary to do to implement this mode. |
|