I am working to create a controller for a Micron NOR Flash Memory (MT25QL128ABB) and I am having difficulty writing/reading the device. I would like to know if my procedure is correct:
Write Procedure:
Send the write enable command (06h)
Latch the write enable command in by raising the #S line
Lower the #S line
Send the page program command (02h)
Send the write address (24 bits)
Send the write data (I am writing 96 bits)
After the last bit of the write data has been sent, raise the #S line
Read Procedure:
Lower the #S line
Send the read command (03h)
Send the read address (24 bits)
Continue sending clock signal for 96 bits
After the last clock has been sent, raise the #S line
The datasheet is as follows:
For a read:
For a write (page program):
After I attempt a write, I read the status register and I see that the "write enable" bit is still set. The datasheet indicates that the write enable latch should be cleared automatically after a page program command whether or not it was successful. This indicates to me that the page program command is not being executed.
When I attempt a read, I would expect since I haven't successfully programmed the memory I would get all 1's. The device does indeed return all 1's on a read however it continues to output for a set amount of time even after I have stopped the clock and raised the #S line.
Note that I am able to successfully read the status register, flag status register, device ID, set the write enable latch, and clear the write enable latch at will. Before attempting a page program command I always send the bulk erase command to ensure the device is erased. I am running the CLK to the memory device at 20 MHz, well below the max. frequency.
Here is the timing diagram of what I see when I try a read:
(not to scale)
Here is what I send for a write:
(not to scale)
Note that these diagrams do not show the actual number of clocks