I2C repeated start
-
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().
-
@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) -
@daniel
Yes, I used readfrom_mem() and writeto_mem().Thanks a lot for your solution proposal, this approach works for me well :)
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