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

output_float vs set_tris_c() ?

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



Joined: 10 Sep 2003
Posts: 60

View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger ICQ Number

output_float vs set_tris_c() ?
PostPosted: Wed Aug 25, 2004 8:23 am     Reply with quote

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() ?
PostPosted: Wed Aug 25, 2004 9:12 am     Reply with quote

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