You are here

spi eeprom | Cypress Semiconductor

spi eeprom

Summary: 15 Replies, Latest post by DEPREDADOR1888 on 22 Oct 2016 08:20 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
user_194637079's picture
User
11 posts

hi every one i have a problem whit a memory eeprom , I have done work this memory :  http://www.atmel.com/images/atmel-8535-seeprom-at25320b-640b-datasheet.pdf  
agree to the application note :  http://www.cypress.com/documentation/application-notes/an51234-getting-s...

the problem is that now I want to run this one and I can not write because apparently I can read 

http://www.atmel.com/images/atmel-8832-seeprom-at25m02-datasheet.pdf

I do not know why
 

 

user_1377889's picture
User
9583 posts

The write protect signal?

When you provide us with schematic and project bundle there might be a chance to find the reason.

 

Bob

user_194637079's picture
User
11 posts

what should do firmware is that when sending this chain 
 2 011,141016,140737,20.97278,-89.66397,0.0,245.22,1,0,0,0
must save it and when send a 1 
should read

user_194637079's picture
User
11 posts

maybe you can not compile the project for lack of these libraries 

 

Attachments: 
user_1377889's picture
User
9583 posts

Sorry, but I couldn't see any ambiguities in your code. Have you got an ICE-Cube to debug your code?

 

Bob

user_194637079's picture
User
11 posts

yes and I could see if that gets stuck in the part where the memory has to answer for the full write is always the status register answers with a 11111111 then wanted to know why the 64kb works and with 2Mb not might be going

user_1377889's picture
User
9583 posts

Can it be that the address is wrong, because the 2MB part needs 3 byte addresses while the 64kB only needs 2 bytes?

 

Bob

user_194637079's picture
User
11 posts

how I can reroute that in my code?

 

user_1377889's picture
User
9583 posts

Check your

void SPI_EEPROM_Write(BYTE AddrLSB, BYTE* buffer)

in this function you set the eeprom's address msb, but there need more address bytes to be set afaik.

 

Bob

user_194637079's picture
User
11 posts

yes but i don know how i can write this part of the code 

CHIP_SEL_LOW               
    
    for(bDelay=0;bDelay<3;bDelay++);
    
    Write opcode 
    SPIM_SendTxData(EEPROM_WRITE);                   
    while(!(SPIM_bReadStatus() & SPIM_SPIM_SPI_COMPLETE)){};
        
    MSB 
    SPIM_SendTxData(0x00);                   
    while(!(SPIM_bReadStatus() & SPIM_SPIM_SPI_COMPLETE)){};
        
    Byte address LSB 
    SPIM_SendTxData(AddrLSB);                   
    while(!(SPIM_bReadStatus() & SPIM_SPIM_SPI_COMPLETE)){};
        
    Data 
    SPIM_SendTxData(*buffer);                   
    while(!(SPIM_bReadStatus() & SPIM_SPIM_SPI_COMPLETE)){};
    
    for(bDelay=0;bDelay<3;bDelay++);
    
    CHIP_SEL_HIGH

user_1377889's picture
User
9583 posts

See page 13 of the datasheet you supplied. Under "Byte Write" you see that you have to transmit 24 address bits which are three bytes. Two bytes will not be enough, so transmit an additional one (can be zeroes).

Remember: Same applies when reading.

 

Bob

Log in to post new comments.