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

when do we need port_b_pull-ups()?

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







when do we need port_b_pull-ups()?
PostPosted: Tue Aug 09, 2005 12:54 am     Reply with quote

I am not sure what is the purpose of using port_b_pull-ups().

Is it either all pins are pull up? can I pull up individual pin?

I am using PCM 3.180, PIC16F628A.
Ttelmah
Guest







PostPosted: Tue Aug 09, 2005 5:29 am     Reply with quote

Key thing is that a pin set as an input, can float to any voltage. Now if you are attempting to read a signal that only 'drives' the line part of the time (for instance a switch, which will only drive the line when 'closed'), then there is no guarantee what value the signal will go to, when the switch is open. The solution is to add a very large value resistor, which draws just enough current to take the line to a 'determined' value (either high, or low). Now the pull up 'resistors', are not actually resistors, but current sources, but the behaviour is basically the same. The behaviour of thse changes from chip to chip, with some offering 'per pin' settings, and others only offering a global 'on/off'. On the 16F628, the pull-ups all turn on together. However the current involved is very low (200uA/pin), so this is not normally a problem.

Best Wishes
Kit
Guest







PostPosted: Wed Aug 10, 2005 4:08 am     Reply with quote

Could i say, the general rule is setting the port_b pullup to true. Is that saying, setting portb pulls up to true no matter in what situation is no harm at all?
eaton2
Guest







PostPosted: Wed Aug 10, 2005 4:57 am     Reply with quote

not necessarily. I have had a situation where the pull-up interfered with an incoming signal. Even though the enable is global, If you set a pin as an output the pull-up is disabled. If you are using pins for inputs from switches the pull-ups are great. They reduce your parts count on the PCB. I have found that it is wise to fully test circuit operation with the pull-ups enabled before commiting to it in a prouction ckt.

regards
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