Xinyuan-LilyGO / LilyGo-T-SIM7080G

42 stars 22 forks source link

I2C conflict between PMU and I2C Sensor #7

Closed wenjun1972 closed 1 year ago

wenjun1972 commented 1 year ago

Hi,

I found an I2C conflict between PMU and I2C sensor. If I give Wire.begin(sda,scl) for MPU6050 sensor ahead of PMU.begin(Wire, AXP2101_SLAVE_ADDRESS, I2C_SDA, I2C_SCL), it reported PMU failed to initialize, if I put Wire.begin(sda,scl) after PMU.begin(), it reports MPU6050 failed to find.


int sda = 13; // You can also use other IO ports int scl = 21; // You can also use other IO ports Wire.begin(sda,scl)

lewisxhe commented 1 year ago

If you use the PMU, you only need to initialize the PMU, no additional statement is required, at this time you must use the SDA and SCL of the PMU

If you want to use another group separately, then you can set the PMU to Wire1, and the sensor uses Wire, because most libraries use the default Wire,

lewisxhe commented 1 year ago

look here https://github.com/Xinyuan-LilyGO/LilyGo-T-SIM7080G/commit/9f63ab0ae8a5af524ca44d59d443ccac0469e4d5