Internal 1.1V reference of ATtiny24

Go To Last Post
21 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

for a small project I was thinking to use the ATtiny24.
It's got all features and pins I need and an ADC with
bipolar differential inputs.

However, on reading the datasheet I stumbled on page
150 over the section about the reference selection bits:

Quote:
Internal voltage reference is connected AREF pin when
REFS1:0 is set to value ‘11’.

But in table 18-3 the value '11' is marked as reserved.

Does anyone already have some experience with this?
Is it possible to connect the internal reference to
the AREF pin?

Thank you for your efforts!

Regards
Sebastian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Sebastian !

I downloaded the latest datasheet, ref F. I come to the same conclusion: it's contradictional.

But let's think Vulcan ;) : then it makes sense that REFS1.0=11 makes Internal reference available at PA0. Follow the logic in the table. So far the datasheet makes sense. The confusing part is in the table. Atmel needs to be informed.
If you set REFS1.0=11, and PA0 is set to input, no pull-up, and 1.1V comes out (measured with a multimeter) .... then there is 99% chance that it's OK to do so.
And you may know this already, but don't load Vref (=PA0)

Theush uses Tiny's 24 44 and 84 quite a lot. You can PM him of course :)

Btw, the Dragon got its lair, see http://www.aplomb.nl/TechStuff/Dragon/Dragon.html

Cheers

Nard

A GIF is worth a thousend words   She is called Sylvia (2018), lives at Mint18.3 https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When I look in the ATtiny26 datasheet for exmaple, it says.

Quote:
Table 45. Voltage Reference Selections for ADC
REFS1 REFS0 Voltage Reference Selection
0 0 AVCC
0 1 AREF (PA3), Internal Vref turned off.
1 0 Internal Voltage Reference (2.56 V), AREF pin (PA3) not connected.
1 1
Internal Voltage Reference (2.56 V) with external capacitor at AREF pin
(PA3).

RES

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sebastian, how much more proof do you need ? Makes perfect sense, what RES posts. But still you need to send an email to Atmel IMO. It's your disclosure of the error :)

RES, when I click on the link in your signature, a white page opens briefly, text Sitecounter in upper left corner, and then Firefox terminates ! Including Freaks. Troubles on your website ? Or am I in trouble ?

Nard

A GIF is worth a thousend words   She is called Sylvia (2018), lives at Mint18.3 https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Plons wrote:
RES, when I click on the link in your signature, a white page opens briefly, text Sitecounter in upper left corner, and then Firefox terminates ! Including Freaks. Troubles on your website ? Or am I in trouble ?

Nard

You are in trouble. The Attiny Virii (?) foxed you !

(The link works just fine for me in my firefox)

Markus

Markus

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Markus ... I'll start the scans ... o blurp ... on both PC's

Nard

Edit: Java seems to be the cause ...

A GIF is worth a thousend words   She is called Sylvia (2018), lives at Mint18.3 https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, back again.
Many thanks for your fast responses!

Plons, your dragon lair looks nice.
Until now I handled my dragon with care
and nothing bad happend until now - LUCK?!?
Well, if my dragon survives until christmas, I will
have the time to build a lair for it. Thank you for
your detailed description.

