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

What I am missing?

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.