Pages: [1]   Go Down
Author Topic: Any chance for a micro at 128 kHz?  (Read 1134 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Italy
Offline Offline
Brattain Member
*****
Karma: 325
Posts: 22498
Logic is my way
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


0
Offline Offline
Faraday Member
**
Karma: 23
Posts: 3470
20 LEDs are enough
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Check out my experiments http://blog.blinkenlight.net

Global Moderator
Italy
Offline Offline
Brattain Member
*****
Karma: 325
Posts: 22498
Logic is my way
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


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


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...
http://arduino.cc/forum/index.php/topic,85026.msg636986.html#msg636986

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.
« Last Edit: December 31, 2011, 03:08:05 am by Coding Badly » Logged

Washington
Offline Offline
God Member
*****
Karma: 38
Posts: 790
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

0
Offline Offline
Faraday Member
**
Karma: 23
Posts: 3470
20 LEDs are enough
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Check out my experiments http://blog.blinkenlight.net

Belgium
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Just Do it (with Arduino of course)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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 (http://www.arm.com/products/processors/cortex-m/cortex-m3.php). 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...
Logged

Global Moderator
Italy
Offline Offline
Brattain Member
*****
Karma: 325
Posts: 22498
Logic is my way
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-wink
Logged


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

Quote
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".
Logged

Washington
Offline Offline
God Member
*****
Karma: 38
Posts: 790
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Most digital multimeter can measure down to uA.
Logged

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

Belgium
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Just Do it (with Arduino of course)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ?
Logged

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

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

Not in my testing / experience.

Quote
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.

Quote
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.
Logged

Pages: [1]   Go Up
Jump to: