Hex file for an ATMEGA328P chip with changed fuse bits integrated

Dear all,

In my quest to run the ATMEGA328P chip on 3.3V supply, I have burned its bootloader to the 'Arduino Pro or Pro Mini, 3.3V 8MHz' bootloader using Arduino IDE. Later, I disabled the brown-out detection (BOD) and used the internal 8 MHz clock by changing fuse bits. I did this using an Arduino Mega 2560 as an ISP and executed the avrdude commands to change fuse bits in the Command Prompt application (Windows).

This worked well but I had to use Arduino IDE and Command Prompt to do this. I was wondering if I can simply generate a .HEX file (with bootloader if required) that will integrate these fuse bit changes. I would like to be able to upload this HEX file to a PCB mounted ATMEGA328P SMD chip and seamlessly run it on 3.3V using its internal oscillator.

Does anyone have experience with this? Or is there a smarter alternative that I am overlooking? I appreciate your responses greatly.

Many thanks,
Raj

You can upload the code via ISP with Arduino IDE - see "Sketch -> Upload using Programmer"

To my knowledge HEX files don't contain fuse information. But if you can issue an avrdude command to upload the HEX file you can simply add the fuse information to that command and the fuses will be set. As avrdude is a GUI-less command you can integrate it into scripts so you don't have to add all the arguments yourself on every call.

Yep...
Old post, may need a few edits, however:

Copy 'n Paste Arduino Firmware - Community / Exhibition / Gallery - Arduino Forum

Thank you for your suggestions @pylon and @mrburnette. Unfortunately I have damaged my chip and currently trying to recover. I shall get back to this thread with how your suggestions helped me.

Heartiest thanks.

There is a way to define fuses in the source code, and they'll end up in the .elf file.
Atmel called it "elf production file"
And see
Unfortunately, I don't think there is a standard for including the fuses in a .hex file, and I don't think that avrdude supports the single all-inclusive elf (or .elf at all, for that matter.)

1 Like

You are correct if "single" HEX is implied, but easy for individual files:

avrdude -c arduino -P com9 -p ATMEGA328P -b 19200 -U hfuse:w:\Users\owner\AppData\Local\Temp\backup_hfuse.hex
ECHO hfuse WRITTEN
avrdude -c arduino -P com9 -p ATMEGA328P -b 19200 -U lfuse:w:\Users\owner\AppData\Local\Temp\backup_lfuse.hex
ECHO lfuse WRITTEN
avrdude -c arduino -P com9 -p ATMEGA328P -b 19200 -U efuse:w:\Users\owner\AppData\Local\Temp\backup_efuse.hex
ECHO efuse WRITTEN ... this may change from 05 to 07 with BOD being disabled by AVRDUDE
)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.