You are here

EEPROM doesn't Write/Read | Cypress Semiconductor

EEPROM doesn't Write/Read

Summary: 4 Replies, Latest post by PSoC73 on 19 Oct 2013 08:16 AM PDT
Verified Answers: 2
Last post
Log in to post new comments.
user_119377051's picture
866 posts


I'm using EEPROM to save the LCD's contrast value.

At the Start of program, read this value but

Always same bad value was read.

When change this value, write into EEPROM

It is in Cy8C24223A

I never seen this failer on other chips.

What is wrong?

user_1377889's picture
9279 posts

There were some mentions from Dana that debugging starts to fail when the program size reaching the amount of flash. Can you shorten your program to the pure EEProm part and test again?


Another hint:

In PSoC 1 world do not define variables inside main(). They will be allocated as for any simple function (and main() IS a function) on the stack, thus reducing unnecessarily the availlable stack-space.



user_119377051's picture
866 posts

Thank you.

user_14586677's picture
7646 posts

I noticed the following -


1) In flashsecurity.txt you have 2 blocks set to "U", but your EEPROM size

is only 64 bytes, so you only need to set the last block to "U".


2) When main() starts the first thing on debug is ICE cube loads program,

so all FLASH (including EEPROM) erased and re-programmed. Then you read

EEPROM and get a bad value because nothing has been written to it. You need

to save in EEPROM, in a word location, a value indicating EEPROM was written

at least once under main() control and test that value. I usually use 0c5555 as

a value to test.


So when porogram starts, first time ever, test value is junk not 0x5555. So you

default the LcdCont value to a default value. Then later main(0 writes 0x5555, and

the LcdCont value into EEPROM, so next time it is read you verify main() wrote

EEPROM, and that LcdCont in EEPROM has a legit value.


Keep in mind each time you recompile, download porogram, and debug, EEPROM

gets erased, and so does LcdCont get erased.


Regards, Dana.



user_119377051's picture
866 posts

Thank you very much

All was a waste

One "U", word access, length=2

It is very clear, read just after write

that was wrong value (same 0x30)

This tiny chip was almost full

Maybe this is a cause.

I gave up EEPROM on this design.

Log in to post new comments.