cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6 Wakeup on Gyro-Z Threshold

Yashu
Associate

In the past, I have used an LSM330 to wakeup on a gyro z-axis threshold and activate the INT1 pin as shown below:

Gyro_WrByte(GYRO_CTRL_REG1, 0x3f); // 95Hz DataRate : 25Hz Cutoff : Normal Mode : Enable All Axes
Gyro_WrByte(GYRO_CTRL_REG2, 0x07); // HPF Normal Mode : 0.045Hz HPF Cutoff Freq : HPF Normal Mode
Gyro_WrByte(GYRO_CTRL_REG3, 0x80); // INT on INT1_Gyro Pin
Gyro_WrByte(GYRO_CTRL_REG4, 0x00); // Continuous Update : Little Endian Data : 250 dps FS : 4-Wire SPI Intfc
Gyro_WrByte(GYRO_CTRL_REG5, 0x04); // Normal Mode Reboot Mem Content : FIFO Disable : HPF Disabled : INT1 Select = 01b : OUT Select = 0 : Use HPF for INT1 to account for any incr gyro bias drift due to incr temperature

Gyro_WrByte(GYRO_INT1_CFG, 0x20);      // OR Combination : Z-High Event
Gyro_WrByte(GYRO_INT1_TSH_ZL, 0x3b);   //
Gyro_WrByte(GYRO_INT1_TSH_ZH, 0x02);   // Z-Threshold = 571(0x023b) * 8.75mdps = 5Deg/s
Gyro_WrByte(GYRO_INT1_DURATION, 0x8a); // WAIT Enable : INT Duration = 10(0x0a) * 1/95Hz = 100msec

 

Since LSM330 has been discontinued, can an LSM6 device be used to perform this same functionality? If so, which device variant is sufficient?

Thank you.

https://www.linkedin.com/in/jyaron/
3 REPLIES 3
Federica Bossi
ST Employee

Hi @Yashu ,

 

Have you already looked at LSM6DSV16X?

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Yashu
Associate

The LSM6 reg sets are not as concise as the LSM330. I do not see a specific way to choose the gyro as the WAKE_UP_SRC as opposed to the accel. WK_THS only seems to reference accel thresholds.

Am I to assume that the source thresholds are with respect to whatever MEMS structure is enabled via CTRLxx ?

Or is it not possible to wake on a gyro threshold and therefore ST has dropped this capability in their "offerings" ?

https://www.linkedin.com/in/jyaron/

Hi @Yashu ,

On LSM6‑series devices the wake‑up function is accelerometer‑based only: WAKE_UP_THS and WAKE_UP_SRC do not support direct gyro threshold as in LSM330.

A pure “hardware wake on gyro threshold” path like LSM330 is no longer available. The usual options are:

  • use accel wake‑up to bring the MCU out of low‑power, then check gyro Z in firmware, or
  • on devices with FSM/MLC (e.g. LSM6DSOX, LSM6DSV16X), implement a small FSM that monitors the gyro and generates an interrupt.
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.