1

I use the Arduino core libraries in my latest project (ATMega328P MCU)

I'm trying to talk to an FXOS8700CQ via I2C. Reading register 0x0D should return 0xC7.

The typical Arduino Wire library method,

Wire.beginTransmission(address);
Wire.write(subAddress);
Wire.endTransmission();
Wire.requestFrom(address, (uint8_t) 1);
uint8_t data = Wire.read();

gives the following incorrect reply:

enter image description here

Using a SoftI2C library from off the web I get the following correct reply:

enter image description here

  • What is the difference that makes one work but not the other?
  • I'm using 10K pull-ups, are they too high?
geometrikal
  • 4,921
  • 2
  • 23
  • 41
  • 1
    10kΩ pull-ups seem a bit weak, considering that Vcc = +3.3V. I would use stiffer pull-ups around 2.2kΩ. See also [this thread](http://electronics.stackexchange.com/q/102611/7036). – Nick Alexeev Dec 03 '14 at 10:21

1 Answers1

2

To answer my own question: Wire.endTransmission() sends a stop bit, but what I needed was a restart using Wire.endTransmission(false)

Now it works:

enter image description here

geometrikal
  • 4,921
  • 2
  • 23
  • 41