Hi there,
I try to program an Atmega328p using arduino as ISP, what I can do till now is just program the first page which contains 64 words, and is done by executing a loop. Below is the code used for that:
for(int i = 1, j = 0; i <= 256;i++,j++) {
convertByte(0x40|((j&1)<<3)); //Test if it's odd change it to 0x48
convertByte(0x00);
convertByte(j>>1);
convertByte(0x60);
/* if (!(i%128))
{
convertByte(0x4C);
convertByte(0x01);
convertByte(j>>1);
convertByte(0x00);
_delay_ms(5);
}*/
}
convertByte(0x4C);
convertByte(0x00);
convertByte(0x00);
convertByte(0x00);
delay(5);
convertByte(0x4C);
convertByte(0x00);
convertByte(0x01);
convertByte(0x00);
delay(5);
This code never fill the next flash page with 0x60, and I don't know how to access to the next flash page, nor how to address it to fill it with data.
Can you help me out by giving a simple example or just explain me how the flash pages are organized ?
regards.