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!

  • @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!

  • @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...

  • @robert-hh the second way ...

  • @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)

  • @cylex
    for Lopy valid documentation is:

    are 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..

Log in to reply

Pycom on Twitter

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.