ITG3205's output became weird after a certain time


After the setup, ITG3205 printed the reading every 0.1 sec. ITG3205 was at rest on the table, so the gyro readings looked ok, but the temperature reading was too off.

offset (raw): -32 -18 -10
gyro (raw): -1 -4 -2
gyro (deg/s): 0.07 -0.35 0.00
Temperature (raw, degC): -2768 -81.00

Here is how do I calculate temperature

temp_senitivity=280; // LSB/degC
temp_raw_offset=13200; // Temperature offset (LSB)
temp_deg_offset=35; // degC
uint8_t buffer[6];

I2Cdev::readBytes(0x68, 0x1B, 2, buffer);
int16_t raw=(((int16_t)buffer[0]) << 8 ) | (int16_t)buffer[1];
temperature_degC= (float)temperature_raw/(float)temp_senitivity+temp_deg_offset;

As the time goes (about a couple minutes), ITG3205’s readings became strange. The update rate became slower, which is about 2 sec, and the readings became negative big numbers. The ITG3205 was still at rest and I did not change the code.

offset (raw): -32 -19 -10
gyro (raw): -2025 -2038 -2047
gyro (deg/s): -140.87 -141.77 -142.40
Temperature (raw, degC): 11143 499.29

Summary: I have two problems. 1) temperature reading did not look right. 2) gyro readings became weird after a couple minutes. I have no clue how does this happen. Can you give me some advice please?
Thank you

PS: the code here is modified from I2Cdev, GitHub - jrowberg/i2cdevlib: I2C device library collection for AVR/Arduino or other C++-based MCUs

Note: I am using Arduino Due

ITG3205.pdf (1.1 MB) (25 KB)