Multiple i2c Devices with same address

Status
Not open for further replies.
There are a number of I2C bus switches/multiplexers available.
The PCA9646 is one of them.

The NXP site has a lot of very good information on it!

Also, the Teensy 3.1 has two separate I2C busses. While that would leave you one short I thought I'd mention it ;-)
 
Maybe you could try to do the 3rd i2c in Software. As far as i know, there are solutions for AVR - should be possible to port.
 
I'm using this sensors in my project: https://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NSK1042

I need to hookup 3 of them to a teensy 3.1 And unfortunately there is no way to change their i2c address. They all come with a fixed 0x41 address.


Is there a way to manage multiple I2c ports on the same teensy 3.1 or a good working way to have 3 of these sensors hooked up and working on the same teensy 3 at the same time?

It can be done with just a Teensy 3.1, but you would need to multiplex between two of them on the 1st bus (using both sets of pins for the 1st bus), and have the 3rd one on the 2nd bus. Refer to the quad_master sketch here: http://forum.pjrc.com/threads/21680-New-I2C-library-for-Teensy3

Just FYI, the 2nd bus requires working with the backside SMT pads.
 
My library examples tend to be ... verbose. The short answer is, first download the i2c_t3 library, then it would be something like the following:

- Hook up one slave on pins 16/17
- Hook up one slave on pins 18/19
- Hook up one slave on pins 29/30 (backside SMT pads)

I'll assume external pullups for all.

Then some code like this:
Code:
void setup()
{
    Wire.begin(I2C_MASTER, 0x00, I2C_PINS_16_17, I2C_PULLUP_EXT, I2C_RATE_400);
    Wire.pinConfigure(I2C_PINS_18_19, I2C_PULLUP_EXT); // let library handle pin setup

    Wire1.begin(I2C_MASTER, 0x00, I2C_PINS_29_30, I2C_PULLUP_EXT, I2C_RATE_400);
}

void loop()
{
    if(some_trigger)
    {
        Wire.pinConfigure(I2C_PINS_16_17, I2C_PULLUP_EXT);  // Toggle I2C mux to Slave1
        Wire.requestFrom(....);  // talk to Slave1

        Wire.pinConfigure(I2C_PINS_18_19, I2C_PULLUP_EXT);  // Toggle I2C mux to Slave2
        Wire.requestFrom(....);  // talk to Slave2

        Wire1.requestFrom(....);  // talk to Slave3, no need to adjust mux since it is dedicated
    }
}
 
Hi @ all
first post here but i have been reading a while and sucking up everything interesting.

I have the same problem just with 16 differential pressure sensor on which i can't change the address.
Now i'm testing with the Sparkfun Multiplexer Breakout (IC is a TI CD74HC4067) with the SDA lines getting multiplexed.
All Sensors SCL lines are conneted together. It seems to be working alright for a simple breadboard setup. I'm using the i2c_tc library
I was wondering if there are drawbacks with that system versus a special nxp 2-wire bus?
 
Status
Not open for further replies.
Back
Top