Go Down

Topic: Changing BOD on Pro Mini (Read 4249 times) previous topic - next topic

binduni

Hello,

I've scoured for a clear explanation of how to change the brown-out detection from the set 2.7v to the higher 4.3v but after much head banging, I'm turning to asking the question.

The root issue is I'm seeing instability of saved info to eeprom and much research leads me to believe it's due to a period of low voltage, and that setting the BOD to 4.3v will help. This is an automotive application with much filtering and regulating before the Arduino.

My issue is; I can successfully burn a new bootloader with BOD of 4.3v, but then my program either does not load (I get a clock sync error), or it doesn't fully work (some like interrupts sections don't work).

Does there exist a step by step that explains how to get from A to B without leaving out steps like "now change the extended fuse value in the boards.txt file" (just an example, don't know if this is actually needed)?

Board is Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega328p. Can someone verify the fuse settings should be low_fuses=0xFF, high_fuses=0xDA, extended_fuses=0xFC to just set the BOD to 4.3v?

Thanks! I truly appreciate the help!

CrossRoads

#1
Oct 07, 2016, 08:49 pm Last Edit: Oct 07, 2016, 08:49 pm by CrossRoads
Looks like 0b11111100 or 0xFC to me for 4.3V typical with Vcc = 5V.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

binduni

Thanks CrossRoads, that confirms 0xFC for setting BOD to 4.3v.

Now, how to do this without upsetting other bits??

I have an Uno that I can use the programmer, but I'm missing the "how to" do this with the Arduino IDE. What seems straight forward in the explanations I've read must be obvious to the experienced, but to me (the inexperienced) I can't get it to work. By that I mean I'm not clear on the steps to take. I keep running in to statements like "now you can program your board...". Great, and I can fly a plane too, but after taking lessons and tests! :-)

Thanks again.

CrossRoads

As far as I know, you can only set the Fuses with a Programmer connected to the ICSP pins.
Change the fuses in boards.txt, then Burn Bootloader to change them.
The other two bytes will just get reprogrammed with the same bytes again if you didn't change them.

There may be a way with avrdude commands, I've never tried that.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

DrAzzy

Easiest way is with a USBAsp - with that, you just connect up the isp lines (see countless instructions ) to the usbasp, and can set fuse bits with the "extreme burner avr" tool, which has  a nice graphical interface.

Saves you having to figure out the avrdude syntax and the usbasp is more reliable in general.


Minicore, hansibull 'score for the 328/328p and it's smaller kin may also provide menu option for bod level when burning bootloader (its technically easy to implement the menu option in a third party hardware package)
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

hansibull

You should check out MiniCore. This is the easiest way to change the BOD option on an ATmega328p :)
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

binduni

@hansibul, thank you! I think that gets me close, but I don't have a bare 328P - I have a ProMini. Assuming I can skip all the caps and such and connect my Uno as a programmer to the mini via the MISO, MOSI, Reset, +5, and GND pins?

And as a sequence, do you:
1. Program the bootloader (Uno)
2. Connect the bootloader to the mini via the pinout supplied
3. Burn the bootloader to the mini
4. Disconnect everything and load my code to the mini

Thanks!

DrAzzy

Just call your pro mini a bare 328p. All a pro mini is is a bare 328p and basic supporting components
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

binduni

I understand, but can skip all the caps and such and connect my Uno as a programmer to the mini via the MISO, MOSI, Reset, +5, and GND pins? Or do I need to add the caps and such?

hansibull

#9
Oct 08, 2016, 12:57 am Last Edit: Oct 08, 2016, 10:10 am by hansibull
1. Upload the ArduinoISP sketch on your Arduino UNO.
2. Hook up your pro mini like shown in the diagram below
3. Select "Arduino as ISP" in the Programmers menu
4. Select "ATmega328p", "16 MHz", and your BOD setting
5. hit "Burn bootloader"
:)
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

binduni

You rock! Thanks so much.

Of course, I'll need to set the BOD bit in the boards.txt file first correct?

hansibull

Yep, that's correct. When you hit "burn booloader", you actually set the fuse bits first, then uploading the bootloader, changing the clock frequency and BOD setting without reburning the fuses/bootloader won't have any effect
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

binduni


1. Upload the ArduinoISP sketch on your Arduino UNO.
2. Hook up your pro mini like shown in the diagram below
3. Select "ArduinoISP" in the Programmers menu
4. Select "ATmega328p", "16 MHz", and your BOD setting
5. hit "Burn bootloader"
:)

Thought I had it... after following the above (changed the BOD setting in the boards.txt for my board) and received this error:
avrdude: Error: Could not find USBtiny device (0x2341/0x49)
Error while burning bootloader.

Strange because I'm not using or targeting a USBtiny device....

Any thoughts?

dmjlambert

Choose for the programmer Arduino as ISP, not ArduinoISP

binduni

Thanks to all of you for the help so far.

I'm still getting errors: the latest, after selecting the programmer "Arduino as ISP", is this
Arduino: 1.6.5 (Windows 8.1), Board: "Arduino Pro or Pro Mini, ATmega328 (5V, 16 MHz)"

avrdude: Yikes!  Invalid device signature.

         Double check connections and try again, or use -F to override

         this check.




Go Up