Hello,
My setup: nRF Connect SDK 1.9.1 + nRF52DK-nRF52805 + MPU9250 & MS5607 Sensors driven by gpio-i2c.
right now, I have eyerything working on my Prototype, except gpio sensor powering.
I want the GPIOS to power the Sensors and I2C Busses. This should work in normal gpio mode regarding the current draw of both sensors.
As you can see, I tried a little using vin-supply and supply-gpios in the DT.overlay :
#include <dt-bindings/gpio/gpio.h>
/ {
zephyr,user {
io-channels = <&adc 9>;
};
imu_pwr: imu-pwr-ctrl {
compatible = "regulator-fixed";
label = "imu-pwr-ctrl";
regulator-name = "imu-pwr-ctrl";
enable-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
};
pressure_pwr: pressure-pwr-ctrl {
compatible = "regulator-fixed";
label = "pressure-pwr-ctrl";
regulator-name = "pressure-pwr-ctrl";
enable-gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
};
i2c1 {
compatible = "gpio-i2c";
sda-gpios = <&gpio0 26 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
scl-gpios = <&gpio0 27 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
status = "okay";
clock-frequency = < 100000 >;
#address-cells = <1>;
#size-cells = <0>;
label = "i2c1-gpio0";
mpu9250@68 {
compatible = "invensense,mpu9250";
gyro-sr-div = <0>;
gyro-dlpf = <250>;
gyro-fs = <2000>;
accel-fs = <16>;
accel-dlpf = "218.1";
reg = <0x68 >;
label = "MPU9250";
status = "okay";
//supply-gpios = < &gpio0 22 GPIO_ACTIVE_HIGH >;
//vin-supply = < &imu_pwr >;
};
};
i2c2 {
compatible = "gpio-i2c";
sda-gpios = <&gpio0 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
scl-gpios = <&gpio0 25 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
status = "okay";
clock-frequency = < 100000 >;
#address-cells = <1>;
#size-cells = <0>;
label = "i2c2-gpio0";
ms5607@76 {
compatible = "meas,ms5607";
reg = <0x76>;
label = "MS5607-2";
//supply-gpios = < &gpio0 23 GPIO_ACTIVE_HIGH >;
//vin-supply = < &pressure_pwr >;
};
};
};
//status auf disabled setzen zwingend erforderlich, sonst funktioniert der gpio-i2c Treiber nicht
&i2c0 {
status = "disabled";
};
&adc {
status = "okay";
};
&gpio0 {
status = "okay";
};
I need an advice, how to manage this in the right way. Further I want do add a delay of 10ms because of the initial power spike and sensor initialisation.
Therefore I wanted to use 'i2c-gpio,timeout-ms', but this isn't supported in the used SDK/Zephyr version I think?
Best regards,
Jonas