by patadino » Thu Feb 19, 2009 8:15 am
1)Have you looked at the SPI signals on a scope?...No I haven't looked, but It's extrange that the WREN command and RDSR command works OK!, but when I erase all the Flash Program blocks (0 to 31) and read after that the memory result is:
0000h FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0010h FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0020h FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0030h FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0040h FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0050h 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0060h 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0070h 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0080h FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
There are some bits that don't erase and don't do nothing....
2) When I program the memory, for example with : AA BB CC DD EE starting at 0x0000 the result of reading the memory is:
0000h AB BA CD DC EF FF FF FF FF FF FF FF FF FF FF FF
0010h FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0020h FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0030h FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0040h FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0050h 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0060h 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0070h 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0080h AB BA CD DC EF FF FF FF FF FF FF FF FF FF FF FF
0090h FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
...the memory is not right programmed, allways fail writing the last bit I don't know why!...
3) I have checked the SPI functions and commands and I haven't seen any error...Any other IDEA?¿...
4) I have checked the timing that appear to be OK!...and then WREN and RDSR works OK!
...I will build a new PCB with new components to discard bad chip hardware...
...Thanks a lot Brennen...
You may have an error in your code somewhere that is causing the device to program incorrectly. Also, you may be trying to operate the SPI interface at too high of a speed, so you might want to check that out. Finally, are you checking to make sure the write operation has completed before you do any more operations?