You are here

Reading/Writing data to EEPROM/Flash | Cypress

Reading/Writing data to EEPROM/Flash

Summary: 12 Replies, Latest post by H L on 02 Aug 2013 08:33 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
eferre's picture
User
8 posts

 Hi all,

after some hours I'm still playing with my PSoC 5 LP, and I was trying to read and write some bytes to permanent memory. Reading the System Reference Guide, I have seen that I can write both EEPROM and Flash with the same API CyWriteRowData, just changing the arrayID.

At this point I'm able to reset the board without loosing the data, but when I power it down and back up, my data are still lost. I've tried to look for some explanations on the documentation, but couldn't find any... 

Thanks in advance for your help!

Enrico.

user_119377051's picture
User
866 posts

Hi,

EEPROM must not lose 20 years at least.

I have no clue with this issue.

If you bundle your design (upload project here, File/Create Workspace Bundle ...)

I could be check on my board.

Nonetheless, take one day for checking.

Would you?

eferre's picture
User
8 posts

Some news:

 

I changed my program using the EEPROM block. I simply write to it through EEPROM_Write, giving the row no. 100 as parameter, and then I read dereferencing pointers in memory. Now things go better in one direction and worse in the other: pushing reset the program reads correctly the saved value, but not every time (sometimes it starts with the default value), same behavior powering down and back up. May it happen when I power down (or press reset) in the same instant when the controller is writing to the EEPROM?

 

The file .cywrk is everything you need for testing my program?

 

Thanks.

eferre's picture
User
8 posts

 Yeah, sorry, I finally realized.

user_119377051's picture
User
866 posts

OK, Finally you have resolve it yourself. That be good.

And what is cause, how to solved it.

When you write it here that is more better.

Because, This is a public forum whoever might be watching.

Which is help for other member of this interest.

Thank you.

eferre's picture
User
8 posts

 No no, I didn't figure out, I realized what you were asking to me (bundle). I attached it to the previous post, and to this one too, but it doesn't seem to work... Can you see the .zip file somewhere?

user_1377889's picture
User
5828 posts

Try using ms internet explorer, others (as chrome) seem to make problems here.
Bob

eferre's picture
User
8 posts

 Meanwhile I solved my problem. In my infinite main cycle, I was writing the EEPROM each 5 ms, which increased the possibility to power down or reset while writing. Then I modified the program to write only when strictly necessary, and everything works fine. It seems that, when powered down during writing, the controller erases the row under writing (or it may be related to the physical behavior of the EEPROM). Don't you think so?

user_119377051's picture
User
866 posts

You are writing EEPROM every 5ms and get in sleep mode, Right?

EEPROM writing is kind of different with other memory or EEPROM read.

Writing is done with row unit and need more time than read.

Usually writing is need verify process, after write compare with the value.

That will be increase reliability of writing.

Would you do so?

eferre's picture
User
8 posts

 No, I don't go in sleep mode. A verification is a good idea, but it slows down... what is the difference in times between reads and writes?

user_1377889's picture
User
5828 posts

A single row erase / write cycle takes 2 to 20 (wost case) ms. Reads are done with the same speed as flash reads are done. So there is a k factor between reads and writes. Have a look into the datasheet at AC characteristics.

 

Bob

user_14586677's picture
User
7042 posts

Don't forget proper power supply design coupled with LVD detect

can hold up power until a process like FLASH writing can be

completed.

H L
user_460349's picture
User
1362 posts

 Issues.

1. FLASH and EEPROM erase/write cycle is 20mS max. So write it every 5ms is not a valid design.

2.Writing 5ms means 200 per second and 720000 per hour and 17.28 million time a day. EEPROM is rated at 1M cycle and flash is 100k cycle. 

 

Log in to post new comments.