The Arduino (Mini) Board (ATmega328P) runs with 5V at 16 MHz with a RC oscillator. If I want to run it at a lower Vcc (eg 3V), the 16 MHz are out of spec.
I know the formula in the datasheet, however, I am uncertain whether the mentioned clock rate corresponds to the frequency before or after the clock divider.
So I am wondering if the fusebit "Divide Clock by 8" would solve this problem. So externaly the µC would still see 16 MHz but internally the frequency would be 2MHz. Is this inside the specification again at ~3V?
I know what the datasheet says about clock rates and voltages.
What I am uncertain about is whether the clock rate is the "input clock rate" or the "downscaled clock rate" if the fuse bit "Divide Clock by 8" is turned on.
I've wondered the same thing. So the question really is whether the oscillator is within spec e.g. at 16MHz and 3V, even though the CPU is within spec with the CKDIV8 fuse bit programmed.
PS: I think the answer is YES based on Note 3 on p29 of the datasheet:
If the crystal frequency exceeds the specification of the device (depends on VCC), the CKDIV8 Fuse can be programmed in order to divide the internal frequency by 8. It must be ensured that the resulting divided clock meets the frequency specification of the device.
That note is for the low-power XO and there are similar notes for the full-swing XO and for the internal RC osc.
I think the fuse bit only applies to the internal 8MHz clock.
There's another prescaler that you can write to in software:
"8.12.2 CLKPR – Clock Prescale Register
Bits 3..0 – CLKPS3..0: Clock Prescaler Select Bits 3 - 0
These bits define the division factor between the selected clock source and the internal system clock.
These bits can be written run-time to vary the clock frequency to suit the application requirements.
As the divider divides the master clock input to the MCU, the speed of all synchronous peripherals is
reduced when a division factor is used.
fungus:
I think the fuse bit only applies to the internal 8MHz clock.
Not so, see Reply #3 above. The CKDIV8 fuse bit just determines the initial value of CLKPR. If CKDIV8 is set, then CLKPR is set to divide by eight, else, it's set to divide by one.
The Arduino (Mini) Board (ATmega328P) runs with 5V at 16 MHz with a RC oscillator.
Incorrect. A resonator is used, which is not the same at as an RC oscillator.
Do you have a programmer? It's simple enough to change the fuses in boards.txt to enable the divide by 8 circuit to run at 2 MHz and see how things look.
Change the speed there to 2000000UL as well.
Which means that @halfdome could change the divisor to two in setup resulting in the processor running at 8 MHz. The processor would always be within specifications for 3 volts but the final speed would be more reasonable.
I agree. After rereading it my post is confusing. I meant have the CKDIV8 fuse bit set and adjust the divisor in setup. Initialization would be at 2 MHz. Everything else would be at 8 MHz.