Hello, I debug why MMA8452Q motion when the output is not interrupted? INT1 no change
Initialization. System 2.8V power supply
void Init_MMA8452() //initialization
{
Single_Write_MMA8452(0x2A,0x18); //100HZ ODR
Single_Write_MMA8452(0x15,0xD8); // The motion detection threshold set, X, Y axis
Single_Write_MMA8452(0x17,0X30); //Set the threshold for the 48 motion detection
Single_Write_MMA8452(0x18,0x0A); // 100 milliseconds to shake the time
Single_Write_MMA8452(0x2D,0x04); // Set motion interrupt
Single_Write_MMA8452(0x2E,0x04); //Set the interrupt pin for INT1 motion
Single_Write_MMA8452(0x2A,0x19); // Active mode
}
Hi Jack,
It is hard to say where the problem might be without seeing your complete source code/schematic.
I would recommend looking at the attached simple example code for motion detection based on the AN4070 and another thread where a similar problem was discussed.
I hope it helps.
Regards,
Tomas
PS: If my answer helps to solve your question, please mark it as "Correct". Thank you.
The problem is solved. thank you!
hello!Shaking, respectively, read X, Y, Z axis data have changed but the fracture INT1 no level change
void exint0() interrupt 0 //INT1 Interrupt entry (INT1 external 10K pull up resistor)
{
Single_Read_MMA8452(0X0C);
SeriPushSend('O');
SeriPushSend('K');
SeriPushSend('?');
}
void Init_MMA8452() //initialization
{
Single_Write_MMA8452(0x2A,0x18); //100HZ ODR
Single_Write_MMA8452(0x15,0xD8); // The motion detection threshold set, X, Y axis
Single_Write_MMA8452(0x17,0X30); //Set the threshold for the 48 motion detection
Single_Write_MMA8452(0x18,0x0A); // 100 milliseconds to shake the time
Single_Write_MMA8452(0x2C,0x01); //Low drop along trigger
Single_Write_MMA8452(0x2D,0x04); // Set motion interrupt
Single_Write_MMA8452(0x2E,0x04); //Set the interrupt pin for INT1 motion
Single_Write_MMA8452(0x2A,0x19); // Active mode
}
void main()
{
delay(250);
init_serialcom();
inti_time0();
Init_MMA8452();
count=0;
while(1)
{
if(count==100) //Read three axis data per second
{
count=0;
Multiple_Read_MMA8452();
display_x();
display_y();
display_z();
}
}
}
hello! Shaking, respectively, read X, Y, Z axis data have changed but the fracture INT1 no level change
void exint0() interrupt 0 //INT1 Interrupt entry (INT1 external 10K pull up resistor)
{
Single_Read_MMA8452(0X0C);
Single_Read_MMA8452(0X16);
}
void Init_MMA8452() //initialization
{
Single_Write_MMA8452(0x2A,0x18); //100HZ ODR
Single_Write_MMA8452(0x15,0xD8); // The motion detection threshold set, X, Y axis
Single_Write_MMA8452(0x17,0X30); //Set the threshold for the 48 motion detection
Single_Write_MMA8452(0x18,0x0A); // 100 milliseconds to shake the time
Single_Write_MMA8452(0x2C,0x01); //Low drop along trigger
Single_Write_MMA8452(0x2D,0x04); // Set motion interrupt
Single_Write_MMA8452(0x2E,0x04); //Set the interrupt pin for INT1 motion
Single_Write_MMA8452(0x2A,0x19); // Active mode
}