Pages: [1]   Go Down
Author Topic: Question about brownout setting  (Read 1757 times)
0 Members and 1 Guest are viewing this topic.
Central MN, USA
Offline Offline
Tesla Member
***
Karma: 75
Posts: 7303
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've just read the reset section on the atmel ATMEGA328 document. I wonder what brownout voltage is set for ATMEGA328 by arduino software. I found several posts on the forum but was still unclear.

Can someone with experience on brownout tell me whether arduino software sets this setting and what voltage it is? Is it sufficient to prevent FLASH corruption? Thanks.
Logged


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


From boards.txt (came with the Arduino IDE; the following is from 0019)...
Quote
atmega328.bootloader.low_fuses=0xFF
atmega328.bootloader.high_fuses=0xDA
atmega328.bootloader.extended_fuses=0x05

Off to my favorite fuse calculator...
http://www.engbedded.com/fusecalc

Gives us a BOD level of 2.7V.

Quote
Is it sufficient to prevent FLASH corruption?
Can't say.  Someone else will have to answer that question.
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 75
Posts: 7303
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you CodingBadly. The calculator is interesting, took a while to understand how to use it. So there is a setting for brownout voltage 4.3V. Maybe this is more strict but safer?
Logged


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

Quote
Maybe this is more strict but safer?
It depends...

I have a hand-held kitchen timer sort of device that runs directly from 2 AA batteries.  I have the BOD disabled.  Why?  Because I don't care if the battaries can't provide enough energy for the device to run correctly.  In the worst case, the thing makes strange noises instead of beeping, flashes an LED erratically, or doesn't keep time.  In this case, BOD disabled is perfectly safe1.

For an Arduino controlling a very large engine that compresses natural gas for transportation down a pipeline a disabled BOD is certainly NOT safe.

Basically, the processor is guaranteed to function correctly at a certain voltage and clock speed.  The BOD should be set based on the clock speed and the circumstances.  In other words, only you can decide what's "safer".


1  In the sense that no one will be injured.  The same can't be said for what's cooking!
Logged

0
Offline Offline
Edison Member
*
Karma: 0
Posts: 1103
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What is BOD all about?
When power fails,or the power is just switched off regularly, this is not a spontanious event. Depending on the caps it can take seconds during which the voltage slowly drops down.

Different functional devices inside the processor will stop their working at different voltage levels; so it will give some confusion for the program, as instructions will no longer work as expected. The best way is to keep the processor in a reset state as soon as the supply voltage drops below a "safe" margin. If you run @ 20MHz, 4.3 Volts is a safer value....

BOD is a very important feature. In older professional designs there was always an external BOD chip for this purpose (otherwise they would not have been considered "professional"" :-) )
« Last Edit: September 12, 2010, 06:53:26 am by mpeuser » Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 75
Posts: 7303
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks guys! FLASH corruption is what I want to aviod. Any suggestions on which voltage I should use, 2.7V or 4.3V? I'm running  328 at 16MHz. Since instructions could be entirely retrived wrong if FLASH is under powered, some instruction may BECOME say WRITE FLASH XXX, which was supposed to be totally different instructions under proper voltage. This will corrupt FLASH. It may not happen very often, only when battery is low, but is still problematic.
Logged


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

Quote
2.7V or 4.3V? I'm running  328 at 16MHz
From "Figure 28-1. Maximum Frequency vs. VCC" in the '328 datasheet 10 MHz is the highest frequency for 2.7V.  4.3V is the one you want.
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 75
Posts: 7303
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks so much CodingBadly! I think you're right. BTW, atmel really screwed up that figure, no tick marks? How do I easily read it? I guess I'll have to load it into a program and figure out the sloped line or solve with 4MHZ, 1.8V, and 10MHZ, 2.7V. (Will 20MHZ, 4.5V be on this line? Guess not ;D)

I guess It's probably 3.6V for 16MHz (0.15V/MHz). I'll make the change on my arduino IDE with your favorate calculator.
Logged


Pages: [1]   Go Up
Jump to: