Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    FiPy I2C clock stretching

    Scheduled Pinned Locked Moved Issues & Bugs
    6 Posts 2 Posters 532 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      dave_stones
      last edited by

      (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?

      1 Reply Last reply Reply Quote 0
      • I Offline
        iwahdan
        last edited by

        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?

        Wahdan

        1 Reply Last reply Reply Quote 0
        • D Offline
          dave_stones
          last edited by

          I still haven't received a suitable response from the OEM, but I'll update you when I do...

          1 Reply Last reply Reply Quote 0
          • D Offline
            dave_stones
            last edited by

            I have been informed by the OEM that "Clock stretching should not take more than 20 ms."

            I 1 Reply Last reply Reply Quote 0
            • I Offline
              iwahdan @dave_stones
              last edited by

              @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

              Wahdan

              D 1 Reply Last reply Reply Quote 0
              • D Offline
                dave_stones @iwahdan
                last edited by

                @iwahdan, the external I2C device now works on I2C bus 2 when using an extended timeout period.

                Thanks for solving the problem.
                Dave.

                1 Reply Last reply Reply Quote 0

                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
                • 1 / 1
                • First post
                  Last post

                Pycom on Twitter

                Pycom