How do you enable any of the i2c peripherals on the nRF9160 dk boards?
I tried changing the device overlay to the code below:
&i2c0 {
How do you enable any of the i2c peripherals on the nRF9160 dk boards?
I tried changing the device overlay to the code below:
&i2c0 {
Hello Jerome,
How do you enable any of the i2c peripherals on the nRF9160 dk boards?
You can check all default configured peripherals in ../<your_application_root/<your_build_folder>/zephyr/zephyr.dts. On the nRF9160 DK, &i2c2 is enabled by default.
i2c2: arduino_i2c: i2c@a000 {
compatible = "nordic,nrf-twim";
#address-cells = < 0x1 >;
#size-cells = < 0x0 >;
reg = < 0xa000 0x1000 >;
clock-frequency = < 0x186a0 >;
interrupts = < 0xa 0x1 >;
status = "okay";
label = "I2C_2";
pinctrl-0 = < &i2c2_default >;
pinctrl-1 = < &i2c2_sleep >;
pinctrl-names = "default", "sleep";
};
Due to memory instantiation, you have to disable &uart0 to be able to enable &i2c0 and &spi3 to be able to enable &i2c3 respectively.
Additionally,
CONFIG_I2C=y
needs to be set in your prj.conf.
Unless you are aware of the fact that you have to switch over to RTT if logging is needed, disabling &uart0 is not recommended from my side.
Regards,
Markus
Hello Jerome,
How do you enable any of the i2c peripherals on the nRF9160 dk boards?
You can check all default configured peripherals in ../<your_application_root/<your_build_folder>/zephyr/zephyr.dts. On the nRF9160 DK, &i2c2 is enabled by default.
i2c2: arduino_i2c: i2c@a000 {
compatible = "nordic,nrf-twim";
#address-cells = < 0x1 >;
#size-cells = < 0x0 >;
reg = < 0xa000 0x1000 >;
clock-frequency = < 0x186a0 >;
interrupts = < 0xa 0x1 >;
status = "okay";
label = "I2C_2";
pinctrl-0 = < &i2c2_default >;
pinctrl-1 = < &i2c2_sleep >;
pinctrl-names = "default", "sleep";
};
Due to memory instantiation, you have to disable &uart0 to be able to enable &i2c0 and &spi3 to be able to enable &i2c3 respectively.
Additionally,
CONFIG_I2C=y
needs to be set in your prj.conf.
Unless you are aware of the fact that you have to switch over to RTT if logging is needed, disabling &uart0 is not recommended from my side.
Regards,
Markus