I’m been working a project with my BBB that requires use of I2C. I’ve successfully communicated with devices on the I2C2 bus (Pins 19/20), but the default clock rate of 100kHz is too slow for my application. I set my devices to function at 400kHz but I still need to configure the BBB to run I2C2 at 400kHz. I have tried to use the following device tree overlay but it has no effect on the bit rate:
`
/dts-v1/;
/plugin/;
/ {
compatible = “ti,beaglebone”, “ti,beaglebone-black”;
/* identification */
part-number = “BB-I2C2”;
version = “00A0”;
/* state the resources this cape uses /
exclusive-use =
/ the pin header uses /
“P9.20”, / i2c2_sda /
“P9.19”, / i2c2_scl /
/ the hardware ip uses */
“i2c2”;
fragment@0 {
target = <&am33xx_pinmux>;
overlay {
bb_i2c2_pins: pinmux_bb_i2c2_pins {
pinctrl-single,pins = <
0x178 0x73 // spi0_d1.i2c2_sda, SLEWCTRL_SLOW | // INPUT_PULLUP | MODE3
0x17c 0x73 // spi0_cs0.i2c2_scl, SLEWCTRL_SLOW | // INPUT_PULLUP | MODE3
;
};
};
};
fragment@1 {
target = <&i2c2>; /* i2c2 is numbered correctly */
overlay {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&bb_i2c2_pins>;
/* this is the configuration part */
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
};
};
};
`
I’ve used a similar Device Tree Overlay to start the normally disabled I2C1 bus, but in both instances I cannot set the bitrate. Is there something wrong with my device tree overlay or is there a better way to set the I2C2 bitrate?