Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
ADC VREF

 
Post new topic   Reply to topic    Forum Index -> ZX-24
Author Message
sturgessb



Joined: 25 Apr 2008
Posts: 246
Location: Norwich, UK

Posted: 23 November 2009, 12:47 PM    Post subject: ADC VREF Reply with quote

Hi

I need to hook up a 3.3v sensor (gyro) to the 5v zx. How do I set the vref on the zx to be 3.3v so I don't loose any resolution on the ADC?

I cant see a VREF pin?

Cheers

Ben
Back to top
GTBecker



Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral

Posted: 23 November 2009, 12:50 PM    Post subject: ADC VREF Reply with quote

Quote:
How do I set the vref on the zx to be 3.3v so I don't loose any resolution on the ADC?

Run the processor at 3.3v?


Tom
Back to top
sturgessb



Joined: 25 Apr 2008
Posts: 246
Location: Norwich, UK

Posted: 23 November 2009, 13:55 PM    Post subject: Reply with quote

Hi Tom

Can't do that in this instance as I need it to be stable when servos are drawing power, at the moment it resets when running at 3.3 and when resistance is introduced to the servos.

Ben
Back to top
GTBecker



Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral

Posted: 23 November 2009, 15:45 PM    Post subject: ADC VREF Reply with quote

> ... I need it to be stable when servos are drawing power, at the
moment it resets when running at 3.3 and when resistance is introduced
to the servos.

What's the cause of that problem? Solve that one and you've solved
two. Surely shared power, common ground bounce or ground loop, no?


Tom
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 23 November 2009, 15:54 PM    Post subject: Re: ADC VREF Reply with quote

sturgessb wrote:
I cant see a VREF pin?
The Aref pin, which has a capacitor on it , isn't exposed on the 24-pin ZX devices.

One option is to use the internal 2.56V reference and divide your 3.3V signal to match that. A divider using 2.2K and 7.5K resistors will yield a ratio of 0.773, reducing the full-scale 3.3V to 2.55V.

Some time ago there was a series of posts about using the differential capabilities of the ADC. The example code given shows how to use special capabilities of the ADC and could be easily modified to use a different reference as suggested above. You'll need the Atmel datasheet for the AVR device used on your ZX device. The reference selection bits are in the ADMUX register on most devices.

See http://www.zbasic.net/forum/about87.html for more details.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 23 November 2009, 16:06 PM    Post subject: Re: ADC VREF Reply with quote

GTBecker wrote:
Solve that one and you've solved two.
For most ZX devices, an operating voltage of 3.3V is out of spec for the crystal frequency. (The ZX-328L and ZX-32L, running at 7.37MHz, can run reliably at 3.3V however.)

The attached image shows the typical speed-voltage curve for AVR devices. Given the 14.7MHz operating frequency, the minimum operating voltage is 3.5V.



mega644p_speed_vs_voltage.jpg
 Description:
AVR Mega Speed-Voltage Curve
 Filesize:  18.07 KB
 Viewed:  4019 Time(s)

mega644p_speed_vs_voltage.jpg


Back to top
GTBecker



Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral

Posted: 23 November 2009, 16:28 PM    Post subject: ADC VREF Reply with quote

> ... the minimum operating voltage is 3.5V.

Do you think that his resets are due to supply droop that stops the
oscillator? Since the clock can be 0MHz, wouldn't the processor freeze
instead of reset?

Tom
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 23 November 2009, 16:52 PM    Post subject: Re: ADC VREF Reply with quote

GTBecker wrote:
Do you think that his resets are due to supply droop that stops the oscillator?
It is more likely that the supply voltage drops enough to trigger the brownout detector (preset at 2.7V). The "reset cause" can be obtained from the value of Register.ResetFlags.
Back to top
GTBecker



Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral

Posted: 23 November 2009, 17:30 PM    Post subject: ADC VREF Reply with quote

> ... more likely that the supply voltage drops enough to trigger the
brownout detector...

So supply voltage out-of-spec for the oscillator means what? That it
might not start reliably, or the frequency might be sufficiently wrong?


Tom
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 23 November 2009, 18:10 PM    Post subject: Re: ADC VREF Reply with quote

GTBecker wrote:
So supply voltage out-of-spec for the oscillator means what?
As is typically the case, the datasheet doesn't describe very explicitly what can go wrong when operating out of spec. My conjecture is that the various sub-systems (Flash, EEPROM, etc.) may fail to operate properly. Clearly, if a read of Flash memory returns the wrong value when operating out of spec things aren't going to turn out well.

We've had some customers attempt to operate ZX devices (running at 14.7MHz) at 3.3V. From all appearances, things seemed to go well until they tried to update the VM (which operation requires a Flash write). The update failed part way through leaving the device inoperable.

In the general case, operating outside the manufacturer's specifications is not a good idea.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZX-24 Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group