sakthi

problem in Reading the internel eeprom in xep100 evaluation board

Discussion created by sakthi on Apr 29, 2009
Latest reply on May 14, 2009 by sakthi

hi,

i have developed the application that must read the data from the internal eeprom.In a new board no data will be availabe so for the first i will write the some default data in to eeprom using Write Function(Below Specified Function). and  Restart the board. 

when the board gets booted for the second time my application must read data from the same location and have to update my global structure.

i am facing the problem in reading the data from the internal eeprom when the board gets loaded for the second time. its not reading the availabe data. some junk value is read.

 

note:

if i do the read operation after wirte operation its working fine.

if i do only read operation its not reading the data. but data is there in eeprom. i checked with datablaze programmer.

 

following are my function

static byte Eeprom_Write_Word(TAddress AddrRow,word Data16) {

if (FSTAT_CCIF == 0) {

return ERROR;

}

 

FSTAT = 48;

FCCOBIX = 0;

FCCOBHI = 17;

FCCOBLO = (byte)(((dword)AddrRow) >> 16);

FCCOBIX++;

FCCOB = (word)((dword)AddrRow);

FCCOBIX++;

FCCOB = Data16;

FSTAT = 128;

if ((FSTAT_FPVIOL == 1) || (FSTAT_ACCERR == 1)) {

return ERROR;

}

while (!FSTAT_CCIF) {}

if (FSTAT_MGSTAT) {

return ERROR;

}

return SUCCESS;

}

static byte Eeprom_Read_Word(TAddress Addr,word *Data) {

if((Addr < EEPROM_AREA_START) || (Addr > EEPROM_AREA_END)) {

return ERROR;

}

 

if(!FSTAT_CCIF) {

return ERROR;

}

*Data = *Addr;

return SUCCESS;

}

 

i want to know there is any command for reading the internal eeprom. please help me to get out of the problem.

Outcomes