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 CCS Technical Support

Default state of I2C pins?

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



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

Default state of I2C pins?
PostPosted: Sat Mar 19, 2005 1:55 pm     Reply with quote

Logically, I'd assume that the default state of the I2C pins on a pic, whether using the h/w or s/w i2c mode, would be to configure both the SCL and SDA lines as inputs. That is, they'd both be inputs if there is no i2c activity.

Does anyone know for sure if this is true?

I have a couple of pics, each wired into an i2c serial EEPROM. For reasons too complicated to go into here, one of the pics will only read from the EEPROM, the other will only write to it. It is impossible for both pics to try and access the EEPROM at the same time.

Everything will be fine if the default state for the i2c lines are to be inputs.
Guest








PostPosted: Sat Mar 19, 2005 3:07 pm     Reply with quote

Yes, this is true, because pull-up resistors will guarantee hige level on the I2C Bus ( idle state ,when no transfer ). If your device is Master and SCL & SDA are outputs when master is in idle state, we will violate I2C bus specifications. In this situation other masters ( if you have more that one ) can't get control of the bus.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

Re: Default state of I2C pins?
PostPosted: Sat Mar 19, 2005 3:17 pm     Reply with quote

newguy wrote:
Logically, I'd assume that the default state of the I2C pins on a pic, whether using the h/w or s/w i2c mode, would be to configure both the SCL and SDA lines as inputs. That is, they'd both be inputs if there is no i2c activity.

Does anyone know for sure if this is true?

I have a couple of pics, each wired into an i2c serial EEPROM. For reasons too complicated to go into here, one of the pics will only read from the EEPROM, the other will only write to it. It is impossible for both pics to try and access the EEPROM at the same time.

Everything will be fine if the default state for the i2c lines are to be inputs.


Yes, it's called multi-master mode.
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Sat Mar 19, 2005 3:30 pm     Reply with quote

Perfect! Thanks.
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