cancel
Showing results for 
Search instead for 
Did you mean: 

L3G4200D giving constant values for x, y and z.

enhering
Associate III
Posted on March 09, 2016 at 05:26

Hi. 

I have connected an L3G4200D to an ATMEGA328P via SPI.

WHO_AM_I gives me 211d, or 0xD3, which is the expected value.

The values I use for control registers are:

CTRL_REG1: 0b00001111

CTRL_REG2: 0x80

CTRL_REG3: 0x00

CTRL_REG4: 0b10000000, but also tried with 0x00

CTRL_REG5: 0x00

My SPI parameters are:

MSBFIRST, MODE3, CLOCK_DIV8

Every time I power up the system, I get constant values coming out of X, Y and Z.

These values are random. When I power cycle, they change, but keep constant while power is on.

WhoAmI is consistently 211d.

Do you have any idea what is going on? I also have a LIS331 accelerometer attached to the same ATMega328P, which is functioning well.

I tried desoldering the gyro and desoldering it in place, but got no change in behaviour.

Can somebody please help?

#l3g4200d-constant-output-random
1 REPLY 1
enhering
Associate III
Posted on March 10, 2016 at 13:50

Ok. I solved it.

If you are getting this behaviour on your giro, set CTRL_REG2 HPM1 and HPM0 to zero. This option corresponds to ''

Normal mode (reset reading HP_RESET_FILTER)''.