Arduino Forum

Using Arduino => Microcontrollers => Topic started by: JChristensen on Sep 20, 2011, 12:59 pm

Title: ATtiny85 revision C
Post by: JChristensen on Sep 20, 2011, 12:59 pm
Does anyone happen to have one of these? If I'm reading the markings correctly, I think this chip I've had for a little while is Rev. B:

      (Top)
         1004
      ATTINY85
        20PU

      (Bottom) 
      6G6   864
      B      1P
      1004   e3


Also have a newer chip just recently received, I was hoping to get the latest and greatest, but it looks like I only went from Rev B to B1:

      (Top)
         1031
      ATTINY85V
        10PU

      (Bottom) 
      6H5   250
      B1     1P
      1031   e3


Anyway I was hoping to use the software BOD disable which is only available in Rev C and later. It acting like it's not there, so I guess I'm out of luck  :(
Title: Re: ATtiny85 revision C
Post by: johnwasser on Sep 20, 2011, 04:40 pm
My guess is that the 1004 and 1031 mean that your chips were made in the 4th and 31st weeks of 2010.  That would make your 'newer' chip about a year old.

The datasheet doesn't show any revision dependency on BOD, just on "Enhanced Power-On Reset".  You should be able to disable the Brown-Out Detection interrupt in any revision.
Title: Re: ATtiny85 revision C
Post by: JChristensen on Sep 20, 2011, 04:51 pm
Thanks, John, that's the way I read the dates too.

I can disable the BOD just fine by setting the fuse byte, but to do so via software is evidently not universal. I'll check for a new datasheet, the one I was using is Rev. 2586M-AVR-07/10, which says

Quote
7.2.1 Limitations
BOD disable functionality has been implemented in the following devices, only:
• ATtiny25, revision E, and newer
• ATtiny45, all revisions
• ATtiny85, revision C, and newer


Shoulda got a '45  :~
Title: Re: ATtiny85 revision C
Post by: Coding Badly on Sep 20, 2011, 05:18 pm

Why do you need the BOD?


From an 85V sitting on my desk...

Top...
1015
ATTINY85V
10PU

Bottom...
6H0   738
B8    1P
1015  e3
Title: Re: ATtiny85 revision C
Post by: JChristensen on Sep 20, 2011, 06:40 pm

Why do you need the BOD?


Playing with a battery-powered (2xAA) circuit that shuts itself off by going into power-down mode. Thought it good to have the BOD enabled for the reasons stated in the datasheet. Quiescent current is ~22-25µA with the BOD enabled, and <0.5µA with it disabled. As a practical matter, it probably makes no difference whatsoever, but half a microamp is just too cool!  XD

Was able to accomplish similar results with an ATmega328P. Configure the BOD via the fuses, then turn it off just before going to sleep. It turns itself back on automatically when coming out of power-down mode.

Title: Re: ATtiny85 revision C
Post by: Coding Badly on Sep 20, 2011, 07:01 pm
Playing with a battery-powered (2xAA) circuit that shuts itself off by going into power-down mode. Thought it good to have the BOD enabled for the reasons stated in the datasheet.


I remember two things: possible Flash corruption and possible EEPROM corruption.  Was there anything else?

Quote
Quiescent current is ~22-25µA with the BOD enabled, and <0.5µA with it disabled. As a practical matter, it probably makes no difference whatsoever


Well, that depends on the application.   ;)

Quote
but half a microamp is just too cool!


Agreed!

As far as I can tell, the 85V (internal oscillator at 1 MHz) is reliable down to 1.6 volts.  The alkaline batteries I use (two AA) consistently die between 1.6 V and 1.8 V.  For me, the nice thing about sans BOD is that I can run the batteries essentially dead.

For the next gadget, my plan is to add Vcc measuring...
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1294478456/all
http://arduino.cc/forum/index.php/topic,56750.msg407897.html#msg407897

Running an 85V, the alkaline batteries have a long linear voltage range so the gadget should be able to roughly estimate the time-to-death.
Title: Re: ATtiny85 revision C
Post by: JChristensen on Sep 20, 2011, 07:37 pm

I remember two things: possible Flash corruption and possible EEPROM corruption.  Was there anything else?


The processor might also execute instructions incorrectly.

Quote
Well, that depends on the application.


Well, mine, of course!  Baha!

Quote
As far as I can tell, the 85V (internal oscillator at 1 MHz) is reliable down to 1.6 volts.  The alkaline batteries I use (two AA) consistently die between 1.6 V and 1.8 V.  For me, the nice thing about sans BOD is that I can run the batteries essentially dead.


Define "die" ... are you saying the oscillator stops at ~1.6V?

