5 years, 4 months ago.

I2C error using GE Chipcap2 sensor (temperature/humidity) CC2D23S

Hi all,

I've been trying to use the GE Chipcap2 (CC2D23S) sensor with the mbed LPC11U24 board, over I2C, but already tried several variations without success.

The code: http://mbed.org/users/mbn12/code/GE_ChipCap2/ http://hastebin.com/igaguzaqur.avrasm (not working)

Strangely, I could read successfully from the same chip with an Arduino using the code: http://hastebin.com/tilolukave.go (working!)

So it probably isn't a hardware issue.

I didn't quite understand how to use the mbed I2C functions for this sensor. I even tried some code using the lower level I2C functions (i2c_api.h): http://hastebin.com/lusubiqemu.avrasm

Anyone have a suggestion of what I am doing wrong and what would be the mbed version of the Arduino code above, that works?

Thanks in advance,

Best regards

Mario

/media/uploads/mbn12/chipcap2_v3.ino working

/media/uploads/mbn12/mbed_main.cpp not working

1 Answer

5 years, 4 months ago.

0x28 is also the address that Arduino uses, and Arduino uses 7-bit addresses, while mbed uses 8-bit addresses. So instead of 0x28 you need to use (0x28 << 1).

I found some datasheet of how that thing is supposed to use I2C, which is fairly creative. I don't know exactly why your Arduino code does some things, so I let you try some more with the address information. (I could post code, but it most likely would be wrong). Just one more thing, see this for normal I2C transactions using mbed: https://mbed.org/handbook/I2C. Just stick to the 'regular' commands, where you tell it to write/read a certain number of bytes, and don't mix it with single byte read/write commands.

Accepted Answer

Hi Erik,

You rule! It was indeed the address shift (and maybe the mixing with single byte operations).

The code is now working and I can read the humidity and temperature.

I also published the working code here: http://mbed.org/users/mbn12/code/GE_ChipCap2/ if someone else needs it.

Best regards,

Mario

posted by Mario Baldini 11 Aug 2014