Skip to main content
RHold.2
Associate
January 18, 2022
Question

I use LIS2DW12 MEMS, via SPI. I can correctly read reg. 0x0F, I obtain 0x44. I can also write to regs CTRL2-CTRL6; the written vals can be read back afterwards. But I fail to write CTRL0/1, which always read back as default: 0x00/0x04. How write CTRL

  • January 18, 2022
  • 2 replies
  • 989 views

..

This topic has been closed for replies.

2 replies

Eleon BORLINI
ST Employee
January 28, 2022

Hi @RHold.2​ ,

can you please check better the datasheet? The LIS2DW12 has no CTRL0 register, and the CTRL1 default should be 0x00. 0x04 is the default value of reg CTRL2.

Can you please check if you might have shifted the reading of the registers in your code, for some reason?

-Eleon

RHold.2
RHold.2Author
Associate
January 28, 2022

Please accept my apologies, I checked the datasheet, but wrongly indexed CTRL-register names only in my post, not in my code, so correcting the post:

I use LIS2DW12 MEMS, via SPI. I can correctly read reg. 0x0F, I obtain 0x44. I can also write to regs CTRL3-CTRL7; the written vals can be read back afterwards. But I fail to write CTRL1/2, which always read back as default: 0x00/0x04. How to write CTRL1/2?

Thank you,

Richard

Eleon BORLINI
ST Employee
January 28, 2022

Hi Richiard @RHold.2​ ,

There should be no reason you cannot write (but you can read) these specific two registers.

Did you configured correctly the SPI communication in writing mode (datasheet p.31)?

0693W00000JNjdoQAD.pngTo investigate if the issue is related to the code, did you comment the line of the codes of CTRL1/2 registers, are you face issues with CTRL 3/4?

-Eleon