Any chance for a micro at 128 kHz?

I've tried to use the internal oscillator that can produce a signal clock of 128 kHz with the Arduino software but I had no luck to obtain a working micro.
I programmed the fuses on a standalone Atmega328 and created a virtual board in the file boards.txt specifying a clock of 128000 for the CPU frequency and uploaded the Blink example but the micro seems freezed.

I was searching less power consuming, so a clock of 128 kHz would be interested.

If you changed the fuses you have an ISP. Once you change the fuses to 128kHz the bootloader will not work anymore. But hey, you have an ISP. Use the ISP for upload. There is no need to use the bootloader at all.

Thank for your reply but maybe I didn't explain the question.

I don't have an ISP programmer, I'm using the ArduinoISP sketch and a micro in standalone (it can be an Atmega328 or a Tiny85).
My question is: can I use the Arduino IDE to write a working sketch for a micro clocked at 128 kHz? I'm able to set the fuses of the micro but I cannot compile a sketch for a micro set to 128 kHz.

You can but the SPI bit rate has to be slowed to the target processor clock speed / 2 / 2 = 32K. The Arduino ISP sketch uses an SPI bit rate of 400K 125K.

@smeezekitty may have a version that will work for you...

The working theory from the people on avrfreaks.net is that, for most applications, a lower processor speed actually increases the total power consumption. The idea is that the processor has a certain amount of work to do when it is awake. Lowering the processor speed increases the amount of time the processor has to be awake thus increasing the total power consumption.

For my projects, this seems to be partially true. 1 MHz processor clock seems to be the sweet spot. Slower than that and the application does not work correctly. Faster than that and the supply voltage would have to be increased. In my testing, a lower supply voltage has the single biggest impact on power consumption followed by sleeping the processor.

Edit: Bit rate corrected.

Regardless. There is sometimes advantages to a lower clock speed. e.g. something that cannot be sufficiently slowed down by normal means. Also power consumption could be either lower or higher. You would need to actually measure it to know for sure.
I was able to successfully program a MCU at 128khz (see my thread).
Also the MCU works down to 1.3v stability although it would not recommend it if reliability means anything.

As always it depends. Power = Voltage * Current. Voltage can be lowered if frequency is lowered. The Charge consumption per Cycle is proportional to the Voltage and does not depend on the frequency. So Current is proportional to Frequency. But since a given task will consume the same number of cycles no matter how the frequency there is nothing to gain by lowering the frequency once the voltage can not be lowered anymore.

Everything of course assuming that you will never be idle waiting.

Lowering the frequency by dividing the oscillator is a little bit more tricky. What I said above will still hold true for everything but the oscillator. That is the oscillator will consume the same current no matter if the clock is divided or not. Thus lowering the clock by dividing will increase the total power consumption because the processor will have to stay awake longer.

But total power consumption is even more tricky. It will not only depend on the processor but on the external circuits as well. So as you correctly stated lowering the frequency may increase or decrease the power consumption depending on the circumstances.

@leo72,

Since the thread says roughly "it depends", I guess the key here is to measure the consumption for an extended period of time. Do you have any means to do that ? I plan to do some tests with an ACS712, but not sure how to go that way.

One related link of interest is ... abut the Cortex-M3 (Cortex-M3). It says that basically, going 32-bit should allow you to lower your consumption because the number of instructions is smaller, hence lower MHz possible and/or higher idle times for a given program.

I wish the Arduino IDE could be enhanced to support these chips...

smeezekitty:
Also the MCU works down to 1.3v stability although it would not recommend it if reliability means anything.

This persuaded me to use the chips at 1 MHz, thanks :wink:

I guess the key here is to measure the consumption for an extended period of time. Do you have any means to do that ? I plan to do some tests with an ACS712, but not sure how to go that way.

Use batteries to power the device and measure the time it takes to "run dead".

Most digital multimeter can measure down to uA.

Well, the battery drain time is highly variable (probably 20-50%), and is not easy to detect precisely (if it goes dead at night...) and most multimeters do not "average" (if the system sleeps). Some shunt system with analog integration and ... arduino recording should be better and a nice project, shouldn't it ?

tochinet:
Well, the battery drain time is highly variable (probably 20-50%),

Not in my testing / experience.

and is not easy to detect precisely (if it goes dead at night...)

Log to EEPROM, log to computer, or toggle an output and have another board log.

Some shunt system with analog integration and ... arduino recording should be better and a nice project, shouldn't it ?

It would certainly be more convenient.