ruby krishna

D flash memory read after reset ( without enabled emulated eeprom)

Discussion created by ruby krishna on Nov 2, 2016
Latest reply on Nov 3, 2016 by Radek Sestak

We are using MC9S12XEP100 family. It has emulated eeprom feature, However we are not using it, we used to store eeprom data in d flash ( traditional approach) without using  emulated eeprom  buffer ram.

 

On start up,

 

_starup()

{

main()

}

 

main()

{

uint8 c;

clock_init();

flash_init();

  c=*(uint8* __far)0x100000 (i.e 0x100000 start address of the d flash memory) 

}

 

Lets us consider that i have value 23 in the following address 0x100000'G

Wen i tried to read that value, i couldn't read it. It's reading it as c=0.

 

 

So i modified the code as such 

main()

{

uint8 c;

clock_init();

flash_init();

delay(5ms);

  c=*(uint8* __far)0x100000 (i.e 0x100000 start address of the d flash memory) 

}

 

Wen i kept a delay 5 ms it reading the value  at 100000 c=23

 

Please help me ! Is any delay required after reset for reading a d flash memory. I didn't find  these case in other micro controllers.

Outcomes