2019-04-11 10:48 AM
Hi,
We are using the LSM6DSL sensor in a custom PCB, we are also using the X-CUBE-MEMS extension drivers to communicate with the MEMS sensor. The image below is the schematic part of the LSM6DSL. VCC_IMU being 3v3, W1 is closed with a solder jumper to VCC_IMU, the microcontroller is also powered at 3v3 and the I2C logic signals are 3v3, the Pull-Up resistors are 4k7 each one, the bus is running at 100000.
The configuration of the IMU using the X-CUBE-MEMS API is:
static LSM6DSL_Object_t lsm;
static LSM6DSL_IO_t io_ctx = {
.Address = LSM6DSL_I2C_ADD_H,
.BusType = LSM6DSL_I2C_BUS,
.Init = BSP_I2C1_Init,
.DeInit = BSP_I2C1_DeInit,
.GetTick = BSP_GetTick,
.ReadReg = BSP_I2C1_ReadReg,
.WriteReg = BSP_I2C1_WriteReg
};
When trying to use LSM6DSL_Init, LSM6DSL_ACC_Enable or LSM6DSL_GYRO_Enable the IMU replies with an NACK. Here is the logic analyzer capture of the microcontroller trying to communicate with the IMU.
So my questions are:
Regards,
Carlos
2019-04-15 06:53 AM
I just realized that the MEMS sensor isn't replying at all.
2019-04-16 02:45 AM
hi carlos, could you share the logic analyze capture? please consider that the CS, and not the CS* as in your schematic, should be high, so CS* should be low to activate I2C... regards
2019-04-16 07:29 AM
Sure, i will upload the logic analyzer capture later today.
Which CS you mean? As far as i know the /CS of my schematic should be high to be in I2C or low to be SPI mode.
EDIT:
Here's the logic analyzer capture:
The SDO/MISO line is set to logic 1, /CS is also set to logic 1.
Here's a capture of the I2C bus of the x-nucleo-iks01a2 dev board, which have the same settings:
My custom PCB have external pull up resistors of 4k7 ohms, i had also tried using the microcontroller internal pull up resistors but the problem remains.
2019-04-17 12:12 AM
hi carlos, thank you for the sharing. Yes, I was wondering why you put CS* in inverse logic instead of CS only, as in X-nucleo-iks01a2.
Btw, did you try any other parts? You should also check if the customer I2C master is able to read at 3.3V or if there are any restriction for I2C communication. regards
2019-04-17 08:56 AM
Hi, it's just the symbol graphic.
Btw, did you try any other parts? You should also check if the customer I2C master is able to read at 3.3V or if there are any restriction for I2C communication. regards
Yes, actually i plugged the I2C bus of the X-NUCLEO-IKS01A2 to my custom board and i'm able to identify and get data from that IMU, and also i can identify and read the sensor data from my custom board IMU (now SDO is set to logic low to don't collide with the X-NUCLEO-IKS01A2 IMU address), so i think is matter of coupling.