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.
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?
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?
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.
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);
You're always welcome!
Btw: the memcpy() way is faster, just do not reverse source and destination as it happened to me.
As an aside you can do this as a structure as well, aproach does not
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.