cancel
Showing results for 
Search instead for 
Did you mean: 

How to interface X-Nucleo-IKS02A1 with STM32L496 Disco board using LL Libraries? Tried to interface using I2C Channel using LL Libraries , but was not able to read the registers of IKS02A1.

GKulk.1
Associate
 
3 REPLIES 3
Foued_KH
ST Employee

 Hello @GKulk.1​ and welcome to the Community 😀

You can review the I2C examples available under STM32CubeL4 MCU package:

STM32Cube\Repository\STM32Cube_FW_L4_V1.17.2\Projects\NUCLEO-L496ZG\Examples_LL\I2C

The examples run on STM32L496 NUCLEO devices.

Foued.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Tried to use I2C as per the examples , But when I try to read WHO AM I Register , I am not getting any data from MEMS Board

Hello @GKulk.1​,

I recommend you follow this flow:

  • The related GPIO clock base is enabled
  • The related GPIO pins are configured for I2C
  • The I2C peripheral clock enabled
  • The I2C is configured
  • The I2C is initialized
  • Generate a Start Condition
  • Transmit sensor's write address to send register address
  • Send the register address
  • Generate a Start condition again
  • send the Sensor's read address
  • define the read data to a variable
  • generate a Stop condition and send NACK to stop the receiving

Hope my answer helped you!

When your question is answered, please close this topic by choosing Select as Best.

This will help other users find that answer faster.

Foued.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.