I'm a veteran AVR Freak who uses self-programming in the smaller tiny's without hickup.
Now I move into a 162 and want to self program using the BSL. Set the BSL to 0x1C00 (0xE00 word) for powerup.
If I say to erase a page at 0x0000 byte address then read the address back, it remains whatever it was. I set the page to 00's or 69's or anything and it's always what it was :-(.
Has anyone seen this issue? I'm running INTRC at 8 Mhz, 3.3v. I even tried 5v and slowing down the INTRC to the slowest (writing OSCCAL to 0x00).
Here's an example of a page-erase from page 226 of the ATMEGA162/V manual (2513F-AVR-12/03)
ldi a, (1<<PGERS) | (1<<SPMEN) out SPMCR, a spm ret
I did copy the "DoSPM" routine to check first if the SPMEN was busy but it doesn't make a difference.
BSL mode is enable with bootup to 0x1C00 as explained above.