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

    I2C repeated start

    Scheduled Pinned Locked Moved Firmware
    bug
    3 Posts 2 Posters 1.4k 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
      danielm
      last edited by

      Is I2C using repeated start by default?

      I am having trouble to communicate with Lidar Lite v3, issues are similar to this post (Lidar+RPi): http://www.robotshop.com/forum/lidar-lite-v3-return-always-zero-with-raspberry-pi-3-t15710

      In the Lidar Lite v3 datasheet it is written:
      This device does not work with repeated START conditions. It must first receive a STOP condition before a new START condition.

      I tried both hardware (0 and 1) and software (2) I2C buses. Lidar's address is returned correctly with machine.I2C.scan().

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

        @danielm is that happening when you try to do readfrom_mem() and writeto_mem()? Solution is then to assemble the memory operations manually using writeto (set the stop argument to True) and readfrom. A generic example:

        reg[0] = 117 # register address
        i2c.writeto(addr, reg, stop=True) # just write the register address
        # now read
        i2c.readfrom_into(addr, reg)
        
        1 Reply Last reply Reply Quote 0
        • D Offline
          danielm
          last edited by

          @daniel
          Yes, I used readfrom_mem() and writeto_mem().

          Thanks a lot for your solution proposal, this approach works for me well :)

          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