Jump to content
43oh

Issue with I2C and Wire


Recommended Posts

I'm trying to comunicate with a FXOS8700CQ. (Energia 13-MSP430G2553)

When I use this code:

 

Wire.beginTransmission(0x1E);   // Initialize the Tx buffer
Wire.write(FXOS8700CQ_OUT_X_MSB);                // Put slave register address in Tx buffer
Wire.endTransmission(false);       // Send the Tx buffer, but send a restart to keep connection alive


Wire.requestFrom(0x1E, 6);  // Read bytes from slave register address 
  i=0;
  while (Wire.available()) {
dest[i++] = Wire.read();
}
 
I get what it's seen in the bottom of the image. The second time the addres is sent it should be a "read" instead of "write".
When using just Wire.endTransmission();, that is whitout "false", the STOP is sent (top of the image), this is not how the communication with the sensor should be, BUT now the second time the addres is sent correct as a "read".
It's like the Wire.requestFrom() is not actually reading. Any ideas?
 
i2c.png
Link to post
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.

×
×
  • Create New...