You are here

eeprom | Cypress Semiconductor

eeprom

Summary: 7 Replies, Latest post by Bob Marlowe on 09 Dec 2016 07:45 AM PST
Verified Answers: 2
Last post
Log in to post new comments.
Chirag Modesara's picture
User
114 posts

how can i use eeprom on psoc-4.??

i read emulated eeprom component datasheet. there is only write function which can write the data but i cant find the function which can read the data from eeprom.

Rob1's picture
User
10 posts

i hope PSoC5 works with the similar API than your PSoC4 (it's highly probable)

it's used for EEPROM not an Em EEPROM, the functionalities between these 2 EEPROM are probably close. 

After add this 2 points above, please find below a basic function to read EEPROM :

void refresh_values(unsigned char *tab){

    int i=0;
    reg8 * Pointer = (reg8*) CYDEV_EE_BASE;
    EEPROM_Start();
    for(i=0;i<5;i++) tab[i] = Pointer[i];
    EEPROM_Stop();

}

I use this code to read 5 bytes into the EEPROM. You need to add a component EEPROM on your Topdesign.

It's a simple proposal to read EEPROM without use the read API: i hope it will be useful for you.

yours,

rob1

Chirag Modesara's picture
User
114 posts

Thanks rob1 for your valuable Reply.

but i want to tell you something.

 i think psoc-4 has not a eeprom component. There is only Emulated eeprom component.

user_1377889's picture
User
9983 posts

When reading from emeeprom it is quite the same as reading from flash, you just use a pointer / address and get the data. I frequently use a structure in flash and a copy in sram to work on. So I can check the number of eeprom writes and check for valid data.

On some BLE chips take care:  the clocks may be changed during the flash write, check the "System Reference Guide".

 

Bob

Chirag Modesara's picture
User
114 posts

okay thanks bob,

can you give me basic syntax which can read the memory and transfer to the SRAM??

user_1377889's picture
User
9983 posts

See here ...

 

Bob

 

 

Chirag Modesara's picture
User
114 posts

okay Thanks bob,

Can you tell me one more thing.

which number of row or memory i use for flash memory like emulated eeprom example project using this code

 static const uint8 CYCODE eepromArray[]=
                                { 0x46, 0x69, 0x72, 0x73,0x74, 0x20, 0x72, 0x75, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00 };
 
 uint8 array[]             ={ 0x50, 0x6F, 0x77, 0x65, 0x72, 0x43, 0x79, 0x63, 0x6C, 0x65, 0x23, 0x20, 0x30, 0x00 };
                                /* P     o     w     e     r     C     y     c     l     e     #           0*/

 

i want 10 array for non-volatile memory.

 

user_1377889's picture
User
9983 posts

Didn't I comment in the example to use the upmost flash rows?

The emulated eeprom example works differently and cares for data located anywhere in flash.

 

Bob

Log in to post new comments.