View previous topic :: View next topic |
Author |
Message |
evaradharaj
Joined: 15 Jan 2009 Posts: 60
|
Reg: Same pin for Input and Output |
Posted: Thu Apr 24, 2014 9:50 am |
|
|
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: 19504
|
|
Posted: Thu Apr 24, 2014 9:56 am |
|
|
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
|
|
Posted: Thu Apr 24, 2014 7:44 pm |
|
|
Thanks Ttelmah. _________________ embedding innovation in engineers |
|
|
|