Hello, I'm trying to use the MPU6050 Gyroscope with tower MK70 on I2C communication protocol but I have some problems.
To read temperature (for example) values I used the following code:
GI2C1_ReadAddress(DEVICE_ADDRESS, 0x41, 1, &xyz[0], sizeof(xyz));
but it seems that the data I read are always the same. I tried to write in a register with the following code:
GI2C1_WriteAddress(DEVICE_ADDRESS, 0x23, 1, 197, 1);
but it seems that the register values don't change.
Maybe it is necessary to initialize the device but I don't know how to do it.
Thanks in advance.
Hi Angelo,
I have no personal experience with InvenSense’s MPU6050, so cannot be of much help with initialization, but if you posted here your I2C timing diagrams, I might be able to check whether it is a communication issue or something else. I would also suggest reading the WHO_AM_I register, it should always return 0x68, regardless of the initialization of the device and state of AD0 pin.
Regards,
Tomas
PS: If my answer helps to solve your question, please mark it as "Correct". Thank you.
To add to Tomas good idea to check the WHO_AMI register:
http://playground.arduino.cc/Main/MPU-6050
Regards,
David