Quote
For the next gadget, my plan is to add Vcc measuring...
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1294478456/all
http://arduino.cc/forum/index.php/topic,56750.msg407897.html#msg407897


You know, I saw that in the datasheet and just out of curiosity played around trying to read the bandgap voltage one day. Don't remember if I managed to get any reasonable numbers out or not. But the trick of using it to measure Vcc that way hadn't occurred to me, that's very clever!

Title: Re: ATtiny85 revision C
Post by: Coding Badly on Sep 20, 2011, 08:38 pm
Quote
Define "die" ... are you saying the oscillator stops at ~1.6V?


The batteries are able to provide enough power just long enough that the application starts to run.  After about a tenth of a second, the power drops too low and the processor stops running.  After a very brief moment, the batteries recover and the whole process restarts.  The gadget says "hello" by beeping and flashing two LEDs so it's a rather disturbing experience.

From the symptoms, my guess is that RESET is asserted.
Title: Re: ATtiny85 revision C
Post by: JChristensen on Sep 20, 2011, 08:48 pm

From the symptoms, my guess is that RESET is asserted.


By the BOD? Thought you had it disabled?
Title: Re: ATtiny85 revision C
Post by: Coding Badly on Sep 20, 2011, 08:52 pm

Not by the BOD.  The BOD is most definitely disabled.  The application behaves like RESET was asserted.  If the oscillator stopped, presumably the SRAM and the registers would retain some or all of their state and the application would, at least some of the time, continue rather than starting over.
Title: Re: ATtiny85 revision C
Post by: JChristensen on Sep 20, 2011, 09:01 pm
Yikes. I might turn on the BOD!
Title: Re: ATtiny85 revision C
Post by: Coding Badly on Sep 21, 2011, 12:30 am

Good idea.  I can get away with no BOD because of the application.  The worst thing that could possible happen is that the batteries will have to be replaced.
Title: Re: ATtiny85 revision C
Post by: JChristensen on Oct 03, 2011, 08:06 pm
Well, I couldn't stand it and had to pick up some t45's to try. The BOD can indeed be turned off; when sleeping, I get readings of 0.1 or 0.2µA. Sometimes I see 0.0µA, and sometimes -0.1µA! Hey, I might just have an over-unity microcontroller! If I can manage to wire a hundred thousand or so together, I should be able to light an LED. Actually, 0.1µA is the resolution of my meter, so probably not the most accurate measurement.
Title: Re: ATtiny85 revision C
Post by: Coding Badly on Oct 03, 2011, 09:01 pm

Oh man!  I am *so* jealous!  I want a processor that defies the laws of thermodynamics!

Bummer about the 85s, though.

My meter always shows 0.2 uA when the value is at or below that.  I figure ... 2.535 Ah batteries * 2 batteries / 0.1 uA = ~ 50,700,000 hours of operation = ~ 191,147.64 years = batteries gonna be dead long before that because that's the way batteries are.  Anything below ((2 * 2.535) / (5 * 365.24)) * 1000 = 2.776 mA = ~ 5 years is good enough for what I'm doing!
Title: Re: ATtiny85 revision C
Post by: JChristensen on Oct 03, 2011, 10:25 pm
Haha, I know, I figure it's a natural for some of the projects we discuss here! Actually the t85's are fine, I think they still meet your five-year test by a comfortable margin, so I'm plenty good with that!
Title: Re: ATtiny85 revision C
Post by: putyn on Oct 05, 2011, 08:56 am


Oh man!  I am *so* jealous!  I want a processor that defies the laws of thermodynamics!

Bummer about the 85s, though.

My meter always shows 0.2 uA when the value is at or below that.  I figure ... 2.535 Ah batteries * 2 batteries / 0.1 uA = ~ 50,700,000 hours of operation = ~ 191,147.64 years = batteries gonna be dead long before that because that's the way batteries are.  Anything below ((2 * 2.535) / (5 * 365.24)) * 1000 = 2.776 mA = ~ 5 years is good enough for what I'm doing!


wouldn't the battery life depend on the amount of current the attiny needs when it wakesup ?
Title: Re: ATtiny85 revision C
Post by: Coding Badly on Oct 05, 2011, 10:03 am

The usual method is to determine the sleep current consumption, determine the awake current consumption, calculate an average consumption based on the sleep / awake ratio, and then use the average to estimate battery life.

But, I wrote that to make a point to Jack.  For a Christmas gift, turning off the BOD is irrelevant.  Any average current consumption between 0.1 uA and 2.776 mA is going to get the gadget to the five year mark; long after Christmas is over and the children have lost interest.