I am attempting to interface between a custom 8051-based MCU and a new (ebay) GY-521 module (Gyro/Accel chip) using I2C bus. I have written the I2C bit-bang functions myself and they seem to be working fine. I can view bus operations (Read/write) on the scope, and I'm seeing ACKs from the GY-521 when they should be seen.
However, in order to read the gyro/accel data, I must clear the "SLEEP" bit from the PWR_MGMT_1 register.
Procedure: 1. Send START sequence 2. Send 7-bit address + WRITE bit (0) 3. Read ACK from slave 4. Write 8-bit register address (0x6b) 5. Read ACK 6. Write 8-bit data value (0x01 = use X Gyro as clock source) 7. Read ACK 8. Send STOP sequence.
I can watch the MCU write the new value (0x01) to the register, but then when I Read back the register, the value is back to 0x40 (default).
Any reads of the gyro or accel values return zeros due to the module being in sleep mode.
Here is the spec sheet for the MPU-6050 gyro that's used in this board. https://www.cubby.com/pli/Spec+Sheet.pdf/_506bd71d53d3454282f06fa698666f04
Here's the register list: https://www.cubby.com/pli/Register+Map.pdf/_17685da9808c42099c5ebdc1058c63b3
If you wish, I can post the scope output where you can see the value being set, the ACK received, and then reading back the value yielding the default.
Any suggestions appreciated.