Skip to main content
NMALH
Associate II
Sep 12, 2020 11:38 AM UTC
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.

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

This topic has been closed for replies.
Eleon BORLINI
Eleon BORLINIBest answer
ST Employee
Sep 14, 2020 1:12 PM UTC

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

2 replies

Eleon BORLINI
Eleon BORLINIBest answer
ST Employee
Sep 14, 2020 1:12 PM UTC

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
Sep 17, 2020 8:29 AM UTC

Dear Eleon,

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