PDA

View Full Version : RB6 and RB7 as inputs on an 16F877a?



modifyit
- 28th July 2005, 03:39
How should I connect a momentary switch to RB6 and RB7 so I can use them as extra inputs without comprimising the ability of in circuit programing.

Thanks for any help, I think I saw Melanie post about this awhile ago, but I could not find the post.

muddy0409
- 28th July 2005, 04:10
The simplest way, that I use on all my PCBs is a selector slide switch, DPDT and switch the lines to the input stuff in one position and the programmer connection in the other direction. Works fine, just don't forget to switch back to "RUN" when finished programming.

Bruce
- 28th July 2005, 04:11
I normally use a switch like in this schematic http://www.rentron.com/Micro-Bot/Schematic.htm

modifyit
- 28th July 2005, 04:18
While both of those methods would work well, I seem to remember Melanie having a simple method of connecting a momentary switch using a pull-up or pull-down resistor that would make it automatic. All I need to use RB6 and RB7 for is as an input for two switches.

Melanie
- 28th July 2005, 07:06
It could be half-way down this thread...

http://www.picbasic.co.uk/forum/showthread.php?t=516

modifyit
- 28th July 2005, 13:52
It could be half-way down this thread...

http://www.picbasic.co.uk/forum/showthread.php?t=516

Thanks, that must have been where I saw it. So basically set internal pull-ups on the chip and then take RB6/7 to ground through the normally open switch?

I've got other pins on portB turning on/off leds and I read on the datasheet that when portB is set as an output that the internal pull-ups are automatically turned off. If this is the case can I turn the pull-ups back on and still use half the pins as outputs and half as inputs?

Thanks