Skip to main content
NMALH
Associate II
September 12, 2020
Solved

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.

  • September 12, 2020
  • 1 reply
  • 975 views

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

This topic has been closed for replies.
Best answer by Eleon BORLINI

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

1 reply

Eleon BORLINI
Eleon BORLINIBest answer
ST Employee
September 14, 2020

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

NMALH
NMALHAuthor
Associate II
September 17, 2020

Dear Eleon,

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