EEPROM Interface

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

cross mob
Anonymous
Not applicable

 Hi to all,

   

               i want to interface EEPROM to Psoc 3 Externally,can any body help in this regard.

   

Regards

   

PRP

0 Likes
1 Solution
Anonymous
Not applicable

Hi PRP,

   

 

   

Which EEPROM device are you planning to interface with PSoC?

   

 

   

In general, EEPROMs support I2C interface. In that case PSoC should act as an I2C Master and the EEPROM device as a slave.

   

Some EEPROM devices also have the provision of setting their addresses (last 2 bits or so) externally, so that multiple EEPROM devices can be made available on the same bus thereby increasing the memory available.

View solution in original post

0 Likes
30 Replies
Anonymous
Not applicable

Hi PRP,

   

 

   

Which EEPROM device are you planning to interface with PSoC?

   

 

   

In general, EEPROMs support I2C interface. In that case PSoC should act as an I2C Master and the EEPROM device as a slave.

   

Some EEPROM devices also have the provision of setting their addresses (last 2 bits or so) externally, so that multiple EEPROM devices can be made available on the same bus thereby increasing the memory available.

0 Likes
lock attach
Attachments are accessible only for community members.

Hello Guatam 

   


i am trying to use an external eeprom i can get no error when i'm trying to write but when i try to read there is nothing 

   

can you help me with that ?
i have attached my file 

0 Likes
Anonymous
Not applicable

To add to my previous comment, there are also SPI based EEPROMs available.

   

The SPI based EEPROMs can be accessed at a faster rate (typically 3MHz SPI Clock). These EEPROMs may support 8-bit or 16-bit data formats.

   

PSoC should act as an SPI in this case, with apporpriate mode selected.

Anonymous
Not applicable

 Hi Gautham,

   

      http://www.cypress.com/?id=4&rID=58477  this file i couldnot able to download, please help me in this regard.

   

Regards

   

PRP.

0 Likes
Anonymous
Not applicable

 Hi,

   

 

   

I have the old version of the project. I think that this project was created in Creator 1.0 Beta 5.

lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I don't know when will this Chrome attachment issue would get resolved.

lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,

   

 

   

I updated the project to the latest Creator version, PSoC Creator 2.2

   

This project demonstrates the EEPROM interface with an example of an I2C based EEPROM 24C04.

   

The project is attached with this post.

Anonymous
Not applicable

Hi Gautham,

   

                      The version of creator i am using is  Creator 2.0. may be the project was not compatable so i got the following error.

   

Error: sdb.M0062: An error occurred trying to retrieve the DRCs for an instance, 'I2C'. Unable to locate and customize component 'I2C_v3_30' used in schematic 'C:\Documents and Settings\Adm\My Documents\PSoC Creator\Example_I2C_EEPROM\Example_I2C_EEPROM.cydsn\TopDesign\TopDesign.cysch'.

   

Regards

   

PRP

0 Likes
Anonymous
Not applicable

Hi Gautam,

   

                    Actually  i am using Del Sig ADC with 8 bit resolution, 8500 SPS, and it will run for 5 seconds so i get too many samples but the RAM avalaible in PSoC 3 is 8 kb only, so i am going for EEPROM interface to accomodate so many samples , is this a correct option any other way?

   

 

   

Regards

   

PRP

0 Likes
Anonymous
Not applicable

Hi PRP,

   

 

   

You can update to the latest version, that is, PSoC Creator 2.2

   

The link to download this version is here.

Anonymous
Not applicable

With the sample rate of 8500, you'll accumulate more than 42K bytes of data in 5 seconds.

   

You can use external 64KB or 128KB EEPROM to store these samples.

ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

PSOC 3 EEPROM write speed is 1 row in <= 20 mS, a row being 16 bytes.

   

So effective write speed is <= 800 bytes/sec, too slow for your sample rate.

   

 

   

You could write FLASH onboard -

   

http://www.element14.com/community/docs/DOC-48049/l/cypress-ce62384--application-note-on-writing-to-...

   

http://www.cypress.com/?app=forum&id=2232&rID=41766

   

http://www.cypress.com/?rID=44327

   

 

   

Alternatively you could use external NOR FLASH, programming times 256 bytes in 3 mS.

   

 

   

External EEPROM now offered in very fast versions -

   

 

   

http://www.storagenewsletter.com/news/flash/stmicroelectronics-eeprom-m35b32

   

 

   

Regards, Dana.

Anonymous
Not applicable

Hi Dana,

   

              Can we use SD card with memory 1GB or 512KB in place of EEPROM , if we use sd card is there any timing resonse problem occurs.

   

Regards

   

PRP

0 Likes
ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

emFile module can handle the SDCARD. Look at datasheet for config vs

   

write speeds achievable.

   

 

   

Other solutions -

   

 

   

http://code.google.com/p/psoc3-5-sdcard-library/

   

 

   

Although this is a bootloader could be adapted -

   

 

   

https://github.com/kmmankad/SDBoot

   

 

   

Regards, Dana.

ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

On second look SDCARD as a byte write memory may not be approach.

   

 

   

You need to acquire sampes at a rate of 8500 SPS ~= 100 uS/byte which is too

   

fast for byte write speed of SDCARD.

   

 

   

You could use a ping-pong approach, 2 buffers in RAM, one active gathering samples, the

   

other full from prior gather and being written to SDCARD, say 1KB each. Max speed of write

   

for SDCARD,to write1K samples, is ~ 36 mS, compared to 1K samples to gather which is ~

   

118 mS. So record 1KS in buffer A, then switch to B and start recording while writing buffer A

   

to SDCARD, repeat this loop. So switch between buff that is being recorded/buff being written

   

back and forth.

   

 

   

You can do the calculations for smaller buffer size, to see if that works out.

   

 

   

