776797_zh-CN

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

776797_zh-CN

776797_zh-CN

如何启用 MMA8452 运动检测中断引脚<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

如何启用 MMA8452 运动检测的中断引脚?

我的 mma8452(初始中断)代码如下 、

它不起作用 .....

WriteByte(MMA8451, 0x15 , 0x78);// MT Configure , 78 or f8
WriteByte(MMA8451, 0x17 , 0x30);// Moction Threshold , 0x30
WriteByte(MMA8451, 0x18 , 0x30);// Debounce Count
WriteByte(MMA8451, 0x2a , 0x18);// Ctrl_reg1
WriteByte(MMA8451, 0x2b , 0x00);// Ctrl_reg2 ,ALPE
WriteByte(MMA8451, 0x2d , 0x04);// Enable Int function FF_MT , 04
WriteByte(MMA8451, 0x2e , 0x04);// Int enable :MT 通过 int1:1 或 int2:0
WriteByte(MMA8451, 0x2C , 0x0A);// Sleep bypass , int active low , pushpull

Re: How to enable interrupt pin for motion detect of MMA8452<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

嗨,瑞安、

有几条建议可能会有所帮助:

 

1。由于 IPOL = 1(高电平有效),请确保将 MCU 中断引脚配置为 GPIO 输入,在上升沿有中断。

2.例如,尝试将阈值降至 ~1.5g (0x18)。

3.在 ISR 中,您需要确认一个 IRQ,然后读取 FF_MT_SRC 寄存器,清除 INT_SOURCE 寄存器(0x0C)中的 SRC_FF_MT 位,并解除 INT 引脚的保护。

您可能会发现我在这里提供的简单示例代码非常有用。

希望对你有所帮助。

 

此致,

托马斯

タグ(1)
評価なし
バージョン履歴
最終更新日:
‎02-04-2026 07:32 AM
更新者: