Motion Detection - OK, Np
I am successfully able to configure MMA8653FC for motion detection using the data sheet.
Parameters are as follows :
FF_MT_THS = 0x3F
ELE = 1 and OAE = 1
ZEFE = YEFE = XEFE = 1
Now I am trying to configure the sensor to detect freefalls and not motion
Works OK, without any issue
------------------------------------------------------------------------------------------------------------------
Freefall - Not ok :smileysad:
From data sheet, we need to configure the following values for freefall
ELE = 0 or 1 and OAE = 0
FF_MT_THS -> Contains a threshold value
From its description I see that
The unsigned 7-bit FF_MT_THS threshold register holds the threshold for the freefall detection where the magnitude of the X and Y and Z acceleration values is lower or equal than the threshold value.
From my understanding this means that if we have configured the threshold to +-4g, then whenever there is a acceleration lower than this threshold we will have an EA available in F_MT_SRC
So, even when the device is still, since 0 < 4g I always receive a freefall event. Which is obviously not right.
Q1 : So, I am not understanding how can I actually configure the parameters to correctly find a freefall event.
Q2: What is the difference between mode 1 and mode 2 as stated below
We have two modes to use for freefall. They say as follows :
Mode 1: Freefall detection with ELE = 0, OAE = 0
In this mode, the EA bit (0x16: FF_MTG_CFG, bit 7) indicates a freefall event after the debounce counter is complete.
Mode 2: Freefall detection with ELE = 1, OAE = 0
In this mode, the EA event bit indicates a freefall event after the debounce counter.
I don't understand what is the difference in both these statements..
解決済! 解決策の投稿を見る。
Hi David,
Thank you for the reply.
I read that part. What was confusing to me is that I initially thought when the device is falling, the acceleration is going to increase. Hence i configured my threshold that ways. But upon printing the raw values i noticed that the acceleration is decreasing and nearing to 0 when the device is falling.
I decreased the threshold and fixed the logic. Thank you
But when i printed the raw values, when the device is still, x y are 0 but z is about 1g and when its faling it is reducing and coming towards 0. So, I fixed the logic that ways.
Thank you.
Hello Sandeep,
In order to get a better understanding of the Freefall detection, please review the application note below. At chapter 6.2, you may find a Example Steps for Configuring Linear Freefall Detection.
Motion and Freefall Detection Using the MMA8451, 2, 3Q
The ELE bit denotes whether the enabled event flag will to be latched in the FF_MT_SRC register or the event flag status in the FF_MT_SRC will indicate the real-time status of the event. If ELE bit is set to a logic ‘1’, then the event flags are frozen when the EA bit gets set, and are cleared by reading the FF_MT_SRC source register.
I hope this information helps.
Regards,
David
Hi David,
Thank you for the reply.
I read that part. What was confusing to me is that I initially thought when the device is falling, the acceleration is going to increase. Hence i configured my threshold that ways. But upon printing the raw values i noticed that the acceleration is decreasing and nearing to 0 when the device is falling.
I decreased the threshold and fixed the logic. Thank you
But when i printed the raw values, when the device is still, x y are 0 but z is about 1g and when its faling it is reducing and coming towards 0. So, I fixed the logic that ways.
Thank you.