Accelerometer interruption MMA8652FC don't work

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Accelerometer interruption MMA8652FC don't work

ソリューションへジャンプ
1,377件の閲覧回数
hugooliveira
Contributor I

Hi,

I did MMA8652FC accelerometer configuration to detect motion. However, the interrupt pin does not work, and the recorder is in EA bit FF_MT_SRC 1 and SRC_FF_MT bit is also in 1.

I configured so that the interruption is active in the INT1 pin.

Follows the configuration

RegistradorValor
XYZ_DATA_CFG0x00
CTRL_REG1(DR=101)
FF_MT_CFG0xF8
FF_MT_THS0x20
FF_MT_COUNT0x02
CTRL_REG30xF9
CTRL_REG40xFF
CTRL_REG50xFF
ラベル(1)
タグ(1)
0 件の賞賛
1 解決策
811件の閲覧回数
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Hugo,

Attached you can find a simple code example for motion detection based on the AN4070.

I hope it helps.

Regards,

Tomas

元の投稿で解決策を見る

4 返答(返信)
810件の閲覧回数
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Hugo,

To clear the SRC_FF_MT interrupt status bit in the INT_SOURCE register (0x0C) and consequently deassert the Freefall/Motion interrupt, it is necessary to read the FF_MT_SRC register. Are you using something like this?

void PORTA_IRQHandler()

{

      PORTA_PCR5 |= PORT_PCR_ISF_MASK; // Clear the interrupt flag

      Temp = I2C_ReadRegister(MMA8652FC_I2C_ADDRESS, FF_MT_SRC_REG); // Read the FF_MT_SRC register to clear the SRC_FF_MT flag in the INT_SOURCE register and deassert the interrupt   

      MotionEventCounter++;

}

MMA8652FC - Motion interrupt.JPG

Also make sure that your GPIO pin connected to the INT1 pin of the MMA8652FC is configured for falling edge interrupts.

I would also recommend to start your experimenting without using the Auto Wake/Sleep function (CTRL_REG3 = 0x00), with only the Motion/Freefall interrupt enabled (CTRL_REG4 = 0x04) and routed to the INT1 pin (CTRL_REG5 = 0x04).

I hope it helps.

Regards,

Tomas

PS: If my answer helps to solve your question, please mark it as "Correct". Thank you.

0 件の賞賛
811件の閲覧回数
hugooliveira
Contributor I

Hi Tomas,

I made all of these settings, but unfortunately the interruption does not work ... you would have a complete sample configuration that was already made and it worked?

Thank you.

0 件の賞賛
812件の閲覧回数
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Hugo,

Attached you can find a simple code example for motion detection based on the AN4070.

I hope it helps.

Regards,

Tomas

811件の閲覧回数
hugooliveira
Contributor I

Hi Tomas,

   Thanks for your help. The problem was being in uC interrupt setting. The interruption did not work when placed in open drain and not in pushpull only worked when the pin configured as pullup. The uC that use is PROC of Cypress.

0 件の賞賛