Hi,
I'm using MMA6900KQ accelerometer and can't read acceleration data. I'm using SPI to read it.
First I'm trying to init accelerometer. Here commands which I send via SPI and answers on it:
1) MOSI: 0x1410; MISO: 0xEA00; (Command: Set pointer to Device Status Register; answer: Critical/Reset Exception Response)
2) MOSI: 0x2000; MISO: 0xF281; (Command: DEVSTAT register data read; answer: 2 errors (IDE and DEVRES)
3) MOSI: 0x140E; MISO: 0xEA00; (Command: Set pointer to DEVCTL register; answer: Critical/Reset Exception Response)
4) MOSI: 0x3020; MISO: 0xFA0E; (Command: Register data write, data: Clear Error; answer: Critical/Reset Exception Response)
5) MOSI: 0x1410; MISO: 0xEA00; (Command: Set pointer to Device Status Register; answer: Critical/Reset Exception Response)
6) MOSI: 0x2000; MISO: 0xF680; (Command: DEVSTAT register data read; answer: 1 error (IDE)
And after it I'm trying to read acceleration data. As answer I've got 0x2047 acceleration always.
Help me, please, how to deal with this problem?
Solved! Go to Solution.
Hi Mikhail,
The sequence for clearing errors looks correct, but we recommend using the soft reset sequence immediately after a power on to prevent issues due with the OTP readout after a power on.
Could you try the sequence below?
MOSI Expected MISO
0x1410 0xEA00
0x2000 0xF601
0x140E 0xEA00 // Set CE bit
0x3020 0xFA0E
0x1410 0x0800 // Read DEVSTAT
0x2000 0x1000
0x140E 0x0800 // Soft Reset
0x3080 0x180E
0x34C0 0x180E
0x3040 0x180E
// Delay 5ms Minimum
0x1410 0xEA00
0x2000 0xF601
0x140E 0xEA00 // Set CE bit
0x3020 0xFA0E
0x1410 0x0800 // Read DEVSTAT
0x2000 0x1000
0x4000 0x3806 // Read X-Axis
0x8000 0x4802 // Read Y-Axis
0x4000 0x380C
0x8000 0x47FE
0x4000 0x280E
0x8000 0x57FC
0x4000 0x280E
0x8000 0x47FE
0x4000 0x280E
0x8000 0x57FC
I hope it helps!
Best regards,
Tomas
Thank you very much, Tomas! It helped me!
Hi Mikhail,
The sequence for clearing errors looks correct, but we recommend using the soft reset sequence immediately after a power on to prevent issues due with the OTP readout after a power on.
Could you try the sequence below?
MOSI Expected MISO
0x1410 0xEA00
0x2000 0xF601
0x140E 0xEA00 // Set CE bit
0x3020 0xFA0E
0x1410 0x0800 // Read DEVSTAT
0x2000 0x1000
0x140E 0x0800 // Soft Reset
0x3080 0x180E
0x34C0 0x180E
0x3040 0x180E
// Delay 5ms Minimum
0x1410 0xEA00
0x2000 0xF601
0x140E 0xEA00 // Set CE bit
0x3020 0xFA0E
0x1410 0x0800 // Read DEVSTAT
0x2000 0x1000
0x4000 0x3806 // Read X-Axis
0x8000 0x4802 // Read Y-Axis
0x4000 0x380C
0x8000 0x47FE
0x4000 0x280E
0x8000 0x57FC
0x4000 0x280E
0x8000 0x47FE
0x4000 0x280E
0x8000 0x57FC
I hope it helps!
Best regards,
Tomas