PIC 18F4431 Eeprom read and write problem.

Status
Not open for further replies.

benikvarun

New Member
Hi All,

I m currently working on a project where i am using PIC18F4431 micro controller for the motor control.
Since there are requirements to save certain parameters in the eeprom(so that i can retain parameters in case of power failure),
i had programmed as per the instructions given in the datasheet. Now, i m having a unique problem of reading and writing data onto
the chip. While the same code i have written works perfectly storing the data in eeprom n when read after power up retains the written value
in few 18F4431 ICs, and now the same code(also hex file) when burnt on the other 18f4431 IC's dont retain the values and eeprom doesnt function properly.
If there was a problem in the software then all the code/hex should not have worked for all the ICs or work on all the ICs.

Am i missing something in the config. Kindly help me over this strange issue that i m facing.
I can share the code if needed.

Thanks for reading the problem i have posed. Hope to get a faster response.

Cheers
Varun
 
If the config isn't contained in the hex file then the EEPROM may be getting write protected. To fix this ensure your software includes the config.

Another problem can occur if delays are used between writes rather than waiting for the W bit to clear. Some chips take longer than others to write.

Mike.
 
Thanks... for the help... I made a mistake of not using "while(WR);" and used delay instead...
Ur suggestion is valuable n highly appreciated ..

regards
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…