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

Does I2C act as open-collector

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



Joined: 28 Feb 2005
Posts: 3

View user's profile Send private message

Does I2C act as open-collector
PostPosted: Tue Oct 25, 2005 5:13 pm     Reply with quote

My first post.

I will be using the built in I2C functions. I want to make sure that the I2C routines will not pull the lines HIGH but will allow them to float high.

There is an option NOFLOAT_HIGH for #use I2C... It this will (per documentation) force the I2C pins high but it is not clearly stated that the pins will FLOAT if this option is not specified.

Also does it matter if if FORCE_HW is used when determining if the pins will FLOAT.

In my project the pins have to float or I will smoke a componet.

Thanks
Dan
Mark



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

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

PostPosted: Tue Oct 25, 2005 8:15 pm     Reply with quote

Normal operation is to allow the pins to float. NOFLOAT_HIGH would seem to indicate that the pins will not float high. If you are that concerned, then you should write your own I2C routines.
Guest








PostPosted: Wed Oct 26, 2005 5:58 am     Reply with quote

Thanks for the input Mark. I will write the routines only if necessary i.e. the “store bought” versions don’t work the way required.

If anyone actually knows the answer I would appreciate comments. As I mentioned there is the implication in the Spartan documentaion that the library will emulate open-collector but no definitive statement to that effect.
Mark



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

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

PostPosted: Wed Oct 26, 2005 6:10 am     Reply with quote

Anonymous wrote:
Thanks for the input Mark. I will write the routines only if necessary i.e. the “store bought” versions don’t work the way required.

If anyone actually knows the answer I would appreciate comments. As I mentioned there is the implication in the Spartan documentaion that the library will emulate open-collector but no definitive statement to that effect.


My point is that you cannot be certain that they will always float to high unless you write them yourself. Yes they may be today but what about the next release? That means that every time you upgrade the compiler, you'll have to verify this. It is pretty trivial to write the routines yourself and if you want to be certain, that is the way to go.
lightorama



Joined: 28 Feb 2005
Posts: 3

View user's profile Send private message

PostPosted: Wed Oct 26, 2005 6:14 am     Reply with quote

Opps... Two mistakes One I was not logged on for the last post and second I had the statement:

If anyone actually knows the answer I would appreciate comments...

Sounds a bit rude towards Mark and I didn't mean it to be that way. I meant to state if someone actually knows how CCS wrote their routines and if they keep their pin as input when they are to be high I would use the help.

Some of the other compilers I have used, I could view the source for the libraries but I don't know if that is possible with CCS. Then I could check myself.
lightorama



Joined: 28 Feb 2005
Posts: 3

View user's profile Send private message

PostPosted: Wed Oct 26, 2005 6:15 am     Reply with quote

Mark wrote:
Anonymous wrote:
Thanks for the input Mark. I will write the routines only if necessary i.e. the “store bought” versions don’t work the way required.

If anyone actually knows the answer I would appreciate comments. As I mentioned there is the implication in the Spartan documentaion that the library will emulate open-collector but no definitive statement to that effect.


My point is that you cannot be certain that they will always float to high unless you write them yourself. Yes they may be today but what about the next release? That means that every time you upgrade the compiler, you'll have to verify this. It is pretty trivial to write the routines yourself and if you want to be certain, that is the way to go.




Mark you are 100% correct!
Mark



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

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

PostPosted: Wed Oct 26, 2005 6:16 am     Reply with quote

lightorama wrote:
Opps... Two mistakes One I was not logged on for the last post and second I had the statement:

If anyone actually knows the answer I would appreciate comments...

Sounds a bit rude towards Mark and I didn't mean it to be that way. I meant to state if someone actually knows how CCS wrote their routines and if they keep their pin as input when they are to be high I would use the help.

Some of the other compilers I have used, I could view the source for the libraries but I don't know if that is possible with CCS. Then I could check myself.


You can look at the lst file and see the asm of the code but not any C source code. But to answer your question, yes they would need to float the lines otherwise clock stretching and bus collisions would be a problem since once device would be driving and the other might be sinking.
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