- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Regards,
Owen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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);