cancel
Showing results for 
Search instead for 
Did you mean: 

M95512 failed to read immediately after writing

jiafeimao
Associate

 

I write four bytes of data to M95512, and after the writing is completed, I read these four bytes. I must delay the writing for more than 3 milliseconds to read the correct bytes. Delays less than 3 milliseconds will read 0XFF. Why is this?

What does “Byte Write within 5 ms” mean?Does it take 5ms to write a byte? Looking forward to any suggestions and responses.

jiafeimao_0-1717065616843.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

Welcome @jiafeimao, to the community!

The various writes can in fact take a maximum of 5ms for a single byte (data sheet, table 19). However, the time can vary, which is why it makes sense to determine the end of the write process with bit WIP (bit 0 of the Read Status Register RDSR, see data sheet, section 6.3.1).

However, a Page Write takes just as long, but can write several bytes in one go from a given start address.

One more addition to the write cycle time tW - the data sheet mentions about this in a note in section 6.6:

The self-timed write cycle tW is internally executed as a sequence of two consecutive events: [Erase addressed byte(s)], followed by [Program addressed byte(s)].

When writing a byte, the byte must first be erased, which is why it can take a little longer for individual bytes. With page write, the bytes are erased in one go, which is why writing is significantly faster.

Does it answer your question?

Regards
/Peter

BTW: you should also take the opportunity to download the new data sheet, your extract is still from the old revision 23.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
Peter BENSCH
ST Employee

Welcome @jiafeimao, to the community!

The various writes can in fact take a maximum of 5ms for a single byte (data sheet, table 19). However, the time can vary, which is why it makes sense to determine the end of the write process with bit WIP (bit 0 of the Read Status Register RDSR, see data sheet, section 6.3.1).

However, a Page Write takes just as long, but can write several bytes in one go from a given start address.

One more addition to the write cycle time tW - the data sheet mentions about this in a note in section 6.6:

The self-timed write cycle tW is internally executed as a sequence of two consecutive events: [Erase addressed byte(s)], followed by [Program addressed byte(s)].

When writing a byte, the byte must first be erased, which is why it can take a little longer for individual bytes. With page write, the bytes are erased in one go, which is why writing is significantly faster.

Does it answer your question?

Regards
/Peter

BTW: you should also take the opportunity to download the new data sheet, your extract is still from the old revision 23.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.