Non-volatile memory

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I have the need to save an array into non-volatile memory so that I can maintain my data through power cycles. I have seen the EEPROM module and have considered using this but I am unsure of the operation of this module. I am attempting to accomplish the following:

I would like to save an array into non-volatile memory.
I would like that memory to be reloaded when the power returns.

Thanks for the help!

0 Likes
7 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Depending on which PSoC you use there are two different approaches:

   

PSoC3/5 have got real EEProm, look at the examples for EEProm and into the datasheet.PSoc4 has got an emulated eeprom which stores information in flash.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

I am using the PSoC 3. I can see how to write to the EEPROM device but how do I read from it on startup? Or maybe my idea of EEPROM is incorrect?

0 Likes
Anonymous
Not applicable

I am fairly confident that I am able to write to the EEPROM. It seems simple enough. Do I need to use the EEPROM base pointer to do the reads? How would I accomplish that?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Define a pointer to your data and assign it the base address of the eeprom, then use memcpy() to move the data to a ram-area.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thank you for the help. I was able to do the following to read in the data stored in the EEPROM

   

for (count = 0; count < 255; count++)
     EEPROM_Data[count] = CY_GET_REG8(CYDEV_EE_BASE + count);

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You're always welcome!

   

Btw: the memcpy() way is faster, just do not reverse source and destination as it happened to me.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

As an aside you can do this as a structure as well, aproach does not

   

change.

   


   

And encorporate a test on a specific location to see if the first time write

   

has occured to the storage area, like 0x5555 stored in the first DWORD

   

after you have done a write. eg. test for that. If you see it FLASH was written

   

the first time, otherwise whats there irrelevant.

   


   

Regards, Dana.

0 Likes