2020-12-02 09:04 PM
Since the default value of the register is not changing, the state machine is not enabling and thus, I am not getting any interrupt.
Solved! Go to Solution.
2021-01-13 04:24 AM
Hi, I have fixed the isuse and the state machine works fine. It was some problem with I2C. Thak you for your support throughout :)
2020-12-02 11:17 PM
Hi @Community member ,
is the CTRL1_REG the only register you cannot set (i.e. you cannot write the 01h value inside it)? Did you check if you are at least able to read the WHO_AM_I (0Fh) reg? And, if so, are you able for example to set the CTRL_REG2 (22h), same bit, which is dedicated to the State machine N.2?
I suggest you to check the basic device configuration code that you can find in the lis3dsh_read_data_polling.c
-Eleon
2020-12-03 08:09 PM
Hi,
I have tried reading the WHO_AM_I register and I could read 3F. I could successfully set Control Registers 3, 4, 5,6 according to the "Wakeup" State machine. As per your suggestion, I tried setting the same bit in CTRL2_REG, but that too is not getting set. On reading the register 1 and 2 after writing 0x01 to them, the read value was 0x00. Please help me proceed
2020-12-04 12:36 AM
So strange you are not able to read/write a single register... er even a single bit... Can you please try to write another bit of that register, or run two dummies write commands before writing CTRL1_REG andCTRL2_REG, or again try the configuration procedure on another LIS3DSH device, if it's possible for you?
As a side note, if you are using the Github drivers for the LIS3DSH (lis3dsh_reg.c), and especially the below init_set function, you have to add the first two ctrl registers, defined in the lis3dsh_reg.h.
int32_t lis3dsh_init_set(stmdev_ctx_t *ctx, lis3dsh_init_t val)
{
lis3dsh_ctrl_reg3_t ctrl_reg3;
lis3dsh_ctrl_reg4_t ctrl_reg4;
lis3dsh_ctrl_reg6_t ctrl_reg6;
int32_t ret;
...
-Eleon
2020-12-04 01:19 AM
I have tried dummy write commands before writing into Register 1 and also other bits. Still no luck.
2020-12-04 04:59 AM
ok thank you @Community member
And did you try with the other suggestions? Could you share your sample code?
-Eleon
2020-12-04 08:44 PM
I have tried all the suggestions and I have attached the sample code of the function.
is there any condition to be taken care? for setting that register.
Also, I am trying to get data overrun interrupt on INT1. I am reading the STAT register and it has Data overrun flag set, but that isn't generating the interrupt.
can you suggest me a way to read the interrupt?
2020-12-06 08:44 PM
I am able to get Interrupt now but I am still unable to write into Register 1 and register 3. If I write them in an infinite loop, they get written one time and then they are automatically set to 0x00 and don't write any values. I have tried all your suggestions. I am still unable. Please guide.
2020-12-09 07:15 AM
Hi, Can you please guide me to solve this issue. its been 2 days and I am clueless.
2020-12-09 09:00 AM
No clue so far from my side, unfortunately... did you try also with a different device, if you had the possibility?
In your last comment you say you cannot write Reg1 and Reg3, but in a previous comment it was Reg1 and Reg2... can you please confirm?
-Eleon