Hey Jim
Typically you can use the clock-frequency
entry for that particular bus:
&i2c1 {
compatible = "nordic,nrf-twim";
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
pinctrl-0 = <&i2c1_default>;
pinctrl-1 = <&i2c1_sleep>;
pinctrl-names = "default", "sleep";
There are some pre-defined values in i2c.h
:
#define I2C_BITRATE_STANDARD 100000 /* 100 Kbit/s */
#define I2C_BITRATE_FAST 400000 /* 400 Kbit/s */
You should be able to indicate the rate if there’s no macro for it:
clock-frequency = <250000>;
If you’re using the nRF9160, it only supports 100, 250, and 400 kbps. If you’re getting glitches I recommend changing or adding external pull-ups to the I2C interface. The nRF9160 Feather has 20K pullups which isn’t sufficient in some cases. (depends on the capacitive loading of I2C signals by all sensors and devices on the bus)