传感技术
直播中

楼斌

8年用户 881经验值
私信 关注
[问答]

ADXL345中断不触发是什么原因导致的?

刚开始调试ADXL345.
用SPI驱动,发送0x00能返回0xE5,但是中断不能触发,XYZ轴寄存器读出都为0.
配置代码如下
   
SpiSend(XL345_BW_RATE,XL345_RATE_50);
SpiSend(XL345_DATA_FORMAT,XL345_FULL_RESOLUtiON | XL345_RANGE_16G | XL345_INT_LOW);
SpiSend(XL345_OFSX,0x00);
SpiSend(XL345_OFSY,0x00);
SpiSend(XL345_OFSZ,0x05);
SpiSend(XL345_THRESH_ACT,0x01);
SpiSend(XL345_THRESH_INACT,0x01);
SpiSend(XL345_TIME_INACT,0x01);
SpiSend(XL345_ACT_INACT_CTL,XL345_ACT_X_ENABLE | XL345_ACT_Y_ENABLE | XL345_ACT_Z_ENABLE);
SpiSend(XL345_INT_ENABLE,XL345_DATAREADY);
SpiSend(XL345_INT_MAP,XL345_DATAREADY);
SpiSend(XL345_POWER_CTL,XL345_MEASURE);

不知道配置的对不对,还需要配置哪些寄存器吗?

更多回帖

发帖
×
20
完善资料,
赚取积分