I've been playing around with a butterfly for the past few days, trying to get to grips with timer interrupts by generating clicks on the piezo speaker, and my programs seemed to be doing more or less what I expected, when suddenly I started getting verify errors whenever I tried to send a new program.
The error I get is always at offset 0, where it is reading back 0100 instead of what was expected. I used AVRProg to try to read the flash area back and what it read was always 000102030405060708 etc.
I think the erase is failing too since it seems that the program I last sent is actually still there (it's clicking the piezo once per second).
I tried removing the battery but no luck. It seems like either I changed some setting on the chip that caused the bootloader to malfunction, or else part of the bootloader got reprogrammed.
1. Is it possible to accidentally reprogram the bootloader itself via a badly-behaved program?
2. Are there any settings that I could have accidentally changed (that would survive a battery removal) that would cause the bootloader to malfunction)
3. Is there a way to fix it?
Ok, so I can't count.
Thanks in advance for any assistance/sympathy that you can offer.