Anyway I found out why and I want to suggest the solution be incorporated in the release. It was the IMU6050 not getting initialised properly.
As mentioned on Page41 of the Register Map, the device should be reset by 2 register writes and with 100ms delays.
This leads to:
Code: Select all
void Gyro_init() {
...
i2c_writeReg(MPU6050_ADDRESS, 0x6B, 0x80); //PWR_MGMT_1 -- DEVICE_RESET 1
delay(5);
being changed to:
Code: Select all
void Gyro_init() {
...
i2c_writeReg(MPU6050_ADDRESS, 0x6B, 0x80); //PWR_MGMT_1 -- DEVICE_RESET 1
delay(100);
i2c_writeReg(MPU6050_ADDRESS, 0x68, 0x7); //SIGNAL_PATH_RESET -- RESETS
delay(100);
Ater I did that, I had reliable IMU startup every time.
Regards
Soren