Why does Timer0 draw 2.5x of Timer1?

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

Tiny24 datasheet; excerpts below.  8-bit timer0 draws over twice the current of the 16-bit timer1 that has the full complement of typical AVR8 timer1 modes.  I thought that is strange.  Any ideas?

 

Opposite for Mega48PA:

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

Lee,

 

Have you tried it in real life?

It is not unknown for Atmel datasheets to have special features.

 

Mind you,  the Tiny24 is fairly old.  It is possible that the Silicon only got the "Picopower" improvements on Timer 1 and timer0 is legacy.

 

David.

 

p.s. do you know how to get Codevision to link a regular app with one function in the Boot area?   i.e. for In Application Programming.

My earlier kludge upsets the current CV.

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

david.prentice wrote:
It is not unknown for Atmel datasheets to have special features.
;)

 

david.prentice wrote:
Have you tried it in real life?

Not yet.  Doing a proof-of-concept mockup for a bid on a new app.  Won't do that detail until we get the job.

 

Now, Timer2 on an '88 also has the "higher" draw even though 8 bit.  My guess there would be the "async operation" circuitry.  But the '24 doesn't have that.

 

david.prentice wrote:
the Tiny24 is fairly old.

Curiously, Tiny1634 datasheet doesn't seem to have a table of values.  The graph seems to indicate timer1 a hair higher than timer0.

 

 

Tiny441 shows timer1 at 10uA and timer0 at 7uA;  3V

 

Re CV and bootloader -- dunno.  I haven't done a lot of bootloader work and when I did we ISPed the bootlaoder separately and never did the "combined" thing.

 

 

 

 

 

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

theusch wrote:
Re CV and bootloader --

http://www.avrfreaks.net/comment...

 

Is that still valid?

 

An earlier discussion:  http://www.avrfreaks.net/forum/c...

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.

Last Edited: Fri. Jul 1, 2016 - 03:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah-ha.  I had never noticed that.

 

I had thought of merging a HEX file as a Post-Build step.   It is nice to know there is an "official" way.

 

I will try it later.

 

David.

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

theusch wrote:

Tiny24 datasheet; excerpts below.  8-bit timer0 draws over twice the current of the 16-bit timer1 that has the full complement of typical AVR8 timer1 modes

That is nothing. According to its datasheet, an ATtiny25's Timer 1 draws ten times as much active current as Timer 0. So much for using that one in a design.

- John

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

jfiresto wrote:
According to its datasheet, an ATtiny25's Timer 1 draws ten times as much active current as Timer 0.

Wow--indeed.  And they are both 8-bit timers.  "Tiny15 compatibility mode" circuitry?  Any other guesses?

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

Any other guesses?

 

Fast peripheral clock, wider prescaler.

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

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Sat. Jul 2, 2016 - 05:50 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:
Fast peripheral clock, wider prescaler.

Good points.  For the '25 series.  But the '24 series has vanilla AVR8 8-bit timer0 and 16-bit timer1.

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

8 bit vs 16 bit timer/counter  could give different currents. Different numbers of compare registers could give different current consumptions. Remember, its not just the register, but the compare unit that goes with the register.. Differences in mode availability could give current differences - the logic to implement some of the more exotic modes could take more current. 

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

ka7ehk wrote:
Differences in mode availability could give current differences - the logic to implement some of the more exotic modes could take more current.

Indeed.  Now let's peek at what I know from the datasheet, "on the surface":

 

Timer0, 8-bit, two compare channels, six modes, T0, no ICP

Timer1, 16-bit, two compare channels, fifteen modes, T1, ICP

 

Both have seven CS selections.

 

Yet the datasheet indicates timer0 consumption ~2.5x that of timer1.

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

Both TIMER0 and TIMER1 share a prescaler.  Perhaps the quoted values for current consumption assign the prescaler portion of that draw to TIMER0 only.  Who knows.

 

16-bit timers are the new kid on the block.  Perhaps Atmel made some improvements in the underlying logic for 16-bit timers when they introduced them.  Similarly, perhaps the legacy 8-bit design was treated as a 'sleeping dog' i.e. left to lie, and therefore exhibits higher current consumption.  Who knows.

 

TIMER0 can be used as a clock source for USI.  Perhaps buffer logic required by that has an impact on the current consumption.  Who knows.

 

I know only enough about silicon-based logic design to get my face slapped at a dinner party.

 

Of course, the figures quoted may simply be an example of a datasheet errata.

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

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Sat. Jul 2, 2016 - 11:53 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:
I know only enough about silicon-based logic design to get my face slapped at a dinner party.

lol.  ditto.  Thus my query.

 

joeymorin wrote:
Of course, the figures quoted may simply be an example of a datasheet errata.

Agreed.

 

joeymorin wrote:
16-bit timers are the new kid on the block.

Now, that one needs a ???.  Through many models and feature sizes and similar, AVR8 16-bit "timer1" has been virtually unchanged for the past fifteen years or so, hasn't it?

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

Now, that one needs a ???.  Through many models and feature sizes and similar, AVR8 16-bit "timer1" has been virtually unchanged for the past fifteen years or so, hasn't it?

It surely has.  Longer I'd say.  But when were 8-bit timers introduced in the AVR8 line?  I'll give you a hint.

 

What was the first AVR with a 16-bit timer?  I guess that would be the AT90S2313?  Also 1997?  So, not really a 'new kid', except in relation to the AVR 8-bit timer, and then only by a few months.  So not really a good theory ;-) ... but there is not current consumption data by peripheral in the datasheets for those early devices.

 

 

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

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Sun. Jul 3, 2016 - 07:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:
What was the first AVR with a 16-bit timer?

I'll have to grab my 1997 databook tomorrow.  ;)  But what AVR8 did >>not<< have a 16-bit timer?  '1200 probably. [AT90S] '4433 and '8535 and '8515 did.

 

But those timer1's were not like the 15-mode type under discussion.  A couple "PWM" bits; no CTC; no selection of TOP.

 

That type arrived roughly 2001, with Mega128 and Mega8.  Interestingly, Mega163 is "old style"; Mega16 that came out less than a year later is "new style".

 

My question is largely curiosity, although we are indeed prototyping a battery Tiny24 app.  Pointing out the even-wider difference in other models is "interesting". ;)  And you came up with good guesses for the '25 series.

 

Variations between different chip designers?  Chip design "typos" that don't result in incorrect operation, but perhaps less-than-optimal current draw?

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

Sounds like a bench test is in order, to measure the real current draw of each timer and compare against the figures quoted in the datasheet.

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

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

joeymorin wrote:
Sounds like a bench test is in order, to measure the real current draw of each timer and compare against the figures quoted in the datasheet.

Well, yes.  But as various AVR models don't seem to have cut-paste numbers and in at least some cases the 8-bit timer is higher than the 16-bit my original puzzlement still stands...

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

joeymorin wrote:

Sounds like a bench test is in order, to measure the real current draw of each timer and compare against the figures quoted in the datasheet.

I'd agree.

Often difference like that, are due to differing test conditions, and test conditions are vague in data sheets.

 

In the same process and design topology, the differences between 8b and 16b at same MHz & modes, will have 8b slightly lower Icc