PDA

View Full Version : Question about Option_Reg



financecatalyst
- 15th November 2009, 20:45
Hi, I would like to ask something about option_reg:-

If I want to make a system where PIC does somthing upon a switch press. A correct statement would be (Considering the use of OPTION_REG):

A) Enable the PULL UP or PULL DOWN and connect the switch between Gnd and the PIC pin or the other way around.

B) It does not work when pins are made as inputs so connect external resistance to GND. The switch between VCC and PIC pin or other way around?

I did try to find this answer in datasheet but unfortunately either I missed it or it's not there. Thanks for your help.

aratti
- 15th November 2009, 20:58
Only bit 7 of OPTION_REG control the weak pullup on portB and only on portB.

When :

OPTION_REG.7 = 0 the weak pullup are set

OPTION_REG.7 = 1 the weak pullup are removed

Naturally the pullup apply only if portB is an input, otherwise if is set as an OUTPUT, you don't need any pullup.

If you need a pulldown situation, on portB, then you set OPTION_REG.7 = 1 and you connect external resistors from pins to ground.

Al.

financecatalyst
- 15th November 2009, 21:06
Thanks Aratti......But is it a reliable way to do it? On one side it's great that I save space on my PCB. Has any of your projects caused any problems or unreliable operation due to internal PULL up or Pull down?