Need to change I2C bus speed to 50KHz

Hi Folks,
I’m working with an I2C LCD rated for up to 50KHz and it is showing a fair number of glitches. Can anyone tell me how to lower the I2C speed from the default values, which I understand to be 100KHz, minimum?  The platform is the nRF Feather, board rev 5. I have posted this over in Circuit Dojo.

I tried the I2C_SPEED_SET() macro, which threw a warning and I tried a few speed settings in the overlay file but am still seeing display glitches. Does anyone know the proper way to do is?

Thanks,
Jim

Parents
  • Zephyr (nRF connect SDK) ships a software I²C driver that only requires two GPIO ports, try using that when you need to run this slow.

    IIRC it does not support clock stretching out-of-the-box.

  • Thanks for the suggestion, Turbo J.  I didn't find the software-only driver. If you can share a pointer to it, I'll look it over. A supported option would be nice to have.

    Thanks,

    Jim

  • Look for i2c_bitbang and i2c_gpio in the driver sources.Needs to be configured via devicetree as "gpio-i2c".

    I only see an example for spi bitbang in the samples.

  • Got it - thanks!

Reply Children
No Data