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

Reg: Same pin for Input and Output

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



Joined: 15 Jan 2009
Posts: 60

View user's profile Send private message Visit poster's website

Reg: Same pin for Input and Output
PostPosted: Thu Apr 24, 2014 9:50 am     Reply with quote

Hi,

I am using 16f877a for interfacing 4 wire resistive touch screen directly. I am following the instructions from this website:
http://www.pyroelectro.com/tutorials/touchscreen_interface_resistive/img/schematic.png

According to the diagram, I want to configure the port C pins for input as well as output in same program, but in different places (one by one).. Is it possible to do that?

Please suggest me. Thanks
_________________
embedding innovation in engineers
Ttelmah



Joined: 11 Mar 2010
Posts: 19260

View user's profile Send private message

PostPosted: Thu Apr 24, 2014 9:56 am     Reply with quote

Yes.

Output_drive sets the pin as an output.
Output_float sets it as an input.

If you are using standard_io, whenever you send data out of a pin, it is set as output, as soon as you read it, it switches to input.

However with the above two drive/float instructions, you can leave the output latch 'set', and disable the drive, as separate operations.

Best Wishes
evaradharaj



Joined: 15 Jan 2009
Posts: 60

View user's profile Send private message Visit poster's website

PostPosted: Thu Apr 24, 2014 7:44 pm     Reply with quote

Thanks Ttelmah.
_________________
embedding innovation in engineers
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