Pages: 1 [2]   Go Down
Author Topic: Attiny85  (Read 2365 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12285
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If I  was using an ATtiny85 using the internal oscillator at 8Mhz divided down to 1 Mhz via the prescaler, which option would I use in the IDE:

ATtiny85 @ 1 MHz  (internal oscillator; BOD disabled)

Quote
Is there any difference in power usage,

1 MHz = less power.

Quote
speed of processing,

1 MHz = 8 times slower.

Quote
running at 1Mhz with no prescaler?

Using what clock?
Logged

Offline Offline
Sr. Member
****
Karma: 1
Posts: 334
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yea..just stay with those that I want to use.

Thanks
Logged

Offline Offline
Sr. Member
****
Karma: 1
Posts: 334
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If I  was using an ATtiny85 using the internal oscillator at 8Mhz divided down to 1 Mhz via the prescaler, which option would I use in the IDE:

ATtiny85 @ 1 MHz  (internal oscillator; BOD disabled)


So means if 8MHz, delay(1000) will run it as delay 1s? how if 16MHz?


« Last Edit: November 14, 2012, 02:38:27 am by Vincent19 » Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12285
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So means if 8MHz, delay(1000) will run it as delay 1s? how if 16MHz?

No.  As long as you have the correct board selected, delay will work correctly.
Logged

Australia
Offline Offline
Sr. Member
****
Karma: 10
Posts: 392
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Using what clock?

I thought that 1 Mhz internal was an option - I was wrong . But assume a 1 Mhz crystal.

Quote
1 MHz = less power.
1 MHz = 8 times slower.

I realise that, but imagine two Atmega328: system #1 - 8Mhz divided down to 1 Mhz.  System #2 - 1 Mhz crystal, no divisor.

Both systems have a 'final' clock of 1 Mhz. I assume that both would complete a loop of (say) 100 iterations in the same time.

Are there any any notable performance/efficiency differences between system #1  and system #2?

Also, if I programmed an Arduinos fuses to use the internal oscillator, do I need to remove the crystal to ensure stability?


Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4535
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Using what clock?

I thought that 1 Mhz internal was an option - I was wrong . But assume a 1 Mhz crystal.


On an ATtiny85? The hardware can certainly do it, it's how the chips are configured at the factory.

If you're not seeing that option in the IDE then you have an incorrect IDE setup.

Quote
1 MHz = less power.
1 MHz = 8 times slower.

I realise that, but imagine two Atmega328: system #1 - 8Mhz divided down to 1 Mhz.  System #2 - 1 Mhz crystal, no divisor.

Both systems have a 'final' clock of 1 Mhz. I assume that both would complete a loop of (say) 100 iterations in the same time.

Are there any any notable performance/efficiency differences between system #1  and system #2?

1mHz is 1mHz no matter where it comes from. Performance is the same.

But...the internal oscillators aren't as accurate as an external crystal. They vary a little bit with supply voltage and temperature (see the datasheet). If you need very precise timing you have to use external components (this is the reason Atmel gives us options).

Also, if I programmed an Arduinos fuses to use the internal oscillator, do I need to remove the crystal to ensure stability?


It won't make any difference to stability because the crystal is completely ignored.

OTOH removing the crystal gives you two extra I/O pins - worth having on a Tiny85!
« Last Edit: November 15, 2012, 02:01:54 pm by fungus » Logged

No, I don't answer questions sent in private messages...

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12285
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
1 MHz = less power.
1 MHz = 8 times slower.

I realise that, but imagine two Atmega328: system #1 - 8Mhz divided down to 1 Mhz.  System #2 - 1 Mhz crystal, no divisor.

Both systems have a 'final' clock of 1 Mhz. I assume that both would complete a loop of (say) 100 iterations in the same time.

Almost.  As @fungus mentioned there will very likely be a difference in clock speeds.  The crystal will very likely be very close to exactly 1 MHz.  The internal oscillator will very likely not be close to 1 MHz.  (Tuning will get the internal oscillator to ±1%.)

Quote
Are there any any notable performance/efficiency differences between system #1  and system #2?

Yes.  The crystal will very likely be more stable and more accurate over the range of temperatures and voltages.

Yes.  Driving an external crystal takes more energy.  (Also, I think the startup time is longer.)

Quote
Also, if I programmed an Arduinos fuses to use the internal oscillator, do I need to remove the crystal to ensure stability?

No.  When using the internal oscillator, the XTAL1 and XTAL2 pins become normal I/O pins.  You can have whatever you want (within reason) connected to the two pins.  The internal oscillator does not care.
Logged

Australia
Offline Offline
Sr. Member
****
Karma: 10
Posts: 392
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
On an ATtiny85? The hardware can certainly do it, it's how the chips are configured at the factory.

I think what you are referring to is a factory configuration of 8Mhz divided down to 1 Mhz. What I was talking about was an internal clock of 1 Mhz with no divisor.

I am trying to understand why the chip has two configurations that are essentially the same: 8 Mhz divided down to 1Mhz and 1 Mhz with no divisor. What is the point of the dividing of the clock rate? Why don't they just get us to set the clock rate that we require rather than selecting one that is too high and then dividing back?

It s bit like buying and eight cylinder car and removing the spark plugs from four of the cylinders because you only want a four cylinder car.  Why not just select a four cylinder engine in the first place?
« Last Edit: November 15, 2012, 05:27:26 pm by lemming » Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12285
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What I was talking about was an internal clock of 1 Mhz with no divisor.

Just so we're clear on the matter, that does not exist on an ATtiny85.  It has two internal clock sources: an 8 MHz oscillator and the 128 KHz watchdog oscilator.

Quote
I am trying to understand why the chip has two configurations that are essentially the same: 8 Mhz divided down to 1Mhz and 1 Mhz with no divisor.

It does not.  It has an 8 MHz internal oscillator.

Quote
What is the point of the dividing of the clock rate?

Save energy.

Quote
Why don't they just get us to set the clock rate that we require rather than selecting one that is too high and then dividing back?

Cost and complexity.

Quote
It s bit like buying and eight cylinder car and removing the spark plugs from four of the cylinders because you only want a four cylinder car.

Which several modern vehicles do automatically to save energy.

Quote
Why not just select a four cylinder engine in the first place?

Because some applications require the extra horsepower.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4535
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am trying to understand why the chip has two configurations that are essentially the same: 8 Mhz divided down to 1Mhz and 1 Mhz with no divisor.

I don't think it has an internal 1MHz clock.
Logged

No, I don't answer questions sent in private messages...

Pages: 1 [2]   Go Up
Jump to: