Timeout added to i2c hardware library

12 views
Skip to first unread message

rob...@hotmail.com

unread,
Feb 24, 2024, 4:18:31 AM2/24/24
to jallib
Hi all,

For your information so that you know. 

When working on a project using i2c it sometimes happens that the i2c is not working due to some misconfiguration. The result is then  that my PIC hangs because the i2c hardware library is waiting for a response. The only solution is then to reset the PIC. I found this annoying so I added an optional timeout feature to the i2c hardware library.

If you define a timeout, it will wait for a i2c response but no longer than the minimal time given in the timeout value. I added one new sample file to demonstrate it using an i2c eeprom. If you do not define the timeout, the code is the same as before.

Kind regards,

Rob

Reply all
Reply to author
Forward
0 new messages