Q: Performance measurements I2C bus speed?

Issue #39 resolved
Rob Tillaart created an issue

What was the bus speed of the I2C test?

The default 100KHz and 400Khz (max) differ approx a factor 2.5 (found with a PCF8574) So it makes sense to add the bus speed to the test specification. (more work is to test them both)

regards, Rob

Comments (3)

  1. Francisco Malpartida repo owner

    That is a very good point. Test were carried out at 100KHz clk. the drawback of setting higher rates is the capacitive loading of the bus.

    That also brings an interesting question as to add a driver specific clk speed selection flag to configure the driver. Having by default the 100K clk.

  2. Rob Tillaart reporter

    The maker has the option to set the speed in setup() is his main sketch e.g. for a specific sensor or whatever reason, So the LCD library should imho not change the speed of I2C , maybe alter it only temporarily?

    altering could use max speed for the LCD only - in pseudocode:

    prev = getI2Cspeed(); // TWBR; see http://www.gammon.com.au/forum/?id=10896
    if prev != 400 setI2Cspeed(400);
    transfer the string
    if prev != 400 setI2Cspeed(prev)

    could increase the code base quite a bit

    Or alternative it could use conditional code "#define I2CSPEED 400" to keep codebase small (just thinking out loud)

  3. Francisco Malpartida repo owner

    Modified wiki to reflect the HW configuration as to how benchmarks are taken. This mainly applies to CPU and I2C clocks.

    Open a side change request to see viability of having I2C clock speeds configurable by library.

  4. Log in to comment