FiPy I2C clock stretching
-
(sysname='FiPy', nodename='FiPy', release='1.20.0.rc8', version='v1.9.4-7b83c6d on 2019-03-06', machine='FiPy with ESP32', lorawan='1.0.2', sigfox='1.0.1')
I can use the FiPy to communicate over I2C at full speed to simple register based devices.
I have an issue when communicating with a more complex device, as I2C errors are seen when communicating at anything but a snail's pace!I believe (the manufacturer has yet to confirm) that the device may implement I2C clock stretching and thus cause bus issues if the host does not also support stretching.
Can PyCom clarify if the FiPy supports slave devices that implement I2C clock stretching?
-
Hello @dave_stones , pycom devices have 3 i2c peripherals , 2 hardware and 1 software(bit bang peripheral ID:2) , the software i2c driver supports clock stretching with timeout of 10ms , currently the timeout is not configurable via micropython. here.
What is the maximum stretch the your slave device can do?
-
I still haven't received a suitable response from the OEM, but I'll update you when I do...
-
I have been informed by the OEM that "Clock stretching should not take more than 20 ms."
-
@dave_stones , Then is it possible you rebuild the Firmware modifying the timeout to 20ms , and see if that fixes the issue? you should be using UART ID=2
-
@iwahdan, the external I2C device now works on I2C bus 2 when using an extended timeout period.
Thanks for solving the problem.
Dave.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login