cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DS3TC-R I2C issue

captainfips
Associate II

Hi,

I am using a XIAO BLE Sense Board that uses an nRF52840 MCU and an LSM6DS3TC-R connected via I2C. The original bootloader from Seeed works fine with their library for the gyro sensor and I am now trying to develop my own with the nRF5 SDK.

At the moment I have issues with the I2C connection, so the sensor works fine when powering the device on most of the time, but in some cases it is unpredictably not answering on the I2C bus when reading/writing to the sensor (read WHO_AM_I as the first transmission). I think no ACK is sent after the adress or after the first byte of data (the subaddress), but I cannot confirm that because the Pins of neither the MCU nor the gyro sensor are accessible on the breakout board for an oscilloscope.

Is it possible that the gyro sensor needs some kind of I2C reset or some kind of SDA/SCL push pull sequence that it starts responding again? Or do I need to unpower it for a few ms to reset everything maybe?

Thanks in advance and best regards!

1 ACCEPTED SOLUTION

Accepted Solutions
captainfips
Associate II

Hi,

I found out the issue was the configured drive strength of the output pin of the nrf chip: https://devzone.nordicsemi.com/f/nordic-q-a/92711/twim-driver-issue-with-lsm6ds3tc-r

Though thanks for your help and I'll mark this thread as closed.

Best regards

View solution in original post

4 REPLIES 4
Eleon BORLINI
ST Employee

Hi @captainfips​ ,

did you have the possibility to test more than 1 device?

The issue might be related to the HW connection of the LSM6DS3TC-R device. Can you please share the schematic section of the sensor?

-Eleon

captainfips
Associate II

Hi @Eleon BORLINI​ ,

I attached the schematic as a pdf. I think the connection is as it should be. P0.07 and P0.27 are used for the SDA und SCL lines. There are also two 10k pull up resistors. In my init code of the TWI peripheral of the nrf chip, I first set the power line of the gyro sensor and then wait 50ms before enabling the twi interface. Then, when trying to read the who_am_i register, I suspect the nrf chip correctly outputs the start condition and the address of the sensor with a write bit. The data should also be output correctly, but then no ack is received from the sensor.

I am not able to connect another i2c device to the same bus, because it isn‘t accessible on the breakout board… I tried an MPU6050 on totally different pins but also via i2c that worked correctly.

Best regards!

captainfips
Associate II

Hi,

so I just managed to mirror the SCK and SDA lines to other Gpios of the nRF chip that are accessible.

0693W00000Uob79QAB.pngRed is SDA, Blue is SCK and Green is Power of the LSM6DS3. Here the communication just works fine. But after the next power on of the sensor the lines keep being pulled low somehow... Even Powering the sensor off and on again doesn't change anything:

0693W00000Uob7OQAR.png 

Best regards Fabian

captainfips
Associate II

Hi,

I found out the issue was the configured drive strength of the output pin of the nrf chip: https://devzone.nordicsemi.com/f/nordic-q-a/92711/twim-driver-issue-with-lsm6ds3tc-r

Though thanks for your help and I'll mark this thread as closed.

Best regards