Gyro data read from mpu-6050 never change

By parog , 26 September 2013

Hello,

I am using GY-521 with 8-bit AVR controller. The AVR controller reads accelerometer, temperature and gyro data in burst mode through i2c around 100Hz sampling rate. The interrupt is not used.

All data I got from accelerometer and temperature sensor are fine, but not gyro. Each time when power on, I get different gyro data, but stay same, never change, no matter how I turn or shake the GY-521 board.

Here is the mpu-6050 initialization:

void Init_MPU6050(void)
{
_delay_ms(100);
TWI_Write8(PWR_MGMT_1, 0x80); //DEVICE_RESET
_delay_ms(100);
TWI_Write8(PWR_MGMT_1, 0x01); //PLL with X axis gyros ref
TWI_Write8(PWR_MGMT_2, 0x00); //No Standby
TWI_Write8(SMPLRT_DIV, 0x4F); //Sampling rate 100Hz
TWI_Write8(CONFIG, 0x00); //DLPF: 0
TWI_Write8(GYRO_CONFIG, 0x00); //1: ±500 °/s; 0: ± 250 °/s
TWI_Write8(ACCEL_CONFIG, 0x01); //0: ±2g 16384 LSB/g
}

I used logic analyzer to check the delay, I2C read/write timing, and they all fine.

Much appreciate any suggestions/comments to help me out.

phpbb Topic ID
15630