GPIO I2C speed (SCK)

I’m using VIM1_Ubuntu-xfce-bionic_Linux-4.9_arm64_SD-USB_V20191231 ROM. Is there is a way to change default i2c frequency? I’m running i2cdetect utility and as I can see it is around 400kHz (390) by default. How can I configure it to 100kHz ?

just change dtb file

cd /boot
cp dtb.img dtb.img.bak
dtc dtb.img > dtb.img.dts
nano dtb.img.dts

find i2c node and change freq from

clock-frequency = <0x61a80>;

to

clock-frequency = <0x186a0>;

rebuid dtb file

dtc dtb.img.dts > dtb.img

reboot

PS: 0x61a80 == 400000 and 0x186a0 == 100000

3 Likes

Thanks a lot! Will it affect both I2CA (pins 22,23) and I2CB (pins 25,26) ?

In my case Nodes are:

i2c@8500 - /dev/i2c-0 - i2cA
i2c@87c0 - /dev/i2c-1 - i2cB