I am using the MMA8451Q on the FRDM-KL25Z board. Using the example code from 6.1 from AN4072, I can correctly receive interrupts for single pulse detection. But I am having problems with double pulse detection which originated when trying to do both single and double pulse detection as per example 6.3.
If consider just double pulse detection for a moment and use the example code from 6.2, I can also receive interrupts, but reading the PULSE_SRC register doesn't return the values I expect. From 6.2 example code, when I read back PULSE_SRC, I was expecting to see bits EA and DPE set, but the register reads back as 0x00. I then amended the PULSE_CFG register and also set the ELE bit - to latch values into the PULSE_SRC register (in case I wasn't reading this before the latency expired), but then found that no interrupts would occur expect for once immediately after I finished the configuration routine. I also then read the PULSE_SRC register before I left the config routine in case the interrupt had already trigger, but this didn't make any difference. That was expect because when moving from Standby Mode to Active Mode (the last action of the configuration routine) the PULSE_SRC register should be cleared automatically anyway according to note (2) on Page20 of the datasheet.
Where am I going wrong?