2021-07-13 08:51 AM
Hello there.
I'm trying out the LIS2DS12 accelerometer. The datasheet mentions that the sensor is supposed to be able to detect a tilt, however I didn't manager to get an interrupt for such event. The datasheet doesn't give an explanation on how to use tilt detection at all, it only mentions it.
My proceedings after initialization:
Set FIFO control to 0x60 (Continious to Fifo mode)
SET CTRL5 to 0x10 (INT2 pad to tilt interrupt)
Set FUNC_CTRL to 0x20 (MODULE ON)
Set Func_CTRL to 0x20+0x10 (MODULE ON and TILT_ON) (here btw someone was lazy, cause the description of this bit is copied from description of previous register)
After this I expect that the Interrupt pad 2 will go high after I tilt the sensor, that doesn't happen however. Also the datasheet doesn't say, how much tilt it will react to? Like 1 degree, or 90 degree or when?
I didn't find any code example on the net except for initializing and reading in bypass mode (on github eclipse/upm), so I'm at lost here.
2021-07-14 03:12 AM
Hi, in the application note for sensor LIS2DS12 this procedure is reported:
1. Write 20h in CTRL1 // Turn on the accelerometer // ODR = 25 Hz, FS = ±2 g
2. Write 10h in FUNC_CTRL // Enable tilt detection
3. Write 10h in CTRL5 // Tilt detector interrupt driven to INT2 pin
You have to turn on the accelerometer first. Are you using the FIFO for a specific reason?
Tom