cancel
Showing results for 
Search instead for 
Did you mean: 

I am facing problems while interfacing the said accelerometer (H3LIS331DL) with ST microcontroller (STM32L432). By following the said application circuit from the datasheet, I am getting unstable readings.

NMALH
Associate II

This is the register values set by me for 400g and data output rate is 50z

1 ACCEPTED SOLUTION

Accepted Solutions
Eleon BORLINI
ST Employee

Hi @NMALH​ ,

From an hardware point of view, can you please share some more details of your application circuit? For example, which Vdd and VddIO levels are you using? Are you correctly setting all the device pins?

From a firmware point of view, are you able to read the WHO_AM_I register? I suggest you to check if you configured the sensor accordingly to the C-examples on Github, in particular the h3lis331dl_read_data_polling.c.

/* Check device ID */
  whoamI = 0;
  h3lis331dl_device_id_get(&dev_ctx, &whoamI);
  if ( whoamI != H3LIS331DL_ID )
    while(1); /*manage here device not found */
 
  /* Enable Block Data Update */
  h3lis331dl_block_data_update_set(&dev_ctx, PROPERTY_ENABLE);
 
  /* Set full scale */
  h3lis331dl_full_scale_set(&dev_ctx, H3LIS331DL_200g);
 
  /* Configure filtering chain */
  h3lis331dl_hp_path_set(&dev_ctx, H3LIS331DL_HP_DISABLE);
 
  /* Set Output Data Rate */
  h3lis331dl_data_rate_set(&dev_ctx, H3LIS331DL_ODR_5Hz);

-Eleon

View solution in original post

2 REPLIES 2
Eleon BORLINI
ST Employee

Hi @NMALH​ ,

From an hardware point of view, can you please share some more details of your application circuit? For example, which Vdd and VddIO levels are you using? Are you correctly setting all the device pins?

From a firmware point of view, are you able to read the WHO_AM_I register? I suggest you to check if you configured the sensor accordingly to the C-examples on Github, in particular the h3lis331dl_read_data_polling.c.

/* Check device ID */
  whoamI = 0;
  h3lis331dl_device_id_get(&dev_ctx, &whoamI);
  if ( whoamI != H3LIS331DL_ID )
    while(1); /*manage here device not found */
 
  /* Enable Block Data Update */
  h3lis331dl_block_data_update_set(&dev_ctx, PROPERTY_ENABLE);
 
  /* Set full scale */
  h3lis331dl_full_scale_set(&dev_ctx, H3LIS331DL_200g);
 
  /* Configure filtering chain */
  h3lis331dl_hp_path_set(&dev_ctx, H3LIS331DL_HP_DISABLE);
 
  /* Set Output Data Rate */
  h3lis331dl_data_rate_set(&dev_ctx, H3LIS331DL_ODR_5Hz);

-Eleon

Dear Eleon,

Thankyou for the reply. Yes, my problem got solved. Before I was multiplying my readings with wrong value of sensitivity.