Pi4J / pi4j-v1

DEPRECATED Java I/O library for Raspberry Pi (GPIO, I2C, SPI, UART)
http://www.pi4j.com
Apache License 2.0
1.31k stars 448 forks source link

I2C repeated start #459

Open Neiwirger opened 5 years ago

Neiwirger commented 5 years ago

Hello.

I want to read out an I2C device with registers which have 2 bytes long adresses. I am using the method:

i2cDevice.read(writeBuffer, 0, 2, readBuffer, 0 ,2)

Looking at my Oscilloscope, the I2C bus is writing the correct buffer content, but what it is reading is completely wrong.

The problem is, after writing to the bus there is a stop condition. But the device longs for a repeated start.

I also tried single write and read operations with previously setting combined to "Y" and vice versa after the operations.

I already checked https://github.com/Pi4J/pi4j/issues/225 this to fix my problem. But i think i doing something wrong. I also checked the bus speed. I can change the file "combined" from Y to N and vice versa. But it´s the same output at the oscilloscope.

Maybe someone can show me the right direction for getting a solution.