I2c.readerror() returns -2 'Timeout while selecting transmit mode' SOVLED!

Hi all I’m trying to interface with a GE chipcap2 temperature/humidity sensor over i2c.

I’m pretty sure my hardware is correct. I have 2.4k pull up resistors on both SCL and SDA. I also put a oscilloscope to it and can see the clock and data.

My device code:
`
hardware.i2c12.configure(CLOCK_SPEED_400_KHZ);
local addr = 0x28 << 1;

local data = hardware.i2c12.read(addr, “\x00”, 2);
server.log(hardware.i2c12.readerror());
server.log(data);
`

error comes back as -2 and data as (null : 0x0).

Could someone point me in the right direction? Also could anyone explain what ‘Timeout while selecting transmit mode’ means.

Thanks ahead of time!

Sounds like the device is not responding. Can you post a scope trace of the setup? Worth trying 100kHz in case your hookup is particularly high capacitance.

I solved the issue, but not 100% on how though.

Short answer: There was a short in connecting the chipcap2.

Long answer: I’m working on a prototype pcb (no silkscreen just bare copper) and one of the pins on the chipcap2 was shorted. However, I’m nor sure which one was the short. I’m going to redraw the smd pads and order a board with silkscreen and we should be good to go.

Thanks Hugo for the help!