2020-11-28 03:32 PM
I have seen here on this forum few questions concerning the interrupt issues, so I have the same problem, none of these previous questions have brought the answer so I wonder will this ever even work?
I first copied the ST app note AN3393 page 75 Wake Up -application register values.
The problem is that the interrupt occur once and only once, the lenght is 50us and after this sensor doesn't do any interrupts. After unplugging - plugging the power I again get one interrupt and then nothing.
When I set the interrupt (INT_1) to work as Data-ready interrupt to INT1. I see the interrupts occur on sample rate and altering the sample rate interrupts change accordingly.
One person on previous threads suggested adding OUTC (0x88) to the state machine to update the interrupt pins !??! This however didn't have any influence.
Is this a known problem in this sensor or how to get around this ?
Thanks.
2020-11-29 03:12 AM
I found another strange section from the application note AN3373: Page 71
"When the interrupt is pulsed (IEL bit = 1 in CTRL_REG3 register), a new interrupt pulse can be generated. In fact, another interrupt pulse can be generated only after the OUTSy register has been read."
So before the sensor can generate another interrupt, I need to read a register value ?!!?!? Is this the power of the state machine, that it can generate interrupts once and then it needs host intervention ??
There are two identical OUTS -registers: OUTS1 and OUTS2 ??
OUTS2 (7Fh)Output flags on axis for State Machine 1 management. Read of this register affects the interrupt release function.After reading OUTS2, the value is set to default (00h).
OUTS1 (5Fh)Output flags on axis for State Machine 1 management. Reading this register affects the interrupt release function.After reading OUTS1, the value is set to default (00h).
What is the purpose of having 2 identical registers?, do I need to read them both or one only ? In any case reading the registers after the interrupt doesn't do anything, No further interrupts are generated after the first and the only one.
Reset pointer and program pointer in SM1, What means if I set the reset point to "2", does it mean that reset pointer is set to address 0x42 and CONT command will jump there? And what is the default state ?
What happens when I manipulate the state machine during the operation ?
Is there a certain order which register can and should manipulate before some others ?
I can make this to work by resetting the chip after every interrupt and starting all over, but this is a waste of resources from host MCU and the chip got jammed after manipulating the state machine on the fly, only way to recover was to toggle power.
2020-12-02 09:00 AM
Hi @JHeik.1 ,
>> So before the sensor can generate another interrupt, I need to read a register value?
You have to read the OUTSy register to change the interrupt status, but not to enable a new interrupt. You should only put your code in a loop.
Please note however that this was the first embedded implemented in a motion device, time ago: since then, and you can find more advanced FSM implementations in more recent devices (e.g. LSM6DSO).
There are also other ways that don't use the FSM block (but on other sensors, for example the LIS3DH), that are maybe easier to control for the implementation of the wake.up motion recognition (lis3dh_wake_up.c).
>> There are two identical OUTS -registers: OUTS1 and OUTS2 ??
Yes, there are two different registers since you can configure two different state machines.
-Eleon