Electronic – I2C communication problem with nRF52840

i2c

I am trying to make LSM6DSR (STEVAL-MKI194V1) work with nRF52840 DK using TWI Communication.

Problem:

Firstly, I modified the TWI sensor example to use the accelerometer (LSM6DSR). When I test my program, I can only see the LED blink. I don’t have any return with NRF_LOG_INFO.

Secondly, I used TWI Scanner example. LSM6DSR is not detected with TWI Scanner example in Nordic SDK15. I don’t have any return with NRF_LOG_INFO.

Background:

I already use the same sensor with an Arduino board without any problem. When I have the problem with nRF52840, I try to add a pull up a resistance, but the result is the same. I used an oscilloscope to see the SCL (CH1) and SDA (CH2) signal for each test with nRF52840. I have the same result the 2 tests.

enter image description here

I also test the Hello example to see if I have the same problem with NRF_LOG_INFO and Its work.

Best Answer

It seems quite likely this is a firmware issue on your nRF chip, especially since you were able to get good readings from Arduino example code.

Try messing with the original nRF example code until you get some activity on your scope. Check basic settings first, like pin mappings and whether the right I2C peripheral is getting enabled. Once you've gotten that, implement your interface to your sensor in small steps, verifying them as you go. A good first step is to read the 'WHOAMI' register of the LSM6DSR.

Related Topic