![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
[OT] Transmission gates as I2C bus switch |
Posted: Tue Mar 17, 2009 3:30 pm |
|
|
Colleagues,
It should be possible to use a pair of transmission gates to disconnect and reconnect a branch of an I2C bus. Obviously, the bus would be switched when it’s idle.
What are your thoughts about this?
- Nick _________________ Read the label, before opening a can of worms. |
|
![](templates/subSilver/images/spacer.gif) |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Tue Mar 17, 2009 3:53 pm |
|
|
Should work perfectly. Additional weak pullups must be provided at the disconnected slave side to keep the idle state. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Tue Mar 17, 2009 3:55 pm |
|
|
Yes.
Downsides:
Some series resistance.
Bus capacitances on the main', and 'selected' parts add up.
You need pull up resistances on all bus segments, and then to be very careful, that when these are connected in parallel (with two sections joined), resistance is still in spec.
Alternative, use a proper I2C multiplexer. Look (for instance), at the Texas PCA9543. This is an I2C device itself, that allows one bus to connect to two others. There is also a 9546, that supports four external busses.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Wed Mar 18, 2009 9:35 am |
|
|
Are you controlling the master or the slave?.
Have some kit, that uses I2C, at 12v, with (funnily enough), the P82B96 transceivers. As far as the 'master' is concerned, the bus never gave any problems, and nothing the master does, can directly reset a 'hung' slave.
On the slave, used the CCS I2C_ISR_STATE function, and had perpetual problems wth intermittent hangs. Re-wrote the slave, to test the register bits directly, and from that moment on, have never seen a hang. Also added a test, that the 'transfer counter' (incremented whenever a I2C transfer completes), was incrementing, and added a watchdog timeout, if not, with a complete reset of the I2C code. Did a similar thing at the master.
Since this, operational reliability, has been 100%.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
future_ Guest
|
|
Posted: Wed Mar 18, 2009 10:00 am |
|
|
Ttelmah,
What about hung eeproms? I did not look for it yet but a system with 2 pics and 2 fram hangs up at 1mhz, 400khz does fine. When I have time I'll try again to speed things up.
I think only a power cycle will make hung slave chip work again. |
|
![](templates/subSilver/images/spacer.gif) |
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
Posted: Thu Mar 19, 2009 2:22 pm |
|
|
Quote: | Are you controlling the master or the slave? |
I’m writing code for both. There are also simple slave devices without firmware (I/O expanders). The challenge is that my bus is hot-pluggable. If a branch is plugged in (and I have to use a pretty bad connector) in the middle of a transaction it may mess-up the transaction and leave the slave device in a bad state.
Quote: | On the slave, used the CCS I2C_ISR_STATE function, and had perpetual problems with intermittent hangs. |
I’ve had problems with i2c_isr_state() too. On top of that CCS had changed a behavior of the i2c_isr_state() somewhere between v4.071 and v4.081 without a proper notice. _________________ Read the label, before opening a can of worms. |
|
![](templates/subSilver/images/spacer.gif) |
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
Posted: Sun Mar 22, 2009 1:57 am |
|
|
kender wrote: | It looks like the P82B96 can be used as a bus switch, if it's Vcc is switched. |
This approach actually worked. I have an I/O expander in the same area, and I'm powering P82B96 from one of I/O expander's pins. Here's a scope screenshot.
![](http://www.prolifictec.com/filehost/P82B96_as_I2C_bus_switch_rev02.png) _________________ Read the label, before opening a can of worms. |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|