AnsweredAssumed Answered

mpc5744 eeprom

Question asked by burny fu on May 21, 2017
Latest reply on May 25, 2017 by burny fu

Hi all,

    I am using MPC5744 micro controller.I can successfully write data at 0x800000 addresses,.The code is as follows:

 

C55FMC.LOCK0.R &= 0xFFFEFFFF;
C55FMC.MCR.B.ERS = 1;
C55FMC.SEL0.R = 0x00010000; //select the mid block
*(unsigned int*)0x00800000 = 0xFFFFFFFF; //interlock write
C55FMC.MCR.B.EHV = 1;
while(C55FMC.MCR.B.DONE == 0);
C55FMC.MCR.B.EHV = 0;
C55FMC.MCR.B.ERS = 0;

 

C55FMC.MCR.B.PGM = 1;

 *(unsigned int*)0x00800000 = 0x11111111;

C55FMC.MCR.B.EHV = 1;
while(C55FMC.MCR.B.DONE == 0);
C55FMC.MCR.B.EHV = 0;
C55FMC.MCR.B.PGM = 0;

 

But what should i do when I want to save other data? Do I need to erase the flash again when I write the data again?

 

Can you help me solve this problem?

Outcomes