Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 5 > Reading/Writing data to EEPROM/Flash

Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Reading/Writing data to EEPROM/Flash

Summary: 6417 Views, 12 Replies, Latest reply by H L on 02 Aug 2013 06:33 AM PST

Verified Answers: 0

Post Reply


eferre posted on 28 Jul 2013 2:35 AM PST
Member
8 Forum 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.



 

PSoC73 posted on 28 Jul 2013 03:21 AM PST
Top Contributor
895 Forum 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 posted on 28 Jul 2013 03:49 AM PST
Member
8 Forum 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 posted on 28 Jul 2013 03:52 AM PST
Member
8 Forum Posts

 Yeah, sorry, I finally realized.


PSoC73 posted on 28 Jul 2013 04:09 AM PST
Top Contributor
895 Forum 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 posted on 28 Jul 2013 11:44 AM PST
Member
8 Forum 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?


Bob Marlowe posted on 28 Jul 2013 01:01 PM PST
Top Contributor
4543 Forum Posts
Try using ms internet explorer, others (as chrome) seem to make problems here.
Bob

eferre posted on 28 Jul 2013 01:12 PM PST
Member
8 Forum 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?


PSoC73 posted on 28 Jul 2013 02:08 PM PST
Top Contributor
895 Forum 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 posted on 02 Aug 2013 10:24 PM PST
Member
8 Forum 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?


Bob Marlowe posted on 02 Aug 2013 02:11 AM PST
Top Contributor
4543 Forum 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


danaaknight posted on 02 Aug 2013 04:58 AM PST
Top Contributor
5106 Forum 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.

Power Supply1.pdf

H L posted on 02 Aug 2013 06:33 AM PST
Top Contributor
1450 Forum 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. 

 



 

Post Reply






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 06/15/20