Sending data over I2C, transmission error

  • Hi,
    I would like to ask you for help with the problem that I have encountered today. I would like to send data to my board connected to Duet by I2C. For now I have installed pull-ups on Duet's TWCK0 and TWD0 and connected them to logic analyzer (grounds are connected). When I'm trying to send something using M260, the Duet says:

    M260: I2C transmission error

    And the logic analyzer shows nothing (high on both lines). I have tried to send different data using examples from Gcode documentation "M260: i2c Send Data".
    My setup is DuetEthernet V1.02, firmware 2.01beta2(RTOS).

    Thank you very much for your help!

  • administrators

    Please install firmware 2.01 release and check whether the problem still happens.

    What value pullup resistors did you use? They should be 4.7K.

  • Thank you for lightning fast answer 😄
    Firmware updated to 2.01(RTOS) (2018-07-26b2), resistors are 4.2K (I haven't got 4.7 at the moment), still the same reply from Duet.

  • administrators

    Thanks, I'll look into this tomorrow or Friday.

  • Great, thank you very much!

  • administrators

    What is the exact M260 command you are using?

  • administrators

    I have just tested M260 and M261 and they is working for me. The "I2C transmission error" message is produced if no slave responds at the I2C address you specified. So please check the following:

    • You specified the correct I2C slave address in the A parameter of the M260 command. Note that I2C addresses are usually specified in hex, but you need to use the decimal equivalent in the M260 command.
    • You have connected the I2C device correctly to the Duet. If you have connected it to the header pins on a DueX2 or DueX5, please note that the TWC and TWD legends are swapped on older boards. TWC is the pin next to GND.

  • Ok, strange thing 🙂
    I have connected my setup today to check the commands for you and I2C seems to work fine. When I'm sending "M260 A3 B65" I can see the state changes according to address being sent:

    0_1533907087710_Zrzut ekranu 2018-08-10 15.15.46.png

    Of course Duet is still saying "Error: M260: I2C transmission error", but now I know that is because I'm not sending ACK from my side.
    So the last time I have probably connected something wrong, sorry for bothering you 🙂

Log in to reply