已回答假定已回答

ADXL345中断不触发

nine 在 2015-10-25 詢問的問題
最後回覆由neilzhao於2015-10-30提供

刚开始调试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);

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

結果