cancel
Showing results for 
Search instead for 
Did you mean: 

Hi I´m working with LI2DTW12 acelerometer chip. I trying to configure the sensor to generate an interruption in the INT_1 when the device detect an aceleration in the Z axis. Could you help me with the register configuration?

JFern.2
Associate II

Hi I´m working with LI2DTW12 acelerometer chip. I trying to configure the sensor to generate an interruption in the INT_1 when the device detect an aceleration in the Z axis. 

I have configure the device registers in the following way:

uint8 array_registers_LIS2DTW12[]={0x20,0x25,0x23,0x34,0x35,0x3F};

uint8 config_registers_LIS2DTW12[]={0x20,0xD0,0x20,0x04,0x60,0x22};

But when the LIS2DTW12 generate the interruption on the INT_1 and I read the SATATUS register I saw 0x01. That mean that I have a data ready. And when I reas the WAKE_UP_STATUS register all the bits are 0. 

Could anybody help me with this matter?

I not sure I have configured the registers in the correct way or how to read the interruption pin properly.

Thank you for your time and help.

7 REPLIES 7
Eleon BORLINI
ST Employee

Hi @JManu.1 Fernandez Leon​ , there is no app note yet available for LIS2DTW12, but you can refer to LIS2DW12 which has basically the same regmap as the LIS2DTW12. If you are implementing the wake-up feature, I suggest you the AN5038 p.20, where the configuration procedure is defined.

0690X00000ARCJfQAP.png

You can check if you are missing some configuration bits. Regards

JFern.2
Associate II

Hi Eleon,

Thank you for your anwer, it is very usefull.

Only one question more, can I configure this kind of interrup in low power mode?

Best Regards!

Eleon BORLINI
ST Employee

If you mean that you can wake-up your device from "cold"​ to "low power" mode (instead of "high performance"), yes you can do it. You can just set the proper bits in CTRL1 register. Regards

JFern.2
Associate II

I really apreciate you help in this matter, but I´m unable to configure the acelerometer in low-power mode and wake it up only with an aceleration in the Z axis.

Could you help me with this specific configuration of the LIS2DW12?

Thank you for your time and help.

Best Regards!

​I mean you could use the procedure below, changing the CTRL1 value from 64h (HP mode) to e.g. 60h (LP mode). Regards

0690X00000ARInWQAX.png

JFern.2
Associate II

Hi Eleon,

Thank you for your great help in this matter, it was really useful.

Now I have another question regarding this device.

I want to configure the acelerometer to read XYZ axis on deman mode. I have configure the device in te following way:

 write_register(devw, 0x25, 0xD0);  

 write_register(devw, 0x22, 0x02);

 write_register(devw, 0x20, 0x2B);

I want to configure the device in 4g FS.

Before read the XYZ register I check SLP_MODE1:

 write_register(devw, 0x22, 0x03);

 DM_waitMs(3);

 do{

  registro3 = read_8bits_register(ISQC_LIS2DTW12_acelerometer_ADR, 0x22);

 }

 while((registro3&0x01) == 0x01);

This is what I read from the registers XYZ:

X-> 40

Y-> 508

Z-> -2752

My boar is face down over my desk, how can I transform this values into mg? I have configured the registers in the correct way?

Thank you for your help and your time.

Best Regards.

Eleon BORLINI
ST Employee

​Hi @JManu.1 Fernandez Leon​ , converting the decimal data you are showing (X, Y, Z = 40, 508, -2752) using the ds sensitivity for FS 2g or 4g, I cannot obtain a sensitive value for the g acceleration (you should get higher value along z and lower along X and Y)... I see you are using the Single data conversion on demand mode... could you try to set the BDU bit in reg 21h and check if the data output is changing? Regards