Electronic – Connecting two Rohm KX224 sensors over I2C

i2c

I would like to connect two identical sensors (slaves) over an I2C bus. The problem is that they have the same address.

The datasheet says the following:

The KX224 Slave Address is comprised of a user programmable part, a factory programmable part, and a fixed part, which allows for connection of multiple accelerometers to the same I2C bus. The Slave Address associated with the KX224 is 00111YX, where the user programmable bit X, is determined by the assignment of ADDR (pin 1) to GND or IO_VDD.

Pin 1 is VDD, not ADDR. Also, there is a diagram:

Multiple KX224 Accelerometers on a Shared I2C Bus

Multiple KX224 accelerometers on a shared I2C bus

There are assumptions on the diagram about connecting ground or power, which I am not sure about. Here is the link to the datasheet.

Do I just need to invert polarity when connecting one of the sensors to instantiate a different address?

Here is what the sensor looks like:

enter image description here

Best Answer

According to this datasheet, the Y part of the address is factory programmed to 1. Pin 7 (SDO/ADDR) is connected to either IO_Vdd or GND to select the X part of the address.

As the table on Page 18 illustrates (and as you might expect), a low on the SDO/ADDR pin results in X = 0 and a high results in X = 1.

You must keep the nCS input input at IO_Vdd in order to select I2C communication and to avoid having the SDO output attempt to drive the aforementioned ADDR pin.

To use two chips on a single I2C interface, simply hard-wire the SDO/ADDR pin on one to GND and the other to IO_Vdd.


Okay, as the story in the comments go, we are actually talking aboot a chip on a daughterboard that is intended to plug into a master evaluation board. I have found the schematic of the daughterboard:

You will see that JP1 needs to have the center pad shorted to the top for one address and to the bottom for the other. A guess would be that top is for '1' and bottom is for '0' but I don't see anything that confirms that.

nCS is hard-wired to Vdd, so you don't need to worry about that. R2 and R3 are not installed in your photo.

All you need to do to use this is

  1. Install the jumper for the address- you must install one or the other position- there is no pullup or pulldown resistor. If you short all 3 together it will short out the power supply which would be bad.

  2. Vdd and GND connections

  3. SCL and SDA to your processor (there must be I2C pullup resistors installed somewhere, if they are not on your MCU board then you can install them in R1/R2 positions).

  4. INT output to MCU interrupt input if you want to use it.

enter image description here