• So you're saying that middle waveform (with just the small spike) is the one from running the onInit code?

    And you have hardware pullups on the I2C bus - if not that can be an issue since I don't think Espruino is able to use the internal pullup on STM32s, and software I2C can.

    I can try checking with an I2C device on B6/B7 here and see if I can reproduce it. What happens if you do:

    function onInit()
      setTimeout(function() {
        I2C1.setup({ scl : B6, sda: B7 });
      }, 1000);

    Just a note on hardware vs software I2C though - when using hardware, the software kicks off the I2C transmission, but then just busy-waits until it's finished - so you're not really saving many CPU cycles by going hardware vs software - it just means the waveform is a bit more regular (and it can be easier to hit 400kHz).


Avatar for Gordon @Gordon started