I am trying to write a bootloader for the ATMEGA64. I have also tried other peoples bootloaders but i am having alot of trouble getting it to write to the flash. I created a simple program that writes 0x00 to the first page of flash. It does nothing! when i read the flash the first page is is filled with 0xFF.
I have the bootloader sitting at 0x7800 and the bootloader size fuses blowen correctly. I have none of the lock bits program.
Can anyone help
u16 i = 0; // move interrupt vector table to boot loader area myIVSELREG = _BV(IVCE); myIVSELREG = _BV(IVSEL); cli(); boot_page_erase(0); // do a page erase boot_spm_busy_wait(); // wait for page erase done for(i=0;i