Regards, Dana.

   

 

   

 

   

gather 1000 samplesin RAM

HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

If you only need intermediate storage, you might also use a serial sRAM. Microchip has 1 MBit ones available (e.g. 23LC1024: http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en559066 ). They follow basically the same protocol as the serial EEPROMs, but are much faster. And they have no limits on how often you are allowed to write (and they don't need to be erased before one can write).

Anonymous
Not applicable

hi hli,

   

   Can we use Flash Meomory in place of EEPROM to increase Size of SRAM.

   

Regards

   

PRP

0 Likes
ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

"Can we use Flash Meomory in place of EEPROM to increase Size of SRAM."

   

 

   

SRAM is a single cycle R/W memory. Has no lifetime limit  on R/W cycles

   

FLASH, EEPROM is a 20 mS write speed technology. FLASH specs written

   

aorund 100,000 erase cycles. EEPROM 1,00,000 erase cycles

   

 

   

You could substitue FLASH if you an live with slower write speed and limited

   

erase lifetime.

   

 

   

Regards, Dana.

Anonymous
Not applicable

Hi,

   

uint16 ADC_Samples[ ]; 
int16 ADC_Sample_Index = 0;
writeStatus = EEPROM_1_Write(ADC_Samples[ADC_Sample_Index++], 0);
ERROR: .\main.c:108: illegal pointer conversion

   

i got the following error, but given in data sheet  is cystatus EEPROM_Write(uint8 * rowData, uint8 rowNumber) , which is not matching with  uint16 ADC_Samples[ ]; ,  the ADC here is  14 bit . So is there any way to overcome this problem.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

You can type-cast the pointer:

   

writeStatus = EEPROM_1_Write((uint8_t*)ADC_Samples[ADC_Sample_Index++], 0);

   

(did not try to compile it, though). Note that this call always write 16 bytes of data into the EEPROM. You might want to use EEPROM_ByteWrite() instead.

ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

Are you trying to write individual samples or a whole row of samples ?

   

 

   

You use either

   

 

   

cystatus EEPROM_ByteWrite(unit8 dataByte, uint8 rowNumber, uint8        // to write a byte at a time, so would take 2 writes

   

or

   

cystatus EEPROM_Write(const uint8 * rowData, uint8 rowNumber)            // to write a whole row, row size is

   

 

   

CYDEV_EE_BASE                        The base pointer of the EEPROM memory 

   

CYDEV_EE_SIZE                          The size of the EEPROM memory space in bytes 

   

 CYDEV_EEPROM_ROW_SIZE    The size of a row of the EEPROM in bytes 

   

 

   

So there are several ways to write the EEPROM

   

 

   

Regards, Dana.

   


 

ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

hli had a small typo in write, should be -

   

 

   

   

writeStatus = EEPROM_1_Write((uint8 *)ADC_Samples[ADC_Sample_Index++], 0);

   

 

However, row method wastes memory if you are not writing a whole row's worth of samples. In other words, if ROW is 16 bytes, write 8 A/D samples would be optimal.

 

Regards, Dana.

 

Anonymous
Not applicable

hi hli, dana,

   

the following error came ERROR: .\main.c:108: 'uint8_t': undefined identifier , here i am writing sample by sample from ADC to EEPROM.

   

copy of code

   

----------------------------

   

if (ADC_DelSig_1_IsEndConversion(ADC_DelSig_1_WAIT_FOR_RESULT))
                           {
                               /* Get the result */
                              ADC_Current_Sample = ADC_DelSig_1_GetResult16();
                              ADC_Sample_Available = 1;

   

/* Testing for sample available from the ADC */
                       if (ADC_Sample_Available)
                            {
                               ADC_Sample_Available = 0;
                  
                        /* storing the sample into the array, based on the index */
                               ADC_Samples[ADC_Sample_Index++] = ADC_Current_Sample;   
                               // EEPROM INTERFACE//
                               writeStatus = EEPROM_1_ByteWrite((uint8_t*)ADC_Samples[ADC_Sample_Index++], 0);
                               ADC_Sample_Max = 0;                          
                               for (i = 0; i < ADC_Sample_Index; i++)    
                                    {
                                       if(ADC_Samples>ADC_Sample_Max)
                                           {
                                              ADC_Sample_Max=ADC_Samples;
                                           }

   

-----------------------------------------------------------------------

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi  hli, dana ,

   

i am unable to resolve the problem,i am attaching the bundle_minimal.and i am doing on PSoC 3 ES2, Creator 2.0 version.

0 Likes
ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

In my prior post, change

   

 

   

writeStatus = EEPROM_1_Write((uint8_t *)ADC_Samples[ADC_Sample_Index++], 0);

   

 

   

to

   

 

   

writeStatus = EEPROM_1_Write((uint8 *)ADC_Samples[ADC_Sample_Index++], 0);

   

 

   

Regards, Dana.

Anonymous
Not applicable

Hi dana,

   

           i have changed to writeStatus = EEPROM_1_Write((uint8 *)ADC_Samples[ADC_Sample_Index++], 0);  , but not working.

   

Regards

   

PRP

0 Likes
ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

I compiled OK, but had to change -

   

   

 

       

   

uint16 ADC_Samples[ ];

   

to

   

eg. give it a size.

   

 

   

Also I used Creator 2.2, and had to change silicon to non ES2. Lastly

   

I also updated a number of modules at request of Creator, normal for

   

using a later version of Creator.

   

 

   

Regards, Dana.

   

   

uint16 ADC_Samples[ 16 ];               // Not sure what size you intend

ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

Blasted forum software screwed up post.

   

 

   

change -

   

 

   

uint16 ADC_Samples[ ];

   

to

   

uint16 ADC_Samples[ 16 ];

   

 

   

Regards, Dana.