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

Microcontroller - Same pin is use as input and output

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



Joined: 25 Jul 2012
Posts: 20

View user's profile Send private message

Microcontroller - Same pin is use as input and output
PostPosted: Fri Aug 10, 2012 1:04 am     Reply with quote

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: 1530
Location: Central Illinois, USA

View user's profile Send private message

Re: Microcontroller - Same pin is use as input and output
PostPosted: Fri Aug 10, 2012 1:17 am     Reply with quote

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