Brown Out Reset to 4.3v

Hello,

I am looking to modify the bootloader file to adjust the Brown Out Reset to 4.3v on the atmega 328p.
The problem is I couldn’t find the board.txt file that the other posts are talking about. Thank you in advance.

I am using Arduino 1.6.5 on a mac OS X.

.......\Arduino\hardware\arduino\avr ?

Regards

Thank you.
The one I was able to find is the adafruit board.txt which is under ~/Library/Arduino15/packages/adafruit/hardware/avr/1.3.0

Is that the one?
I am using my own board with atmega 328p.

Each hardware package has its own boards.txt file. So the correct location will depend on which board you're targeting.

The easiest way to find the active hardware package location is as follows:

  • Select a board from the hardware package from the Tools > Board menu
  • File > Examples > SPI > BarometricPressureSensor
  • Sketch > Show Sketch Folder
  • Move up folder levels until you reach the one that contains boards.txt

rocky79:
I am looking to modify the bootloader file to adjust the Brown Out Reset to 4.3v on the atmega 328p.
The problem is I couldn’t find the board.txt file that the other posts are talking about. Thank you in advance

The following is a description of the Brown-out Detector Logic of the ATmega328P MCU of UNO Board. You want to change the detection level to 4.3V from 2.7V of Arduino settings. To do it, you need to change the settings of the Fuse Bits from 101 to 100 of the Extended Fuse Bits, Do you know the procedures of changing the settings of the Fuse Bits? You change something on paper (documentation), and you think that will bring change in the states of the Fuse Bits?

boards.txt is not documentation. It's the hardware definitions for each board, which includes the fuse values.

Of course, changing these values in boards.txt alone won't change the fuses on the microcontroller. To do that via the Arduino IDE you need to:

  • Make the change in the correct boards.txt
  • Restart the Arduino IDE so it will rescan boards.txt.
  • Tools > Board > select the correct board
  • Tools > Programmer > select the appropriate programmer
  • Tools > Burn Bootloader

{facepalm}

pert:
Each hardware package has its own boards.txt file. So the correct location will depend on which board you're targeting.

The easiest way to find the active hardware package location is as follows:

  • Select a board from the hardware package from the Tools > Board menu
  • File > Examples > SPI > BarometricPressureSensor
  • Sketch > Show Sketch Folder
  • Move up folder levels until you reach the one that contains boards.txt

Thank you very much. I found it.

my next question is can I incorporate the fuse setting into my sketch then upload it using a programmer?
The only reason I am looking for this file is so I can incorporate the fuse setting into my code. My goal is to program the chip using one operation instead of loading the bootloader then the actual program via ISP. This is more of a procedure for programing a lot of chips ( arduino for production)

##############################################################

uno.name=Arduino/Genuino Uno

uno.vid.0=0x2341
uno.pid.0=0x0043
uno.vid.1=0x2341
uno.pid.1=0x0001
uno.vid.2=0x2A03
uno.pid.2=0x0043
uno.vid.3=0x2341
uno.pid.3=0x0243

uno.upload.tool=avrdude
uno.upload.protocol=arduino
uno.upload.maximum_size=32256
uno.upload.maximum_data_size=2048
uno.upload.speed=115200

uno.bootloader.tool=avrdude
uno.bootloader.low_fuses=0xFF
uno.bootloader.high_fuses=0xDE
uno.bootloader.extended_fuses=0x05
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.bootloader.file=optiboot/optiboot_atmega328.hex

uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.board=AVR_UNO
uno.build.core=arduino
uno.build.variant=standard

##############################################################

GolamMostafa:
Do you know the procedures of changing the settings of the Fuse Bits? Y

Thank you. I know how to do it.

rocky79:
can I incorporate the fuse setting into my sketch

Maybe, but I have no idea how you would do that.

rocky79:
My goal is to program the chip using one operation

This is definitely possible but you won't use the Arduino IDE. You'll use the AVRDUDE tool used by the Arduino IDE for setting fuses, burning bootloader, and uploading to AVR microcontrollers. Here's what I suggest:

Please do this:

  • File > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK
  • Tools > Burn Bootloader
  • After the process finishes, scroll up the black console window at the bottom of the Arduino IDE window until you see the avrdude commands the Arduino IDE generated. When you do a Tools > Burn Bootloader the Arduino IDE runs two commands, the first sets the fuses according to boards.txt (including setting the lock bits according to bootloader.unlock_bits) and the second flashes the bootloader file, then sets the lock bits according to bootloader.lock_bits. Copy and paste these to a text file.
  • Sketch > Upload Using Programmer
  • After the process finishes, scroll up the black console window at the bottom of the Arduino IDE window until you see the avrdude command the Arduino IDE generated to burn the bootloader. Copy and paste this to a text file.

Now you have the commands you need. You can just run them one after another if you like. Certain ISP programmers like AVRISP mkII and AVR Dragon are known to sometimes have problems when two operations are run immediately one after another but a short delay between solves that. Or you can just combine all three into a single AVRDUDE command. Since you're planning to do a lot of chips I would definitely recommend the latter.

Be aware the Arduino IDE clears the temporary build folder where the .hex file is when you exit the program so you will want to copy that file to a safe location and update the avrdude command accordingly.

pert:
Maybe, but I have no idea how you would do that.
This is definitely possible but you won't use the Arduino IDE. You'll use the AVRDUDE tool used by the Arduino IDE for setting fuses, burning bootloader, and uploading to AVR microcontrollers. Here's what I suggest:

Please do this:

  • File > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK
  • Tools > Burn Bootloader
  • After the process finishes, scroll up the black console window at the bottom of the Arduino IDE window until you see the avrdude commands the Arduino IDE generated. When you do a Tools > Burn Bootloader the Arduino IDE runs two commands, the first sets the fuses according to boards.txt (including setting the lock bits according to bootloader.unlock_bits) and the second flashes the bootloader file, then sets the lock bits according to bootloader.lock_bits. Copy and paste these to a text file.
  • Sketch > Upload Using Programmer
  • After the process finishes, scroll up the black console window at the bottom of the Arduino IDE window until you see the avrdude command the Arduino IDE generated to burn the bootloader. Copy and paste this to a text file.

Now you have the commands you need. You can just run them one after another if you like. Certain ISP programmers like AVRISP mkII and AVR Dragon are known to sometimes have problems when two operations are run immediately one after another but a short delay between solves that. Or you can just combine all three into a single AVRDUDE command. Since you're planning to do a lot of chips I would definitely recommend the latter.

Be aware the Arduino IDE clears the temporary build folder where the .hex file is when you exit the program so you will want to copy that file to a safe location and update the avrdude command accordingly.

Thank you very much for the detailed explanation, I will try it.