Jump to content
Forum sending old emails Read more... ×
Sign in to follow this  

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 
  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?

Share this post

Link to post
Share on other sites

Hi @@juani_c, this is what is called a repeated start. We have tried to implement this for the MSP430 but have not been able to get it to work reliably. We are still looking into it but it has been pushed down the list since the majority of the I2C sensors do not need a repeated start.



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this