Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pull Up Resistors for PIC

Status
Not open for further replies.

Andy1845c

Active Member
I am finishing up the first actul project I have ever done that uses a PIC.

I am using 5 of the I/O ports and a rotory switch to select what part of the program I want the pict to run. The switch will pull them low.

It dawn on my lastnight that leaving the pins floating will likly just cause eratic operation and that I should use pullup resistors to hold them high.

Is this correct thinking? The sad part is I didn't figure in pull ups when I laid everything out on stripboard. :rolleyes: Now I'll have to figure outhow to jam them in.

And my other question is what value works good as a pull up in this situation and is the value that critical? I have seen 10K used in other projects, but I don't know if I have 5 10K on hand. What kind of range of values can be used? Do they even have to match?
 
Andy1845c said:
I am finishing up the first actul project I have ever done that uses a PIC.

I am using 5 of the I/O ports and a rotory switch to select what part of the program I want the pict to run. The switch will pull them low.

It dawn on my lastnight that leaving the pins floating will likly just cause eratic operation and that I should use pullup resistors to hold them high.
Leaving input pins, used by the program, floating will cause problems.

Is this correct thinking? The sad part is I didn't figure in pull ups when I laid everything out on stripboard. :rolleyes: Now I'll have to figure outhow to jam them in.
You could use surface mount resistors, soldered, say on the back of the board. I would use any value from 4K7 thru 22K

And my other question is what value works good as a pull up in this situation and is the value that critical? I have seen 10K used in other projects, but I don't know if I have 5 10K on hand. What kind of range of values can be used? Do they even have to match?

The values are not critical, but if you are running on batteries the higher the better, to reduce current drain.
 
Andy1845c said:
I am finishing up the first actul project I have ever done that uses a PIC.

I am using 5 of the I/O ports and a rotory switch to select what part of the program I want the pict to run. The switch will pull them low.

It dawn on my lastnight that leaving the pins floating will likly just cause eratic operation and that I should use pullup resistors to hold them high.

Is this correct thinking? The sad part is I didn't figure in pull ups when I laid everything out on stripboard. :rolleyes: Now I'll have to figure outhow to jam them in.

And my other question is what value works good as a pull up in this situation and is the value that critical? I have seen 10K used in other projects, but I don't know if I have 5 10K on hand. What kind of range of values can be used? Do they even have to match?
Yes, you need pull-up resitors. Their values are not critical and they don't have to match. Those resistors simply set the current flowing to ground when a switch is closed; that current should not be too high or too low. Typical values vary from few kΩ to tens of kΩ.
Do you happen to use a port with internal pull-up resitors? This would allow you to save external components.


Edit: Eric, we were posting at the same time, I agree with your comments.
 
Last edited:
Many pics include weak pullup resistors on port B

To enable them, ensure that OPTION reg bit 7 is zero and then each port B defined input pin will be able to use them.
 
Andy1845c said:
It dawn on my lastnight that leaving the pins floating will likly just cause eratic operation and that I should use pullup resistors to hold them high.
The ideas above are all good. You can also use a bussed SIP resistor pack to save space on the PCB:
https://www.electro-tech-online.com/custompdfs/2007/11/4300R.pdf
For unused pins on the PIC, just program them as outputs.
 
Thanks everyone:) I found some resistors around the 10k range (more like 12-14k) and crammed them onto the board. I haven't been able to test it yet though.
 
Andy1845c said:
Thanks everyone:) I found some resistors around the 10k range (more like 12-14k) and crammed them onto the board. I haven't been able to test it yet though.

It's really VERY, VERY, uncritical - I've no idea what the limits are, but anything from 1K to 1M is probably perfectly fine!. If I remember correctly?, my tutorials tend to use 18K, but only because I had a pile of 18K resistors.
 
1M? Wow, I thought that would be way too high. I have a bunch of those too!

I ordered two 1/4 watt resistor grab bags from Jameco. I figured I would get mostly standared values. I got more 50 some odd ohm resistors then I know what to do with. And what the heck do you do with a 2:eek:hm: 1/4 watt?
 
Andy1845c said:
And what the heck do you do with a 2:eek:hm: 1/4 watt?
They make great low current sensing shunts.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top