|
|
View previous topic :: View next topic |
Author |
Message |
Einly
Joined: 10 Sep 2003 Posts: 60
|
output_float vs set_tris_c() ? |
Posted: Wed Aug 25, 2004 8:23 am |
|
|
Dear all,
Referring to the file write & read external eeprom, there are 2 lines:
output_float(eeprom_sda);
output_float(eeprom_scl);
In the ccs manual, it is stated that output_float is used to:
Sets the specified pin to the input mode. This will allow the pin to float high to represent a high on an open collector type of connection.
May I know what is meant by the second sentence <This will allow...> ?
To make a pin high, why can't we use set_tris_b(...)?
Is there any difference between the 2?
Thanks a lot _________________ Einly |
|
|
Ttelmah Guest
|
Re: output_float vs set_tris_c() ? |
Posted: Wed Aug 25, 2004 9:12 am |
|
|
Einly wrote: | Dear all,
Referring to the file write & read external eeprom, there are 2 lines:
output_float(eeprom_sda);
output_float(eeprom_scl);
In the ccs manual, it is stated that output_float is used to:
Sets the specified pin to the input mode. This will allow the pin to float high to represent a high on an open collector type of connection.
May I know what is meant by the second sentence <This will allow...> ?
To make a pin high, why can't we use set_tris_b(...)?
Is there any difference between the 2?
Thanks a lot |
The 'key' difference, is that the output_float instruction deals with a single pin. Effectively it is equivalent to reading the TRIS register, setting the single bit for the designated pin, and writing this back to the register.
Best Wishes |
|
|
|
|
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
|