I'm using the ADC on an attiny26 in single-ended mode with voltage reference set to external reference on the AREF pin. I've noticed a strange thing: when I set the voltage on the AREF pin to lower than ~1.6V, the output of the ADC saturates (0x3ff.) This is even when there's no signal on the ADC input.

it was tied low. But before that, I fed the ADC a signal. When I adjusted Vref, the range of ADC values got larger the smaller I set Vref. But at ~1.6V it just saturated, abruptly too (I expected it would just clip)

Anyway, what does the datasheet say about minimum reference voltage?

o-ohkay.... Thank you so much! I missed this, I was CTRL-F'ing the datasheet, but only for "AREF."

And there I was thinking one could ADC-convert arbitrarily small voltages and get full scale resolution by setting Vref to roughly the Vpp of the signal, from a peak detector (because ADC=Vin/Vref*1024) as a kind of software AGC :)

And there I was thinking one could ADC-convert arbitrarily small voltages and get full scale resolution by setting Vref to roughly the Vpp of the signal, from a peak detector (because ADC=Vin/Vref*1024) as a kind of software AGC :)

That would be nice, certainly. Sadly, underneath all software is hardware, which is quite unforgiving. :)

And there I was thinking one could ADC-convert arbitrarily small voltages and get full scale resolution by setting Vref to roughly the Vpp of the signal, from a peak detector (because ADC=Vin/Vref*1024) as a kind of software AGC :)

Remember earlier I "commented" on the Tiny26 model choice?

Step into the new decade, and what are the options on the substitute Tiny261?

So, now you select the internal bandgap reference, and roughly 1mV per ADC count. [yes, the initial tolerances aren't that good -- we do a one-time cal at ISP time]

And you still have the optional 20x gain for really tiny stuff. [and again, with all that entails measuring tiny signals]

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

I think these new "fancier modes" are due to the original ADC ext AREF pin being tied to the internal source (when selected)...so you couldn't switch back & forth between your own supplied ext ref & the internal bandgap --they'd collide at the pin.

The mega88 has a min Vref of 1V...makes sense, since its internal bandgap ref is 1.1V (+/-10%)

I think these new "fancier modes" are due to the original ADC ext AREF pin being tied to the internal source (when selected)...so you couldn't switch back & forth between your own supplied ext ref & the internal bandgap --they'd collide at the pin.

The mega88 has a min Vref of 1V...makes sense, since its internal bandgap ref is 1.1V (+/-10%)

Butting in but trying to understand this for an attiny25. Would the "when selected" qualification mean you can switch back and forth (just not fast)? Also will it be possible, on an attiny25 to select the "BG" as the table calls it as input when AREF is the reference? The reference table metions that selecting AREF turns off the internal reference. That would seem to imply that wont work, but it's not quite clear.

Butting in but trying to understand this for an attiny25. Would the "when selected" qualification mean you can switch back and forth (just not fast)? Also will it be possible, on an attiny25 to select the "BG" as the table calls it as input when AREF is the reference? The reference table metions that selecting AREF turns off the internal reference. That would seem to imply that wont work, but it's not quite clear.

Which table, exactly? This one, I assume?:

The datasheet also has this:

Both are misleading. The internal voltage reference will be >>disconnected<< from the ADC as a reference, but not necessarily 'turned off'.

"Experience is what enables you to recognise a mistake the second time you make it."

why would one have the internal reference as input to the ADC (single-ended mode, too)? I just looked and the 25/45/85 (and the 26L) indeed let one do it. calibration? to get 1/x response (x being Vref)?

Oops, I didn't get back to this for a while. Thanks for the helpful reply joeymorin. The need for this may have disappeared for the moment, but it could still end up useful. Yes, reading vcc is the reason I would (and do) use internal reference as input. You have to invert the result as stated (one way or another). Sorry, yes, I may have derailed the thread a little or maybe it was already derailed a little, but this seemed to fit. I think it was theusch who sent me here, lol. He did say he was losing track though.