Required help in program a word in EEPROM.

Discussion created by Guest on Jan 16, 2009
Latest reply on Feb 11, 2009 by KoT
         I have a query regaring the read/write operation in EEPROM. like i m using Code warrior tool for developing EEPROM driver for S12XDP512 controller. i have try to execute the program for writing one word in EEPROM in Code Warrior's FULL Chip Simulation. But it is giving me an error while running the program. Please help me if anyone has idea,how to simulate the things in Full Chip simulation for Code warrior.
 /*Test Program to write into the EEPROM.*/
  /*write an appropriate value to ECLKDIV register as per the oscillator freq=4MHz.*/
  ECLKDIV = 0x15;
/*Data to write into the Address.*/
  l_ulvalue = 0x55AA;
  /*take the address from the non paged EEPROM for small memeory model default EPAGE is FE.*/
  l_ulEepAdd = 0xFE0D00;
   l_ulptr = &l_uladdress;
    /*Load the value in ECNFG register.*/
    while(ESTAT_CBEIF == 0x01);
    ESTAT = 0x30;
   /*load the addrress.*/
    l_uladdress = l_ulEepAdd;
     *(l_ulptr) = l_ulvalue;/*write direct value to EEPROM address.*/
     ECMD = 0x20;/*load the write sequence command.*/
     ESTAT = 0x80;
     while(ESTAT_CBEIF == 0x00);
     while(ESTAT_CCIF == 0x01);