I did some breadboard tests (well, it's sunday morning) and informed atmel (see below). If I get response I will post it here.

Regards
Sebastian

Hello,

it seems to me there is an error in the latest ATtiny24 datasheet.
Please take a look at page 150:

"If channels where differential gain is used ie. the gainstage, using Vcc or an optional external
AREF higher than (Vcc - 1V) is not recommended, as this will affect ADC accuracy. It is not
allowed to connect internal voltage reference to AREF pin, if an external voltage is being applied
to it already. Internal voltage reference is connected AREF pin when REFS1:0 is set to value
‘11’."

But table 18-3 says '11' for REFS1:0 is reserved.

Chapter 12.3.1 seems to approve that you can connect the internal reference to pin AREF.
Look at page 64:

"AREF: External Analog Reference for ADC. Pullup and output driver are disabled on PA0 when
the pin is used as an external reference or Internal Voltage Reference with external capacitor at
the AREF pin by setting (one) the bit REFS0 in the ADC Multiplexer Selection Register
(ADMUX)."

I wrote a simple test application to check all REFS1:0 combinations:

#include 
#include 

int main (void)
{
    DDRB = 0xFF;
    PORTB = 0xFF;
    DDRA = 0xFF;
    PORTA = 0x00;

    ADMUX = (1 << REFS1) | (1 << REFS0) | (1 << MUX0);
    ADCSRA |= (1 << ADEN);

    while (1)
    {
        PORTB = ~PORTB;
    }
   
    return 0;
}

I connected an external 33kOhm pullup resistor to the AREF pin.
The datsheet page 184 says the Reference Input Resistance is 32kOhm.
So, I expected to see Vcc/2 on the AREF pin when REFS1:0 is set for
an external reference voltage.

And yes, when I set REFS1:0 to '01' I can measure Vcc/2 on pin AREF.
With REFS1:0 = '00' and '10' I measured 0V on the AREF pin, so I think
the pin works as a general IO - everything as expected.

When I set REFS1:0 to '11' I measure Vcc/2, too on the AREF pin.
When I disconnect the external 33kOhm pull up, I measure 0V.
So I think the AREF pin is set as reference voltage input - no more IO pin.
If the ADC sees an reference voltage if I set REFS1:0 to '11' I haven't
tested yet.

Please be so kind and check the datasheet and give response.
Yesterday I already started a new topic in the AVR forum at avrfreaks.net:
"Internal 1.1V reference of ATtiny24 "
They aggree that there is an error in the datasheet.

Many thanks for your efforts!

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nice mail, Sebastian !

And yes, I think you've been lucky, but you seem to be a carefull person :)
Atmel's Dragons are not mature, they're still puppies, that need a care. And when you pick them up the wrong way, they spit fire, and burn their own muzzle ...

Java-issues solved: uninstalled update 2, update 1 and then Java runtime envirenment 6.0 (in that order), restarted winXP, visited www.attiny.com, message from FF, allowed installation of Java-plug-in, error again, close FF, restart with new session, and done.

What a visit to a fellow-freak's site can reveal ....

Thanks guyz

Nard

A GIF is worth a thousend words   She is called Sylvia (2018), lives at Mint18.3 https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Atmel's Dragons are not mature, they're still puppies, that need a care. And when you pick them up the wrong way, they spit fire, and burn their own muzzle ...

Hmmm--reminds me of Harry Potter & Hagrid:
Quote:
...a dragon egg Hagrid was nursing in a fire. Later the egg hatches a Norwegian Ridgeback dragon, and Hagrid decides to call him "Norbert".

http://en.wikipedia.org/wiki/Har...'s_Stone

IIRC the burping Norbert caused all kinds of havoc.

Note that it was a >>Norwegian<< Ridgeback...

Lee

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Note that it was a >>Norwegian<< Ridgeback...
:lol:

Quote:
Hmmm--reminds me of Harry Potter & Hagrid:
and for the Dutch (and who knows these magnificent works of Maarten Toonder are translated ...) Ollie B. Bommel en Zwelgje, de jonge Zwelbast

Nard

Attachment(s): 

A GIF is worth a thousend words   She is called Sylvia (2018), lives at Mint18.3 https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,
back again. Until now I got only response from Atmel, that the datasheet is really inconsistant regarding to the reference voltage selection bits. They need to ask the designer.

Meantime I posted an other little error to Atmel: There is no description in the datasheet about the USIBR. Yes I know what this register is for, bot others may not.
About this lack of information I got now response until today.

Today I stumbled over the ADC description once again. Maybe I just don't understand the meaning so you can point me to the right direction. But maybe its an error, too. And I have to contact Atmal ... again.

Please take a look at the ATtiny24 datasheet chapter "22.5 ADC Characteristics", "Table 22-6. ADC Characteristics, Differential Channels" (page 184).

The datasheet says the min reference voltage for differential channels is 2.0V. And the internal voltage reference is 2.4V to 2.9V. I haven't found anywhere else information about this reference voltage. If this reference doesn't exist and it's true that the min reference voltage must be 2.0V than the ADC can't operate in differential mode without an external reference - that's not nice!

Should I contact Atmel again?

Regards
Sebastian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is reason for another email IMO

But I think I can shed some light on it: any ADC has a minimum for reference voltage. This is necessary to ensure that the full binary range can be used. Think f.i. of a reference of 100 mV: @ 10 bits it would mean appr. 100 uV per bit. And that is hard when you think of noise.
So the minimum of 2V for the reference is understandable and makes sense.

It seems that Atmel uses a second reference voltage when differential mode is used. And that is indeed the confusing part.

I never used a Tiny24 so far, but the ADC-part is more powerfull than on other AVR's. Smart thingie :)

If you continue to find errors like these, you may become an AVRConsultant ;)

Cheers

Nard

A GIF is worth a thousend words   She is called Sylvia (2018), lives at Mint18.3 https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
So the minimum of 2V for the reference is understandable and makes sense.

Yes, it is. But for single ended inputs the datasheet says that the min. reference voltage is 1.0V. And the internal reference is noted to be in the range of 1.0V to 1.2V.

Regards
Sebastian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Okay ....

So it's mailing-time again

Cheers

Nard

A GIF is worth a thousend words   She is called Sylvia (2018), lives at Mint18.3 https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Done.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using ATtiny84A.

