cancel
Showing results for 
Search instead for 
Did you mean: 

SPI problems

frankfrank953
Associate II
Posted on May 21, 2010 at 00:30

SPI problems

2 REPLIES 2
chikos332
Associate II
Posted on May 17, 2011 at 13:51

Hi,

After writing to the memory, do you wait some time till the data are physically written (many memories just write in a ''tampon'' buffer then when it is full it is transferred to physical memory and it takes a considerable time).

You can try by adding some delays between writes and reads (and also between different write operations when location is different).

Cheers.

frankfrank953
Associate II
Posted on May 17, 2011 at 13:51

Thanks chokos, After checking the code and seeing that I do indeed wait for the activity bit to be reset I looked back at the datasheet for the part's that I have attempted to communicate with and found the root of my problem.

I was only able to store data once the device has been erased.. and thats the key.  The block/page that you need to write to has to have been erased to 0xFF so that the device will allow a state change of each bit/byte.

So warning to anyone who is looking to use an SPI device as a non volatile storage device make sure you choose one that allows you to erase small blocks. to prevent huge holes in your memory mapping.

I see now why they are used for firmware storage as they tend to be erased and written to as a complete image and only changed on a complete firmware update.  I am attempting to use it as a replacement for an i2c device.

Got there in the end though......