I2C Issues: writing to the slave without sending a stop condition?
-
Hey there!
I'm currently trying to write a driver for the MPU 9250 9 axis accelerometer sensor. For this I need the I2C communication to work like this:
To read the internal MPU-9250 registers, the master (LoPy) sends a start condition, followed by the I2C address and
a write bit, and then the register address that is going to be read. Upon receiving the ACK signal from the MPU-
9250, the master transmits a start signal followed by the slave address and read bit. As a result, the MPU-
9250 sends an ACK signal and the data.In order to write the registers-address to the Sensor I wanted to make use of the function I2C.writeto(addr, buf, , stop=True). It is important that the LoPy doesn't send a stop bit, so I wanted to set the stop=False. Unfortunately this causes an error: function takes 3 positional arguments but 4 were given. The documentation says this function does only work for WiPy... Any Suggestions? Thanks!
-
@cylex
for Lopy valid documentation is:
https://docs.pycom.io/pycom_esp32/library/machine.I2C.html#machine.I2Care you sure that you must disable stop?
If i remember that there was especially requiment for minimal stop that can not be shorter then some value - i do not remember if this was 1us or something like that.
But maybe i am wrong.. -
@cylex said in I2C Issues: writing to the slave without sending a stop condition?:
did you try it like that (as you posted)
I2C.writeto(addr, buf, , stop=True)
or that:
I2C.writeto(addr, buf, stop=True) -
@robert-hh the second way ...
-
@cylex
did you tried without?
I2C.writeto(addr, buf)i2c in Lopy (pycom) have not stop paramter
But in this particular device it should work without problem without that parameter... -
@livius the reason why I wanted to use the Other function is having Control of the stop Bit.
I know "your" function Works, but does it Send a stop Bit When it's done?
Thank you for your help!
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