Two I2C slaves with the same address

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
jofic_334026
Level 3
Level 3
First like received

I have a situation where I have two slave devices with the same address.  How do I communicate with both of them?  Our hardware is configured such that both slaves share the clock pin but have separate data lines.  This approach worked well with another processor.  How do I handle this with a PSoC?  The schematic below doesn't work because the mux is not bidirectional.  Is this a situation where a multi master architecture would be a solution?  If so, is there an example of how to implement such a system?

SeperateSDA.png

0 Likes
1 Solution

This is what worked for me.

// To Select SDA0

SDA1_SetDriveMode(PIN_DM_DIG_HZ);

SCL_SetDriveMode(PIN_DM_DG_HIZ);

SdaControlReg_Write(1);

SDA0_SetDriveMode(PIN_DM_OD_LO);

SCL_SetDriveMode(PIN_DM_OD_LO);

// To Select SDA1

SDA0_SetDriveMode(PIN_DM_DIG_HZ);

SCL_SetDriveMode(PIN_DM_DG_HIZ);

SdaControlReg_Write(1);

SDA1_SetDriveMode(PIN_DM_OD_LO);

SCL_SetDriveMode(PIN_DM_OD_LO);

Solution.png

View solution in original post

0 Likes
2 Replies
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

Hi Jonathan,

In psoc5, the I2C(Fixed Function, not UDB) can be  configured to external OE buffer function which exposes in and out terminals for bus multiplexing inside psoc. You can find the details in the datasheet of the component in page 45.

http://www.cypress.com/file/175671/download

pastedImage_1.png

pastedImage_2.png

Regards,

Owen

This is what worked for me.

// To Select SDA0

SDA1_SetDriveMode(PIN_DM_DIG_HZ);

SCL_SetDriveMode(PIN_DM_DG_HIZ);

SdaControlReg_Write(1);

SDA0_SetDriveMode(PIN_DM_OD_LO);

SCL_SetDriveMode(PIN_DM_OD_LO);

// To Select SDA1

SDA0_SetDriveMode(PIN_DM_DIG_HZ);

SCL_SetDriveMode(PIN_DM_DG_HIZ);

SdaControlReg_Write(1);

SDA1_SetDriveMode(PIN_DM_OD_LO);

SCL_SetDriveMode(PIN_DM_OD_LO);

Solution.png

0 Likes