Skip to content

Use SoftWire for Master and Wire for Slave #2

@lpatiny

Description

@lpatiny

Some devices are Master I2C one 2 pins as well as Slave I2C on the SDA / SCL pins.

Problem with the official Wire library is that it tends to crash when you hotplug devices or there is some communication problems.

arduino/Arduino#1476

We should systematically use SoftI2CMaster for Master I2C that has the following interesting flags:

  • I2C_PULLUP = 1 meaning that internal pullups should be used
  • I2C_CPUFREQ, when changing CPU clock frequency dynamically
  • I2C_FASTMODE = 1 meaning that the I2C bus allows speeds up to 400 kHz
  • I2C_SLOWMODE = 1 meaning that the I2C bus will allow only up to 25 kHz
  • I2C_NOINTERRUPT = 1 in order to prohibit interrupts while

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions