2016-03-08 08:26 PM
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: 0b00001111CTRL_REG2: 0x80CTRL_REG3: 0x00CTRL_REG4: 0b10000000, but also tried with 0x00CTRL_REG5: 0x00My SPI parameters are:MSBFIRST, MODE3, CLOCK_DIV8Every 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-random2016-03-10 04:50 AM
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)''.