Changing Fuses 328P with Nick Gammon's Tools

Hi there,

I managed to bootload a new Atmega328p with the great tools from Nick. My goal is a very low powered "Arduino". Using Nick's Board Programmer I selected the "Lillypad" version. In his Tutorial Nick is mentioning, that the Brown Out should be set to the minimum (1.7?) when running on two AA batteries. This is exactly what I want to do but I can't figure out how to change the fuse. I tried the HEX_Uploader without success. Is there a way to do this changes? I'm still a newbie on this...

Thanks a lot!

I think you need to change values in this file for the device you are using

In the '328 sections, change the fuse extended byte from 0x05 (2.7V typical) to 0x06 (1.8V typical) or 0x07 (BOD disabled) per Table 29-17 of the data sheet.

Thank you, CrossRoads!
I'll give it a try as soon as possible!

I'm bringing this one back from the dead, because the original post is exactly my problem.
(and I don't think CrossRoads solution works... if anything, I imagine I would have to go into the bootloader_lilypad328.h file and modify something... problem is, I can't seem to find values to modify in there either).

Any ideas?

Thanks.
(and if I'm wrong, and CrossRoad's solution works, can someone please explain how it works. Thanks)

Hi joshpit!

I couldn't solve the problem using CrossRoads hints (that doesn't mean it might be possible this Way).
My luck was a friend who gave me an original avr isp mk ii, and in combination with atmel Studio i could set the fuses.

Thanks for the feedback Yooman,

I attempted to use Gammon's Atmega_Hex_Uploader to change fuses, but I was getting a long list of compile issues using Arduino 1.6.5 (the latest as of writing this).

File_Utils.ino: In function 'void showDirectory()':
File_Utils:322: error: 'sd' was not declared in this scope
File_Utils:325: error: 'file' was not declared in this scope
File_Utils:325: error: 'O_READ' was not declared in this scope
File_Utils:340: error: 'dir_t' was not declared in this scope
File_Utils:340: error: expected ';' before 'd'
File_Utils:341: error: 'd' was not declared in this scope
File_Utils:343: error: 'FAT_DEFAULT_DATE' was not declared in this scope
File_Utils.ino: In function 'void readFlashContents()':
File_Utils:446: error: 'sd' was not declared in this scope
File_Utils:465: error: 'myFile' was not declared in this scope
File_Utils:465: error: 'O_WRITE' was not declared in this scope
File_Utils:465: error: 'O_CREAT' was not declared in this scope
File_Utils:465: error: 'O_TRUNC' was not declared in this scope
File_Utils:510: error: 'myFile' was not declared in this scope
File_Utils:527: error: 'myFile' was not declared in this scope
File_Utils:540: error: 'myFile' was not declared in this scope
File_Utils:543: error: 'sd' was not declared in this scope
'sd' was not declared in this scope

So I'll move on to see if I can find another way to change fuses, and report back when I do.

Ok, here's how I successfully changed the fuse value:

Following these instructions:

overview:

  • installed winAVR (in order to get the already installed AVRDude working)
  • flashed an Arduino Uno w/ the ArduinoISP example (in the Arduino IDE: File > Examples > ArduinoISP)
  • wired the Uno to the bare-bones ATMega328P-PU accordingly (same wiring as Nick Gammon illustrates for his Atmega chip programmer code)
  • connected a 100nf (0.1uf) CAP that you need to connect between the Uno's 5V and RESET. (i think in order to prevent the Uno from resetting as you are using it as the ISP)
  • used an online fuse calc: AVR® Fuse Calculator – The Engbedded Blog to figure out that I needed to change the "efuse" value to 0xfe in order to get BOD level down to the desirable 1.7v
  • opened windows command line prompt (search cmd.exe)
  • typed in: "avrdude -c arduino -p m328p -P COM10 -b 19200 -U efuse:w:0xfe:m" (then hit return)
  • done with AVRDude. (woo hoo)

confirmed:

  • removed the CAP from the Uno, then flashed Nick Gammon's Atmega_Board_Programmer (could also use his Fuse Calculator sketch), opened serial monitor (115200 baud) and confirmed the fuse was set as desired.

[SOLVED]

more helpful info:

If you look at the datasheet for the 328P, under the "27.2 Fuse Bits" section, table 27-6 (p. 296) shows the efuse bits.

You'll notice that the 7-3 bits are not associated with anything, and their default value is "1" (disabled). It's just the 0-2 bits of the efuse that are associated with BOD (levels 0-1-2 respectively). So if you want to turn on the BOD level 0, then the efuse bits would look like this:

11111110 , which in hex = 0xFE
Yet the AVRDude kept telling me "6", which I ignored and checked with Gammon's code that I was getting the 0xFE I had set. (I was).

Well, if you lop off the non-associated 7-3 bits of the efuse, then 11111110 looks like this:
110 , which in hex = 0x6 ... so I guess that explains why AVRDude kept telling me "6", when I was asking for "FE".

Hey Joshpit
thank you for posting your solution! I'll try next time when i need to change fuses. Would you tell us which project you are working on?