Hi,
I'm using the ADP5587ACPZ-R7 as a GPIO expander to control mainly LEDs.
I'm using the Arduino platform with their recommended code for I2C communication (from Wire.h class). However, I just can't get a communication working. The same code for writing to and reading from registers works fine with other chips like the ADXL345BCCZ on the same bus.
Is there anything special with the I2C communication of the ADP5587? I will attach code and schematics below. I'd really appreciate if someone could look over it and check if I'm missing anything.
Here is the code I'm using for writing to and reading from registers (using the Arduino Wire.h class):
void ADP5587_writeRegister(uint8_t reg, uint8_t val) {
Wire.beginTransmission(0x68);
Wire.write(reg);
Wire.write(val);
Wire.endTransmission();
}
uint8_t ADP5587_readRegister(uint8_t reg) {
uint8_t resp;
Wire.beginTransmission(0x68);
Wire.write(reg);
Wire.endTransmission();
uint8_t num_bytes = 1;
Wire.requestFrom(0x68, num_bytes);
while(Wire.available()) {
resp = Wire.read();
}
return resp;
}Thanks a lot for the help.
Patrick