Emil Bartczak

Reading and writting data from/to EEPROM-problems

Discussion created by Emil Bartczak on Nov 16, 2006
Latest reply on Nov 20, 2006 by Emil Bartczak
Hello I'm writting a code for MC9s12D64 and I need store data in internal EEPROM. I have written routines for writting and reading word data to/from EEPROM but it doesn't work. The code:
Code:
void initInternalEEPROM(){ ECLKDIV = ECLKDIV | 20; //frequency divider feeprom = 190 kHz wyslijByte(ECLKDIV); //clear flags  ESTAT |=  (PVIOL | ACCERR);}void writeToIntEEPROM(word* adress,word data){ while( !(ESTAT & CBEIF)); //wait until not ready ESTAT |= (ACCERR | PVIOL);  // clear errors //(*(word*)adress) = data; *adress = data; ECMD = CMD_PROGRAM; ESTAT |= CBEIF; //launch the command}word readIntEEPROM(word *adress){  while( (ESTAT & CCIF)!=CCIF ); //wait until EEPROM ready return (*adress);}

 
And my first question is what is the start and end adress of EEPROM memory. I read datasheet and I think that from 0x800 to 0x17FF but maybe I'm wrong or maybe this source code is incorrect. Can anyone help me?

Outcomes