DRDY not returning low on AIS2IH
I am using the AIS2IH and polling the DRDY bit of STATUS to see when a new sample is available . I am using single data (on demand) mode and ODR bit is set. The spec sheet says that DRDY returns low after the high part of X,Y or Z has been read, but for me DRDY is remaing high. Maybe I am setting the mode incorrectly, timing soft reset badly? Thanks.
Code :
SPIwriteOneRegister(CS_SENSOR1, CTRL_2, 0x48); // soft reset
// Perform a read to Hi x to reset DRDY :
tmp = SPIreadOneRegister(CS_SENSOR1, OUT_X_H);
SPIwriteOneRegister(CS_SENSOR1, CTRL_1, 0x20); // Select Single data mode
SPIwriteOneRegister(CS_SENSOR1, CTRL_2, 0x08); // Set Block Data Update to 1
SPIwriteOneRegister(CS_SENSOR1, CTRL_3, 0); // Set SLP_MODE_SEL == 0 to enable active high external trigger line
SPIwriteOneRegister(CS_SENSOR1, CTRL_6, 0x34); // filtering etc
