Pages: [1]   Go Down
Author Topic: View fuse settings  (Read 1384 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 127
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I had a project that was floundering because I was attempting to run an arduino at 3.3v (2xaa batteries), and the brown out detection was shutting things down at 2.7v. i have edited boards.txt and changed the brown out detection fuse to kick in  1.8v which is working.
-I am however still running the arduino at 16mhz, is this ok?
-Could I safely disable the bod?
-Does running the chip at 8mhz use less power? (I feel stupid asking this!)
-Can I set any 328p chip up to run from the internal oscillator and program it via the IDE, or will the timings be too far off?
-Is there any way to view the fuse settings of a chip?

Thanks!
Here is the original thread that set me on the correct path!

http://arduino.cc/forum/index.php/topic,75545.0.html
« Last Edit: October 24, 2011, 12:20:07 pm by inboxjason » Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry I dont know enough to answer your other questions, but you can view the fuses by running his sketch:

https://github.com/WestfW/fusebytes

Good luck!
Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4816
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It most definitely uses more power to run faster, less power to run slower.

Looking in the ATMEL doc (ATMEL ATmega doc8271.pdf) I see many different power options allowing use of less and less power just by running at lower and lower clock speed. That's not the only way to save power either. You can run at 128kHz internal oscillator or even an external 32kHz watch crystal if desired but don't forget that there is also a clock divider, the pre-scaler which may divide by powers of 2 from 1 to 256.

Factory default is 8MHz oscillator pre-scale divided by 8 = 1MHz, that is how the chips are shipped and they can certainly be ISP'd at that speed.

Your oscillator may be running at 16MHz but unless the default divider was changed, your clock is 2MHz.

Silicone may vary even across the same wafer. Some chips may get away with what others won't. The specs are made with margins in mind. But figure on this -- temperature matters so the edge you may be able to skirt now might just give you unreliable performance later.

Quote
9.2.1 Default Clock Source
The device is shipped with internal RC oscillator at 8.0MHz and with the fuse CKDIV8 programmed,
resulting in 1.0MHz system clock. The startup time is set to maximum and time-out
period enabled. (CKSEL = "0010", SUT = "10", CKDIV8 = "0"). The default setting ensures that
all users can make their desired clock source setting using any available programming interface.

Quote
9.11 System Clock Prescaler
The ATmega48A/PA/88A/PA/168A/PA/328/P has a system clock prescaler, and the system
clock can be divided by setting the ”CLKPR – Clock Prescale Register” on page 387. This feature
can be used to decrease the system clock frequency and the power consumption when the
requirement for processing power is low. This can be used with all clock source options, and it
will affect the clock frequency of the CPU and all synchronous peripherals. clkI/O, clkADC, clkCPU,
and clkFLASH are divided by a factor as shown in Table 29-12 on page 324.

What the Arduino board needs OTOH is the bootloader on the chip and perhaps oscillator and divider set for 16MHz to run properly?

Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Offline Offline
Full Member
***
Karma: 0
Posts: 127
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@ Chris  - that is just what I was looking for - thanks!!
@GoForSmoke - Didn't realise speed affected power draw! I should really have used the mcu at 1mhz and left out the crystal, nevermind though, I have learned a huge amount about atmel chips recently! I don't really need speed with this project, just a low battery draw. It's amazing how versatile and flexible these chips can be!

Thanks again!
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4816
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are other power saving options. Here are a few selected parts on that:

Quote
10. Power Management and Sleep Modes
Sleep modes enable the application to shut down unused modules in the MCU, thereby saving
power. The AVR provides various sleep modes allowing the user to tailor the power consumption
to the application’s requirements.

Quote
10.3 Idle Mode
When the SM2...0 bits are written to 000, the SLEEP instruction makes the MCU enter Idle
mode, stopping the CPU but allowing the SPI, USART, Analog Comparator, ADC, 2-wire Serial
Interface, Timer/Counters, Watchdog, and the interrupt system to continue operating. This sleep
mode basically halts clkCPU and clkFLASH, while allowing the other clocks to run.
Idle mode enables the MCU to wake up from external triggered interrupts as well as internal
ones like the Timer Overflow and USART Transmit Complete interrupts. If wake-up from the
Analog Comparator interrupt is not required, the Analog Comparator can be powered down by
setting the ACD bit in the Analog Comparator Control and Status Register – ACSR. This will
reduce power consumption in Idle mode. If the ADC is enabled, a conversion starts automatically
when this mode is entered.

Quote
10.10 Minimizing Power Consumption
There are several possibilities to consider when trying to minimize the power consumption in an
AVR controlled system. In general, sleep modes should be used as much as possible, and the
sleep mode should be selected so that as few as possible of the device’s functions are operating.
All functions not needed should be disabled. In particular, the following modules may need
special consideration when trying to achieve the lowest possible power consumption.

I do forget where I got the link to the ATMEL doc but LOL, here it is! Got to have the manual to RTFM!
http://www.atmel.com/dyn/resources/prod_documents/doc8271.pdf

The first few times I dived into it, it put me into eyes-crossed or sleep mode but after a while I learned to recognize the material and can find whole sections to understand. That's normal for me and tech docs.
 


Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Offline Offline
Full Member
***
Karma: 0
Posts: 127
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah, a fair few people on here have referenced the datasheet, and I am slowly learning to read it. A lot of useful info densely tucked away in there - it's deciphering it thats tricky!
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4816
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The first few passes may be just learning to recognize words and context before you really begin to decipher what it's about.  smiley-wink But since the docs are not just nonsense and opinion (unlike say politics and other soap operas) but about actual things that work it does become possible to fully understand.



Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Humboldt, CA
Offline Offline
Full Member
***
Karma: 2
Posts: 223
Arduino BBB
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I expect that the MCU will crash well before it reaches 1.8v if it's being run at 16MHz.
Officially speaking it takes 3.8v to run 16MHz.
In reality 3.3v is fine, but the lower you go the more likely it is that you'll have issues.
If precise timing isn't needed I would switch to using the internal 8MHz oscillator, or even the internal with the speed cranked down to 1MHz.  That will buy you a lot of low voltage room.
Logged

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

If you need precise timeing RTC is the way to go. The Arduino crystal can not easily compete with any RTC in terms of long term stability.
Logged

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

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6792
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Heh.  I don't know if this will make sense to anyone from a certain generation of Americans, but it's cute...



* AVR-Voltage.jpg (18.08 KB, 600x306 - viewed 31 times.)
Logged

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

By accident I connected a tiny to 9V. It survived more than 5 Minutes till I noticed it. I can not recommend it though smiley-wink
Logged

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

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 506
Posts: 19120
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't really need speed with this project, just a low battery draw.

An interesting thing I discovered recently was that by turning off brown-out detection altogether (via a fuse setting) I reduced sleep mode from 75 uA to 6 uA. That's a BIG saving!

So the irony is that using brownout detection to find when your battery is going low, can itself cause the battery to go low.

You may be able to get a tiny current draw by using a combination of sleep modes, watchdog timers, slow clock speeds, turning off internal features (like the ADC converter), and turning off brownout detection.
Logged


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

How come that you still draw >5uA? As far as I remember my experiments you can go down to ~0.5-1uA.
Logged

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

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 506
Posts: 19120
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Good question. However in my test I think I was running at 16 MHz.

I am guessing that if I drop the speed down to 1 MHz I may get better results.
Logged


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

This may be the issue. I was running with an RC oscillator instead of a crystal. I think this reduced power consumption further. BTW: crystals with lower load caps will reduce power consumption as well. If a crystal is needed and frequency is being reduced (to decrease the voltage) it is better to use a slower crystal instead of prescaling a faster crystal.
Logged

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

Pages: [1]   Go Up
Jump to: