|
|
View previous topic :: View next topic |
Author |
Message |
engrmunir786
Joined: 25 Jul 2012 Posts: 20
|
Microcontroller - Same pin is use as input and output |
Posted: Fri Aug 10, 2012 1:04 am |
|
|
Dear Experts
I want to use one pin as input and output. My application is that I want to pullup same pin by using software command bit_set(PORTA,2) and the same pin I want to use as switch input. I mean initially the software will pullup PORTA,2 by using software command. From hardware side i have connected transistor collector which is switching Zero Logic on PORTA,2. I am sensing that Zero Logic in my program. Actually I do not want to use external pullup on PORTA,2. I want to use software pullup on PORTA,2. How can I solve this problem ? |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
Re: Microcontroller - Same pin is use as input and output |
Posted: Fri Aug 10, 2012 1:17 am |
|
|
If you read the I/O Ports chapter of your PIC's datasheet, you will see how the I/O for that port is configured in hardware...
But, for the most part, unless the port has internal pullup resistors like those found on portB (each PIC is different, so always consult the datasheet), you can't "pull up" a GPIO by setting it for output high and then reading it back like you describe. _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
|
|
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
|