This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

TWI delay between address and read

Hi, I am using TWI on a 52832 (sdk12.2) and am having problems with reading data. The slave chip that can take up to 60uS (8 bus clock cycles) between to set up data after receiving the address of a read request. Currently, this delay is about 27uS. What would be the best way to stretch this time? Thank you, Andrew

Parents
  • nRF52 is TWI master? If slave needs more time to process/prepare data then it should use clock stretching (hold it low), nRF52 TWI master peripheral block supports it and transport of next character should be delayed until slave releases SCL line. Also do both master and slave use same clock frequency?

  • Thanks for the quick response.

    Yes, the TWI is the master. Both the slave and the master (Nordic) claim to be clock stretching, but after an application engineer for the slave looked at the waveforms on a scope, he suspects that the timing is too short, causing intermittent incorrect reads of the slave's registers. What is interesting, is that the cases I have caught are the same value, independent of the register address. The suggestion was to add an artificial delay between ack and the data.

    I added some bit flipping of an I/O pin to see where I had software control, and did not find a place where there was software access between the address/ack of the read, and the clock.

    Thoughts?

Reply
  • Thanks for the quick response.

    Yes, the TWI is the master. Both the slave and the master (Nordic) claim to be clock stretching, but after an application engineer for the slave looked at the waveforms on a scope, he suspects that the timing is too short, causing intermittent incorrect reads of the slave's registers. What is interesting, is that the cases I have caught are the same value, independent of the register address. The suggestion was to add an artificial delay between ack and the data.

    I added some bit flipping of an I/O pin to see where I had software control, and did not find a place where there was software access between the address/ack of the read, and the clock.

    Thoughts?

Children
No Data
Related