2019-11-13 07:42 AM
I configured the device and I am able to read XYZ data by polling the status register 0x27 and reading data when it is ready. I read more than 32 samples of each.
Here are my steps to read data that works:
Read register 0x0F - 0x33
Write Control register 1 - 0x07 // I can enable interrupts in register 3 before setting ODR
Write Control register 2 - 0x00
Write Control register 3 - 0x00 // Interrupts need to be set before ODR
Write Control register 4 - 0x00
Write Control register 5 - 0x00
Write Control register 1 - 0x3F // Lpen and ODR.
Loop: Poll Status register and read 6 bytes with with 0xA8 (0x28|0x80)
Now I want to use the DRDY interrupt and it is not working. I have confirmed that my interrupt code does work by externally pulling the line high. I enable my interrupt code before setting I1_ZYXDA bit in Control register 3. And per AN3308 I am setting I1_ZYXDA bit in control register 3 before setting ODR in control register 1.
Here are my steps:
Read register 0x0F - 0x33
Write Control register 1 - 0x07 // I can enable interrupts in register 3 before setting ODR
Write Control register 2 - 0x00
Write Control register 3 - 0x10 // Interrupts need to be set before ODR
Write Control register 4 - 0x00
Write Control register 5 - 0x00
Write Control register 6 - 0x00
Write Control register 1 - 0x3F // Lpen and ODR.
What is wrong?
thanks,
Kim
2019-11-15 07:35 AM
Hi Kim, it seems you did well in your code. How is the DRDY connected to the MCU?
Please also check carefully if you did everything is described here below. Regards