cancel
Showing results for 
Search instead for 
Did you mean: 

L3G4200 SPI unstable read value

borzoo
Associate
Posted on August 12, 2015 at 22:51

Hello

I'm trying to use the L3G4200D Gyroscope to measure the pitch in 3 dimention.But I faced a problem with:

I used the Keil's examples.Iuse SPI to read and write on the device...I can read some registers such as WHO_AM _I  etc. I also used these control register configuration:

Gyroscope_Write(CTRL_REG1, 0x0F);     /* ODR: 100Hz, Cut-Off: 12.5,         */

Gyroscope_Write(CTRL_REG4, 0x00);     /* Continuous update,full scale 250dps*/

Gyroscope_Write(CTRL_REG5, 0x40);     /* FIFO Enable                        */

But I can't read state registers(X, Y, Z).My problem is that the result read from the gyroscope is not stable at all where it is not moving in any direction!!!

Please help me to solve the problem and it would be great if you can provide me some working code examples.

Thank you for your attention,

Borzoo Khoshnoud.
1 REPLY 1
louda.marian
Senior
Posted on July 14, 2016 at 17:17

Hello,

You have to set BDU bit in CTRL_REG4 register and read axis data LSB first.

BR,

Marian