1
\$\begingroup\$

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

\$\endgroup\$

1 Answer 1

6
\$\begingroup\$

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

\$\endgroup\$
12
  • \$\begingroup\$ Thanks, probably the answer makes sense for electrical engineers. However, it is not clear how to relate you answer to the physical pins. Could you please use the annotations of physical pins of KX224: VDD, GND, SDA, SCL, INT1? Also, there are 5 pins in total - pin 7 does not exist in KX224-I2C-EVK-001. \$\endgroup\$
    – Sokolokki
    Apr 29, 2021 at 9:12
  • 1
    \$\begingroup\$ That is a photo of an unpopulated PCB, not the sensor. The sensor should be where the U1 is. It won't do anything because it's a blank PCB with no parts installed. \$\endgroup\$ Apr 29, 2021 at 13:35
  • 1
    \$\begingroup\$ Btw, that photo you added is NOT the sensor. It is indeed the evaluation board. The sensor is the chip marked U1. \$\endgroup\$
    – DamienD
    Apr 29, 2021 at 13:51
  • 1
    \$\begingroup\$ Part of the confusion is that there are three things, the chip (which is the only thing described on the datasheets linked above), the daughterboard (an unpopulated one is in your photo) and there is a much bigger evaluation motherboard. I don't see a schematic of the daughterboard online. Most likely you jump the top or bottom two pins of the three JP1 to select the address, R2 and R3 are pullups for SCL/SDA (not required if they are provided elsewhere). \$\endgroup\$ Apr 29, 2021 at 13:56
  • 1
    \$\begingroup\$ No it is not possible. A soldering iron is required to add the jumpers. \$\endgroup\$ Apr 29, 2021 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.