According to the datasheet (Rev. 8006K–AVR–10/10, Page145) the ADMUX bit (REFS0=1) and (REFS1=1) are reserved for future use and that the Internal 1.1V reference is not brought out to pin 13 PA0 -n AREF.

Having read a number of conflicting reports that there is an error in the data sheet I would like this confirmed.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

TrekRiderEX9 wrote:
I am using ATtiny84A. According to the datasheet (Rev. 8006K–AVR–10/10, Page145) the ADMUX bit (REFS0=1) and (REFS1=1) are reserved for future use and that the Internal 1.1V reference is not brought out to pin 13 PA0 -n AREF. Having read a number of conflicting reports that there is an error in the data sheet I would like this confirmed.

I haven't used the model, so I cannot "confirm" or not.  But a few things...

-- there is a newer datasheet dated June 2012

https://www.microchip.com/wwwpro...

http://ww1.microchip.com/downloa...

 

-- in the Datasheet Revision History is an item that seems pertinent:

27.4 Rev. 8183C – 03/11
1. Added:

...
2. Updated:

...

Table 16-4, “Single-Ended Input channel Selections,” on page 145, added note for
Internal 1.1V Reference

...

 

Hmmm--the page 145 note has to do with settling time for internal reference selection to "take".

 

Since we are warned not to put anything on PA0 when the internal reference is used, why do you say that the bandgap does not show up on the AREF pin?  But indeed, there isn't the usual text about a capacitor on the pin.

Internal voltage reference options may not be used if an external voltage is being applied to the
AREF pin.
 

 

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK theusch, thanks for exploring that for me. The newer data sheet (8183F–AVR–06/12 Page 144) also says with REFS0 =1 AND REFS1=1 Reserved. And as I cannot read 1.1 Volt at the AREF (PA0) pin when they are set I  must assume that the internal reference is not brought out whereas on the ATmega328/P where on the data sheet page - DS40001984A-page 317  REFS0 =1 AND REFS1= Internal 1.1V voltage reference with external capacitor at AREF pin making it possible to attach a capacitor to the reference.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

TrekRiderEX9 wrote:
also says with REFS0 =1 AND REFS1=1 Reserved.

So?  Then there is probably no valid ADC work with that combination as reference.  Not that unusual.

 

TrekRiderEX9 wrote:
nd as I cannot read 1.1 Volt at the AREF (PA0) pin when they are set I must assume that the internal reference is not brought out

But what about REFS1 = 1 and REFS0 = 0?  Does it appear then?  As I said earlier, I suspect so as there is a warning to not connect a level.  Have you tried it?  What is the purpose of your questions?  If it is to drive external circuitry I would be skeptical wfor >>any<< AVR8 model without e.g. a follower op amp; not much drive.

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No the internal reference voltage never appears at AREF pin.

I asked the question because there is some confusion in the data sheet on page 60 of 8183F–AVR–06/12 it says:

• AREF: External Analog Reference for ADC. Pullup and output driver are disabled on PA0 when the pin is used as an external reference or Internal Voltage Reference with external capacitor at the AREF pin by setting (one) the bit REFS0 in the ADC Multiplexer Selection Register (ADMUX).

 

But then in the same data sheet page 144  it says with REFS0 =1 AND REFS1=1 Reserved.

 

Also in the Application Note AN2537 ,  AVR125: ADC of tinyAVR® in Single Ended Mode,  DS00002537A-page 8

• The reference voltage can be made more immune to noise by connecting a capacitor between the AREF pin and ground

 

I also read somewhere that warning about connecting to the PA0, but I cant find that warning now.

 

Anyway I am using the PA0 as digital out and all seems OK at the moment, analog input is after all an alternative function for PA0 so it should be OK.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't see that either of those references suggest that the Internal Reference voltage should appear on the pin?

 

They both just say that you can attach a capacitor there to "improve" the internal reference.

 

 

EDIT

 

Datasheet Rev. 8183F–AVR–06/12 wrote:
16.6.2 ADC Voltage Reference

 

The internal 1.1V reference is generated from the internal bandgap reference (VBG) through an internal amplifier. The first ADC conversion result after switching

So, presumably, attaching the external capacitor affects that amplifier.

 

 

The block diagram (Fig 16-1) gives no suggestion that the internal Vref is fed back to the pin:

 

 

 

TrekRiderEX9 wrote:
...pin by setting (one) the bit REFS0 in the ADC Multiplexer Selection Register (ADMUX).

 

But then in the same data sheet page 144  it says with REFS0 =1 AND REFS1=1 Reserved

So what's the confusion there?

That's simply saying that having both REFS0 and REFS1 set together is not allowed;

You can have only REFS=0 with REFS1 = 1

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. Mar 15, 2018 - 10:53 AM