PDA

View Full Version : switch on 1 weak pullup on portb?



peterdeco1
- 4th December 2008, 11:26
Hello Everyone. Is there a way to switch on a weak pullup on just one port on a 16F73? I know how to do it on the 12F series and I know OPTION_REG.7=0 will switch on all of them on portb, but I only want portb.1 to have a weak pullup. Thank you.

mackrackit
- 4th December 2008, 23:39
From the datasheet.


Each of the PORTB pins has a weak internal pull-up. A
single control bit can turn on all the pull-ups. This is performed
by clearing bit RBPU (OPTION_REG<7>). The
weak pull-up is automatically turned off when the port
pin is configured as an output.

And


2: To enable weak pull-ups, set the appropriate TRIS
bit(s) and clear the RBPU bit (OPTION_REG<7>).

But I bet you want the other pins to be inputs also?

peterdeco1
- 5th December 2008, 17:29
Actually, I'm switching the other portb's back & forth from outputs back to inputs in different areas of the program. I don't believe you can turn the pullups on individually. It's all or none.

mackrackit
- 5th December 2008, 17:41
Depending on what you are out putting to, an external pull up might be the best solution. Use a high value.

RussMartin
- 5th December 2008, 18:32
Depending on what you are out putting to, an external pull up might be the best solution. Use a high value.

For a weak pull-up, I'd suggest 100K. Otherwise, I'd use 10K.