I2C pullup resistance change



  • I saw that the resistor values for the Duex was changed from 5kOhm to 1kOhm at some point.

    But if we plan on using the I2C bus to control extra peripheral ICs, this will add more capacitance to the I2C bus, and so I'm wondering if we need to increase the resistor values (by desoldering the 1k resistors and replacing with something higher). Or maybe its totally fine, just wanted to check.

    And any idea at what speed I2C is running at on the Duex?


  • administrators

    The lower value (1K) pullup resistors will improve performance when there is a lot of capacitance on the I2C bus. The rise time on the I2C bus should not exceed 300ns.

    Duet WiFi Ethernet use 100kHz I2C clock frequency. We originally tried 200kHz, but there were some issues at that speed.



  • Thank you. Can the frequency be changed with a gcode command? If not, then it should be possible to change this in the firmware pretty easily?



  • @jml said in I2C pullup resistance change:

    Can the frequency be changed with a gcode command?

    No. And, yes, can be changed in the code, but not many devices go much lower than 100khz, and increasing it may lead to issues.

    Perhaps if you elaborate a little on what you want to achieve you'll get some alternate suggestions?



  • @bearer Basically I had I2C problems where upon startup, the SDA pin would be 0V instead of being pulled up to 3.3V. So I was troubleshooting it and it seems to be sensitive to the positioning of wires that I have going by the board, and maybe a ground loop with an extra board. So I was just trying to think of ways to make I2C more reliable in addition to fixing the noise (due to wiring) and ground loop issues. But I will just stick with 100khz and 1kohm pullups based on yours and dc42's responses.

    I use a logic level converter to convert the I2C to 5V for a peripheral device. Do you think I should also use 1kohm pullups for the 5V side?



  • @jml said in I2C pullup resistance change:

    I use a logic level converter to convert the I2C to 5V for a peripheral device. Do you think I should also use 1kohm pullups for the 5V side?

    i haven't usually needed that for other projects, but no idea what level translator you are using, or what slave devices. but if sda is driven low it would suggest the level converter or the slave is doing it.

    another pull-up on the 5v side shouldn't hurt as long as both slave and master can still pull it low.


Log in to reply