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

TWI clock stretching for nrf51822

Dear Nordic developers,

Does TWI supports bit level clock stretching? Means that after each bit (not byte) slave can hold down the clock and master should perform appropriate actions.

As I understand from the documentation, it supports only byte level clock stretching.

I'd really appreciate any advise.

Best regards, Harut

Parents
  • Hi. I tested it and it seems to work. I agree that we should have better documentation on this.

  • I guess you can test it using a device which only tolerates low clock speeds, e.g. 100 kHz. Then you can try to run the TWI on your nRF51 at 400 kHz and see how the slave behaves. I actually concluded it works based on an unrelated test I have done and a brief talk with the TWI designer (who hadn't tested bitwise stretching specifically). What I did was actually testing what would happened if I used too large pullup resistors on the TWI lines. More specifically, what would happen if you only used the nRF51's internal 12 kOhm pullup resistors. What happened was that the device was not able to drive the lines as fast as I wanted and reduced the clock speed from 400 to 200 kHz (basically stretching the clock signals) due to slow rise times on the TWI lines. Except from the reduced clock speed it worked fine, so I concluded that bitwise clock stretching works.

Reply
  • I guess you can test it using a device which only tolerates low clock speeds, e.g. 100 kHz. Then you can try to run the TWI on your nRF51 at 400 kHz and see how the slave behaves. I actually concluded it works based on an unrelated test I have done and a brief talk with the TWI designer (who hadn't tested bitwise stretching specifically). What I did was actually testing what would happened if I used too large pullup resistors on the TWI lines. More specifically, what would happen if you only used the nRF51's internal 12 kOhm pullup resistors. What happened was that the device was not able to drive the lines as fast as I wanted and reduced the clock speed from 400 to 200 kHz (basically stretching the clock signals) due to slow rise times on the TWI lines. Except from the reduced clock speed it worked fine, so I concluded that bitwise clock stretching works.

Children
No Data
Related