ADC VREF

Discussion specific to the 24-pin ZX microcontrollers, e.g. ZX-24r, ZX-24s and ZX-24t.
Post Reply
sturgessb
Posts: 287
Joined: 25 April 2008, 6:34 AM
Location: Norwich, UK

ADC VREF

Post by sturgessb »

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
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

ADC VREF

Post by GTBecker »

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
Tom
sturgessb
Posts: 287
Joined: 25 April 2008, 6:34 AM
Location: Norwich, UK

Post by sturgessb »

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
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

ADC VREF

Post by GTBecker »

> ... 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
Tom
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: ADC VREF

Post by dkinzer »

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.
- Don Kinzer
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: ADC VREF

Post by dkinzer »

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.
Attachments
AVR Mega Speed-Voltage Curve
AVR Mega Speed-Voltage Curve
mega644p_speed_vs_voltage.jpg (18.07 KiB) Viewed 5824 times
- Don Kinzer
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

ADC VREF

Post by GTBecker »

> ... 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
Tom
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: ADC VREF

Post by dkinzer »

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.
- Don Kinzer
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

ADC VREF

Post by GTBecker »

> ... 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
Tom
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: ADC VREF

Post by dkinzer »

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.
- Don Kinzer
Post Reply