2018-01-16 12:17 AM
Hello,
I'm using LSM6DSL in sensor hub mode with LIS2MDL, using the example in IKS01A2 I have managed to activate the LIS2MDL and read data from it.
My current issue is that I can't put the LIS2MDL in low power mode, I tried using 'LSM6DSL_ACC_GYRO_SH0_WriteByte' function but it get stuck in the while loop waiting for 'LSM6DSL_ACC_GYRO_SENS_HUB_END_OP_COMPLETED'
Can you please assist?
Thank you,
Michael
2018-01-17 06:46 AM
Do you think you can share the whole project?
2018-01-17 07:08 AM
My guess is that there is not a correct I2C connection between the master and slave devices and the function hangs, because it doesn't get an ACK from the slave sensor.
Are you sure that the devices are properly connected, with pull-ups to Vcc? Do you have a possibility to check the logic levels of the I2C communication (using a logic analyzer)? Schematics of your HW could also help with a diagnose.
Also, check whether you use the correct I2C addresses of the sensors.
2018-01-17 08:13 AM
Koudela.David
I don't think so, because Michael wrote 'I have managed to activate the LIS2MDL and read data from it' so he is able to read data from the magnetometer using LSM6DSL as sensor hub. I don't expect any issue with I2C address or connection. But this feature is quite complex and some operations can be tricky.
2018-01-17 11:21 AM
Hi,
Unfortunately I can't share the project, but I have use the sensor hub example from
IKS01A2 SDK without any changes, and for the LIS2MDL idle command i use - 'LSM6DSL_ACC_GYRO_SH0_WriteByte(LSM6DSL_X_0_handle, LIS2MDL_MAG_I2C_ADDRESS, LIS2MDL_MAG_CFG_REG_A, LIS2MDL_MD_IDLE) != MEMS_SUCCESS'
2018-01-17 11:26 AM
Thank you for replay David,
The sensor hub function is working for data reading from the LIS2MDL, the issue is when I try to power down the LIS2MDL the command is stuck waiting for the sensor hub register.
I also tried idle 1, idle 2 and single mode of the LIS2MDL but I got same result. I also see that the current consumption doesn't drop down after the idle command.
The circuit is very small and I cant use logic diagnose.
Maybe I need to do more operations before I switch to idle mode
2018-01-18 01:24 AM
Update:
I can enter the LIS2MDL to idle mode, but now I cant restart it