cancel
Showing results for 
Search instead for 
Did you mean: 

Programming Eeprom repeatedly

vcelik
Associate II
Posted on April 13, 2010 at 13:25

Programming Eeprom repeatedly

7 REPLIES 7
brazov22
Associate II
Posted on May 17, 2011 at 15:08

Hi volkan,

yes, for sure there is no problem in what you're doing, but you are not taking advantage of RWW feature, because after first byte writing on data eeprom, when you write second byte on data eeprom and the first wtrite is not yet finished, you can see the CPU is frozen till the first byte write is not completed. If you really want to enjoy RWW feature I suggest you to generate an EOP interrupt associated to the each byte write, so meanwhile each byte write is ongoing you can do other things like servicing external interrupts, executing code from program flash .... Then in the interrupt routine you can do next byte write. Enjoy RWW.

brazov2

vcelik
Associate II
Posted on May 17, 2011 at 15:08

Thanks Brazov. I got it.

mozra272
Associate II
Posted on May 17, 2011 at 15:08

.ExternalClass9B9356C63ADE4A1E91F5A11342BEB1E1 p.MsoNormal, .ExternalClass9B9356C63ADE4A1E91F5A11342BEB1E1 li.MsoNormal, .ExternalClass9B9356C63ADE4A1E91F5A11342BEB1E1 div.MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman';} @page Section1 {size:8.5in 11.0in;margin:1.0in 1.25in 1.0in 1.25in;} .ExternalClass9B9356C63ADE4A1E91F5A11342BEB1E1 div.Section1 {page:Section1;}

Hi Bravo,

When performing the programming (byte, word, block) on flash program memory the CPU is frozen until the end of programming EOP after that the CPU resume processing but when performing the programming operation on data eeprom the CPU is frozen until the end of high voltage HVOFF.

So, Volkan code taking advantages of RWW feature as don’t waiting the EOP flag

for(i=0; i<ARRAYSIZE; i++, add++)

{

FLASH_ProgramByte((add), val[i]);

while(FLASH_GetFlagStatus(FLASH_FLAG_EOP)!= SET);       // should be deleted to take advantage of RWW feature

}

When performing operation on data eeprom and taking advantage of RWW feature (the time between the HVOFF and EOP)  we can also performing another write operation

 

on data eeprom.

Regards

mozra

brazov22
Associate II
Posted on May 17, 2011 at 15:08

Hi Mozra,

did you try Volkan firmware? He's writing on data eeprom, so after first byte write on data eeprom, the cpu executes the second byte write and in this moment cpu will be frozen: it's impossible cpu can perform another write on data eeprom while the previous write on data eeprom is not finished. What cpu can do is to execute code from program flash while writing on data eeprom.

brazov2

mozra272
Associate II
Posted on May 17, 2011 at 15:08

.ExternalClassF794AA965F1E4AB0980B28AB79D58E9D p.MsoNormal, .ExternalClassF794AA965F1E4AB0980B28AB79D58E9D li.MsoNormal, .ExternalClassF794AA965F1E4AB0980B28AB79D58E9D div.MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman';} @page Section1 {size:8.5in 11.0in;margin:1.0in 1.25in 1.0in 1.25in;} .ExternalClassF794AA965F1E4AB0980B28AB79D58E9D div.Section1 {page:Section1;}

Hi Brazov,

The CPU is frozen does mean that can not perform any operation until the end of the current operation  (can't execute from program flash) when performing write operation on data eeprom the frozen phase finished after the end of high voltage HVOFF(~1,7ms) then the CPU resume processing (RWW feature). The EOP flag is set after (~3ms), this feature not exist on flash program memory the frozen phase finished after the end of programming EOP. When interrupt occured during frozen phase will be delayed until CPU resume processing

Regards

mozra

brazov22
Associate II
Posted on May 17, 2011 at 15:08

Hi Mozra,

try the Volkan firmware and you'll see ... it's true that cpu is frozen till HVOFF is reset, then cpu starts to execute second byte write of Volkan firmware and in this moment you can see cpu frozen.

brazov

mozra272
Associate II
Posted on May 17, 2011 at 15:08

.ExternalClassE7502537E7424CE3A271BE06F1483409 p.MsoNormal, .ExternalClassE7502537E7424CE3A271BE06F1483409 li.MsoNormal, .ExternalClassE7502537E7424CE3A271BE06F1483409 div.MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman';} @page Section1 {size:8.5in 11.0in;margin:1.0in 1.25in 1.0in 1.25in;} .ExternalClassE7502537E7424CE3A271BE06F1483409 div.Section1 {page:Section1;}

Hi Brazov,

I agree with you that the CPU will be frozen for each byte programming (when call the programming byte muli-times the cpu each time resume processing after write the byte n then  goes back frozen when trying to write the byte n+1 😉 ) just I want to add that this code benefit for the RWW feature (to program 10 byte without rww feature the operation take 3ms x10 and with rww feature the operation take ~1.7ms x10)

Regards

mozra