I got me a brand new mpu6050. Its a different mpu comapred to ADXL345/ITG3200. mpu6050 has only one i2c address (0x68).
I connected it to my RPi and all i2c commands worked like charm.
When i connected it to spark i faced the same old problem of not writing to the registers.
I see that below code is failing,
while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED))
I see that writeTo() -> endTransmission() function is failing me a lot while readFrom() has worked most of the time.
@peekay123: You wrote ’ I am looking at how the Core firmware and Arduino handle a device address to be sure they match’. You have any updates for me if any.
I see that there are many issues with stmf100x i2c. Here are some of the links,
@sanjukul, I can’t comment about those thread but perhaps @satishgn or another Spark engineer can. As a baseline, have you tried the MPU6050 IDE library to test?
Looking at the data sheet for the MPU6050, it has a maximum i2c clock rate of 100kHz in normal mode and that is Spark’s slowest speed.
Given that you are dealing with a very slow i2c device, you might want to try adding the 100ohm series resistors on the two i2c lines as shown in this diagram from the ST Micro datasheet:
If that doesn’t work, you will likely have to get a bit-banging i2c implementation working to go slow enough.
@bko, some time ago another member was using a Sparkfun MPU6050 with a library I ported and it worked fine with the “old” 100KHz Core firmware:
It should work without problems or the need for the resistors. It may also be hard to put the resistors in as the pull-ups may already be on the board.