Hi All,
I am pretty new to CodeBlocks and Atmega 328P programming.
I have a simple code that blinks and LED and uses the default fuse settings for the 3 fuses in fuse.c. I would like to change the lfuse setting from 0x62 to 0xFF so I can use a crystal. How would I change ".low=LFUSE_DEFAULT" to use 0xFF? I have tried multiple things; .low=0xFF, etc. and I keep getting errors for the setting. I can change the lfuse setting in AVRDUDESS and AVRDude and the crystal setting works. I just cannot figure out the syntax for CodeBlocks.
By the way this is an awesome program for a non-programmer to learn on!
Thanks and regards.
mikejp56
Using Atmel Studio with the ATmega32U4 I just use this in main.c:
FUSES =
{
.low = (FUSE_SUT1 & FUSE_CKDIV8),
.high = (FUSE_BOOTSZ0 & FUSE_BOOTSZ1 & FUSE_EESAVE & FUSE_SPIEN & FUSE_JTAGEN),
.extended = (FUSE_BODLEVEL2 & FUSE_BODLEVEL1 & FUSE_BODLEVEL0)
};
The 328 should be similar.
Hi Miguel,
Thanks for your response. Is there a document that shows the different settings for each fuse? As I said I am pretty new to AVR and I only have a limited supply of ICs. I don't want to brick them if I can avoid it!
Thanks again for your response!
Regards,
mikejp56
AVR programming is OT here.
Atmel datasheets are very complete, read the "Memory programming" section of your micro. Do not mess with lock bits.
Hi Miguel,
In which section would AVR programming not be OT?
And thanks again for the prompt response.
Regards,
mikejp56.
The "Embedded development" subforum is more suitable, but your question should receive more answers in an AVR-specific forum.
Hi Miguel,
Thanks, I'll post future questions like this in the Embedded Forum.