2019-03-18 08:37 AM
I am currently working on the LIS2DE12 accelerometer. I've been reading the datasheet and I was a little confused with the interrupt configuration. The datasheet says the device provides 2 interupt pins (INT1 and INT2).
1. My understanding is that you can use either the INT1 pin or the INT2 pin. Is this correct?
What's the reccommended practice?
2. In the CTRL_REG6 register, there are two bits I2_IA1 and I2_IA2 for configuring interrupts. Specifically what does "interrupt 1 function", interrupt 2 function" and "activity interrupt" mean?
Thanks
Solved! Go to Solution.
2019-03-19 04:02 AM
hi timothy, you're welcome
Regards
2019-03-18 09:39 AM
hi Timothy
Interrupt 1 and Interrupt 2 are the interrupt flags (bits in the registers), while INT1 and INT2 are the physical pads, to which the interrupt flags can be independently connected.
Regards
2019-03-18 09:42 AM
The "activity interrupt" is the interrupt generated by the Sleep-to-wake and/or Return-to-sleep events, adjustable acting on ACT_THS (3Eh) and ACT_DUR (3Fh) registers
2019-03-19 01:35 AM
Thanks so much for your response. That helps a lot. Follow up questions:
Thanks again.
2019-03-19 04:02 AM
hi timothy, you're welcome
Regards
2019-03-19 04:08 AM
Excellent! Thanks. One final question: (regarding your answer to question 2): which datasheet version did you get that caption from? I can't see it in the one i'm viewing (DocID027326 Rev 2).
2019-03-19 04:23 AM
from here but... please consider that the sentence in brackets was added by me (consider 5ms as the maximum time for the boot) :)
regards
2019-03-19 07:55 AM
Here's my configuration:
const NS_ACC_Config_t accelerometer_StartupConfiguration =
{
.DataRefreshRate = LIS2DE12_ODR_100Hz,
.FifoMode = LIS2DE12_BYPASS_MODE,
.BlockDataUpdateEnable = PROPERTY_DISABLE,
.FifoEnable = PROPERTY_DISABLE,
.FullScaleMode = LIS2DE12_2g,
.RebootMemory = PROPERTY_ENABLE,
.CtrlRegister3_Config = CTRL_REG3_DEFAULT, //0x00
.CtrlRegister5_Config = CTRL_REG5_DEFAULT, //0x00
.CtrlRegister6_Config = ( CTRL_REG6_I2_IA2_ENABLED | CTRL_REG6_I2_POLARITY_ACTIVE_LOW ),
.Int1_Cfg_Config = 0x00,
.Int1_Ths_Config = 0x00,
.Int1_Duration_Config = 0x00,
.Int2_Cfg_Config = ( MOVEMENT_RECOGNITION_ENABLED_2 |
INT2_CFG_ZHIE_ENABLED |
INT2_CFG_ZLIE_ENABLED |
INT2_CFG_YHIE_ENABLED |
INT2_CFG_YLIE_ENABLED |
INT2_CFG_XHIE_ENABLED |
INT2_CFG_XLIE_ENABLED
),
.Int2_Ths_Config = 0x01,
.Int2_Duration_Config = 0x01,
};
I can't seem to get interrupts on the INT2 pin. Is there something I'm missing?
2019-03-20 03:54 AM
Thanks for your help. I got it working. The settings were correct. I just needed to tilt the device the right way to trigger the interrupt.
2019-06-23 02:58 AM
Hi,
I am struggling with very similar issues that timothy0508 was asking about.
The answers were quite helpful, but I would still like to understand better.
1) What does the BOOT bit in control register 5 do, and when does it do it? Should it reset all registers immediately when the bit is set by writing to the register? Does it also then reset itself automatically, or should I reset it some time after setting it? In my own testing it does not seem to reset ever...
2) You wrote: "1/ODR is the smallest duration for an interrupt event to be recognized. For example, you are running at 100Hz ODR: in this case, you can detect an event that lasts at least 10ms if the INT1_DURATION reg value is 01h."
But the default value for the duration register is 0. I understand that so that the smallest duration is then anything above zero, and less than 1/ODR? Or are you saying that the value 0 in the DURATION register is the same as value 1 and interrupt events shorter than 1 are never recognized?
Thanks for any further help you can provide!
Petri