Atmega 1284p EEPROM write

Hi, Don't know if anyone else has come across this but I am unable to write to EEPROM using the EEPROM library.

I was using RTIMULib for a 9250 motion sensor and was getting poor results after calibration so I did a test write and read, the results from addresses 1 to 4 with the values 10,20,30,40, respectively returned 255,255,255,255.

I am using an Atmega 1284p using ide 1.0.5 with maniacbugs mighty 1284 hardware.

Thanks in advance


OK, sussed it, EEPROM not preserved during icsp upload.

I suppose there is no way back from the fuse setting once it has been done.


You can change the fuses no problem, on these modern controllers whilst it sounds like fuse is a one shot thing, it isn't.

If you are uploading from the Arduino IDE, I'm not sure but it may set the fuses each time to what is in the boards.txt file when going via the ICSP, so it might need the boards.txt file changing to the fuse settings you need.



Thanks for your quick response but found out that my fuse setting erases eeprom.

Thanks for that, I will edit my boards.txt and give it a try.

I caught the calib data on a serial monitor and hard coded it in for now to see if it works, and it does.

Fingers crossed with my fuse setting.

Thanks for your help.

Fuses are set to the values in boards.txt every time you do Tools > Burn Bootloader but not when you do Upload Using Programmer. So Burn Bootloader to set the fuses even if you are using a programmer to upload sketches.

Thanks for that.

It is quite funny now, that you can spend many hours pulling your hair out, blaming everyone and the equipment your using before finding the stupid mistake you made in the first instance.

Human nature I suppose and will probably act the same over the next snag.


Not sure if you had found this site, which helps you find the fuses to program.



Thanks Phil,

Yes I went there straight away after I realised.

Many thanks