CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

[OT] Transmission gates as I2C bus switch

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

[OT] Transmission gates as I2C bus switch
PostPosted: Tue Mar 17, 2009 3:30 pm     Reply with quote

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.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Mar 17, 2009 3:53 pm     Reply with quote

Should work perfectly. Additional weak pullups must be provided at the disconnected slave side to keep the idle state.
Ttelmah
Guest







PostPosted: Tue Mar 17, 2009 3:55 pm     Reply with quote

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
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Wed Mar 18, 2009 5:13 am     Reply with quote

Thanks, guys! It also looks like the P82B96 can be cleverly used as a bus switch, if it's Vcc is switched: http://www.standardics.nxp.com/literature/presentations/i2c/pdf/hot.plug.p82b96.pdf

BTW, I'm researching the algorithms for recovering the stuck I2C bus. Any tips?
_________________
Read the label, before opening a can of worms.
Ttelmah
Guest







PostPosted: Wed Mar 18, 2009 9:35 am     Reply with quote

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
future_
Guest







PostPosted: Wed Mar 18, 2009 10:00 am     Reply with quote

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.
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Thu Mar 19, 2009 2:22 pm     Reply with quote

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.
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Sun Mar 22, 2009 1:57 am     Reply with quote

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.


_________________
Read the label, before opening a can of worms.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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