# PIC : EEPROM not write properly to 0xFF in PIC18F67K22 controller

I am writing values from 0x50 to 0x3ff in EEPROM of pic18f67k22. Whenever eeprom is getting full, I am writing 0xFF and then after write my data from 0x50 location. but some time eeprom is not write properly to 0xFF to all location. I am using simple FOR loop to write 0xFF.

 for(i=0; i<900; i++)
{
Write_b_eep(0x50+i,0xFF);  //This stores the no of session by incrementing it by one
Busy_eep();
}


What I am missing?

• One problem I can spot is you shouldn't have i++ inside the loop, it's already incremented in the for loop. – PeterJ Aug 14 '13 at 5:00
• oh sorry this is my mistake in writing.i am changing "i" variable to something else.But problem is not solved.thanks for replay . – shail korat Aug 14 '13 at 6:19
• Is writting something other like 0xAA working?? and Can you share function defination of 'Write_b_eep()'? – Swanand Aug 14 '13 at 6:48
• yes we can write but some type of index is store on that location.index value is different every time, – shail korat Aug 14 '13 at 7:30
• so Before reading location we want to make them 0xFF – shail korat Aug 14 '13 at 7:32