- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You're always welcome!
Btw: the memcpy() way is faster, just do not reverse source and destination as it happened to me.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.