Bug in accelerometer driver for WICED Sense (lis3dsh_driver.h)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I've found that the defined values for Control register 5 doesn't match with the datasheet. This bug directly affects Full-Scale setting (sensitivity) of the sensor.

Capture.PNG

In "lis3dsh_driver.h" from line 250 to 255 should be fixed this way.

//CONTROL REGISTER 5

#define CNTL5 0x24

#define BW BIT(6)      //from BIT(7)

#define FSCALE BIT(3)  //from BIT(5)

#define ST BIT(1)      //from BIT(2)

#define SIM BIT(0)

Moreover, be careful when you have to call GetAccAxesRaw(AxesRaw_t* buff) because it will divide the raw value by 16.

They cost me a few hours finding what's wrong with my code.

0 Likes
1 Solution
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

Thanks for reporting this to the community.

jakewtorres

View solution in original post

0 Likes
1 Reply
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

Thanks for reporting this to the community.

jakewtorres

0 Likes