View previous topic :: View next topic |
Author |
Message |
lightorama
Joined: 28 Feb 2005 Posts: 3
|
Does I2C act as open-collector |
Posted: Tue Oct 25, 2005 5:13 pm |
|
|
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
|
|
Posted: Tue Oct 25, 2005 8:15 pm |
|
|
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
|
|
Posted: Wed Oct 26, 2005 5:58 am |
|
|
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
|
|
Posted: Wed Oct 26, 2005 6:10 am |
|
|
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
|
|
Posted: Wed Oct 26, 2005 6:14 am |
|
|
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
|
|
Posted: Wed Oct 26, 2005 6:15 am |
|
|
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
|
|
Posted: Wed Oct 26, 2005 6:16 am |
|
|
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. |
|
|
|