2010-05-20 03:30 PM
SPI problems
2011-05-17 04:51 AM
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.2011-05-17 04:51 AM
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......