Jump to content
I2Cdevlib Forums

Problem (and possible reason) of MPU6050 DMP + Mediatek LinkitOne


Recommended Posts

Recently, when I tried to control MPU6050 via Mediatek Linkit One, I found that there seems a problem in readBytes() function in i2cdevlib.

 

Since the I2C buffer of Linkit One is really small, the following code will loop more than one time. Using logic analyzer, I found that the I2C write address will be incorrect after first iteration because of the line 278.

 

Will you guys think that the line 278 needs to be modified to Wire.write(regAddr+k) ?

 

PS. The DMP operates correctly after this modification.

 

276 for (uint8_t k = 0; k < length; k += min(length, BUFFER_LENGTH)) { 

277 Wire.beginTransmission(devAddr); 

278 Wire.write(regAddr); 

279 Wire.endTransmission(); 

280 Wire.beginTransmission(devAddr); 

281 Wire.requestFrom(devAddr, (uint8_t)min(length - k, BUFFER_LENGTH)); 

282

 

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...