cancel
Showing results for 
Search instead for 
Did you mean: 

Hello, I try to read 64 bytes of the memory in a loop. I can read, it works fins, but I must wait ever 100ms between each command to read 61 byte. If I don’t wait 100ms in each command of reading, I receive error. Why? Thanks

Arnaud1
Associate III

I2C is 400KHz, but I have same problem at other speed SCL.

I use ST25DV16K-I.

1 ACCEPTED SOLUTION

Accepted Solutions
JL. Lebon
ST Employee

​Hello,

Are you doing I2C read or I2C write ? I'm not sure I understood.

Read and write are different:

  • after an I2C read, you can start another command immediately.
  • after a I2C write in EEPROM, you must wait for the EEPROM programming time before issuing a new I2C command. If trying to read or write during programming time, you will receive a Nack.

The programming time is ~5ms for 4 bytes. In your case, if you write 64bytes, the programming time will be 16*5ms=80ms (+/-5ms if you started on a non paged-aligned byte). So, in case of I2C write, it is normal that you cannot access the tag for ~80ms following the STOP.

In case of a read, followed by another i2c command, there is no delay required.

This is common behavior for EEPROM memories.

Does this correspond to your use case?

Best regards.

View solution in original post

5 REPLIES 5
JL. Lebon
ST Employee

​Hello Arnaud,

You should normally be able to  start a new I2C read command immediately after the stop condition of the previous read command.

There may be some traffic on the I2C bus (to other slave devices ?) or traffic on RF interface ? If there is RF commands on going, I2C access is not acknowledged. Is there a RF reader with RF field ON present on the antenna when this happens ?

Best regards.

Arnaud1
Associate III

Hello,

thanks for response.

There are no traffic on I2C , only ST25DV16K-IN 

Not traffic RF also, I just try to write or read memory, (as a classic memory...), without RF device close, I have also remove NFC antenna to be sure ! I have the same problem to read or write, I must wait about 100 ms between each read/write command . 

Best regards,

Arnaud

Arnaud1
Associate III

The first command works always, and then, if I dont wait 100 ms, the device ST25DV16Kreturn NACK and STOP bit for the second command.

The command are the same to avoid error, I try to write 64 bytes.

Best Reagrds

Arnaud

JL. Lebon
ST Employee

​Hello,

Are you doing I2C read or I2C write ? I'm not sure I understood.

Read and write are different:

  • after an I2C read, you can start another command immediately.
  • after a I2C write in EEPROM, you must wait for the EEPROM programming time before issuing a new I2C command. If trying to read or write during programming time, you will receive a Nack.

The programming time is ~5ms for 4 bytes. In your case, if you write 64bytes, the programming time will be 16*5ms=80ms (+/-5ms if you started on a non paged-aligned byte). So, in case of I2C write, it is normal that you cannot access the tag for ~80ms following the STOP.

In case of a read, followed by another i2c command, there is no delay required.

This is common behavior for EEPROM memories.

Does this correspond to your use case?

Best regards.

Arnaud1
Associate III

Thanks you for your answer.

I have try I2C  WRITE and I2C  READ.

It seems my protocol to write and read is according with your epliaction. However, I understand now the problem for about 80 ms in WRITE. 

it means that I probably have an error then in my protocol to READ...

I continue my investigations.

Best regards,

Arnaud