cancel
Showing results for 
Search instead for 
Did you mean: 

H3LIDS331DL: Impossible to get INT1 with THRESHOLD and DURATION working !

PGoud
Associate III

Hello,

I can succesfully have ready (DRDY) under interrupt (INT1) at low or normal power vfrequencies. Cool.

BUT I do not success in using threshold and duration.

Can anyone, can give me the correct configuration to do this:

  • Get an INT1 interrupt each time the sensor as over pass a threshold for more than 50 samples at 10Hz low power.
  • And then do necessary process in the interrupt to renew this indefinitly.
  • The threshold can be 0 for now to ensure that the sensor will create an interrupt periodically each 5 s

In advance many thanks

7 REPLIES 7
Eleon BORLINI
ST Employee

Hi @PGoud​ ,

since the H3LIDS331DL is a high-g accelerometer, can you please define the threshold you want to set (as we discussed here)?

Please note that the minimum threshold that can be set on this device is FS/2^7 = 1.5g in the +-100g FS case (and it is bigger than the sensitivity / signal LSB), so you have to be sure that your acceleration signal is bigger than 1.5g for at least 5 seconds (50 samples at ODR10Hz).

For a general configuration of the threshold interrupt, you have to use a code similar to below pseudo-code:

1. Write C7h into CTRL_REG1 // Turn on the sensor and enable X, Y, and Z // LP mode ODR = 10 Hz
2. Write 40h into CTRL_REG3 // Interrupt activity 1 driven to INT1 pad
3. Write 00h or 01h into CTRL_REG4 // FS = ±100 g or ±200 g
4. Write XYh into INT1_THS // Threshold = XY * FS/2^7g
5. Write 32h into INT1_DURATION // Duration = 1/=DR * 50 = 5s
6. Write 0Ah into INT1_CFG // Enable for example XH and YH interrupt generation
7. Poll INT1 pad; if INT1=0 then go to 8 // Poll DRDY/INT1 pin waiting for the event
8. Read INT1_SRC // Return the event that has triggered the interrupt
9. (Event has occurred; insert your code here) // Event handling
10. Go to 6

If it still doesn't work, please try the same procedure but on INT2.

-Eleon

PGoud
Associate III

Thanks for the precisions.

I finally succeded in getting y INT1 interrupt.

But it was touchy when I was working with "small finger taps", at 10 Low Power hz it may be difficult to catch them.

About duration my concluision is that it must always at 0 if you plan to wake up on shocks.

The duration on wakeup should be used only fro long "free fall" events.

Do think that some filter parameters could help using Wakeup from 10Hz Lowpower, with small shocks at, let's say, between 1 to 10 Hz ?

Thanks

Hello,

Finally I'm still struggling...

My sensor is set with:

  • FS = +/-200G,
  • ODR = 10Hz,
  • INT1 padded out for XHIE, YHIE, ZHIE enabled (only the high interrupt)
  • Then Threshold register set to 1, Expecting 3.1G threshold ? As you explained before LSB of threshold is 1.5 G at +/- 100G

Then without any move the sensor is triggering.

Why ? +3.1G should be over the noise of the sensor ?

I have to set 2 (6,3 G !) to avoid interrupt, and that ok, I've to shake violently my sensor to get an interrupt.

Notice that I also tried with HF filtering activated on INT1 to remove TyOffset ... but still the same it's triggering when threshold is set to 1 !

Eleon BORLINI
ST Employee

Hi @PGoud​ ,

>> Do think that some filter parameters could help using Wakeup from 10Hz Lowpower, with small shocks at, let's say, between 1 to 10 Hz ?

It depends on how much small are the shocks... should be at least 2g and during at least a couple of ODRs, or the value you have set in the INT1_DURATION (33h) register.

>> Why? +3.1G should be over the noise of the sensor?

Youi should be able to detect it, is > of the typical zero g level of ±1g.

>> I have to set 2 (6,3 G !) to avoid interrupt, and that ok, I've to shake violently my sensor to get an interrupt.

6.3g is a big shock, but this sensor is designed for such shocks

-Eleon

>> Why? +3.1G should be over the noise of the sensor?

>>> Youi should be able to detect it, is > of the typical zero g level of ±1g

Surely I did not explain correctly.

I meant that with

  • 1 ie 3,1G in THreshold
  • at +/-200G FS
  • at 10Hz
  • The sensor not moving at all ! just on a table.

==> it triggs one or several of 'hie'

BUT I expected it should never trig ! (again if i put 2 in threshold it does not trig)

Hi @PGoud​ ,

+-1g is the typical zero-g level, and on some devices it could be higher. Did you tried with other H3LIDS331DL, or by setting the minimum FS of 100g?

for small signal detection, the H3LIDS331DL is definitely not the suggested device... there is plenty of possible other choices with FS below +-16g of +-32g.

-Eleon

PGoud
Associate III

Hello,

We already use some other LIS (LIS2DE, ...) for low accs.

In that use case we need HIgh G measurement... I'm just minding about an error i can do because here we are to far from the expected "noise" of the sensor.

So my interrogation is also due to the fact that when, with previous parameter, when I read INT1 Status register and Raw Accs, just in the interrupt !

I can obviously see some hie and IA flags activated, but my three accs are really under the 3.1G threshold. ie always less than +/-324 (0x144 is the bigger i've seen) (raw value) which is indeed under 3.1G : (324 * 200 / 2^15) = 1,9 G (or according to ST h3lis331dlreg.c raw to mg: 324* 6.125 = 1918mg)