2014-04-14 06:56 PM
hi,
I can't get the interrupt after configuring the state machine of LIS3DSH. Could you give me some examples. My code as following:LIS3DSH_Write_Byte(CTRL_REG1, (u8)0x01);//enable SM1, SM1 interrupt routed to INT1LIS3DSH_Write_Byte(CTRL_REG3, (u8)0x48);//Interrupt signal active HIGH, Interrupt locked, INT1 signal enabledLIS3DSH_Write_Byte(CTRL_REG4, (u8)0x57);//X, Y, Z enabled, ODR = 50 Hz.LIS3DSH_Write_Byte(CTRL_REG5, (u8)0x00);//filter bandwidth 800 Hz, +/-2g, Self-test DisabledLIS3DSH_Write_Byte(TIM3_1, (u8)20);//Timer3 1000msLIS3DSH_Write_Byte(ST1_0, TI3);//SM1 state 1LIS3DSH_Write_Byte(ST1_1, CONT);//SM1 state 2 #tech2014-04-25 12:01 PM
I don't remember if the timer caused an interrupt, I don't think so. I recall this accelerometer had a setting, by default disabled, that caused an interrupt when reaching an stop or continue state, maybe you could enable this and see if the interrupt pops when it reaches that state. Looked it for you:
AN3393 4.34 Also, you could check that the interrupt actually works by setting the Data Ready interrupt and Fifo to stream mode, or any other interrupt (fifo full, etc). I've personally had some problems with broken traces and interrupts not being received but the accelerometer was working ok.