cancel
Showing results for 
Search instead for 
Did you mean: 

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 CTRL0/1?

RHold.2
Associate
 
3 REPLIES 3
Eleon BORLINI
ST Employee

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
Associate

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

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