PDA

View Full Version : Options_reg



paul.mcallister
- 27th April 2006, 03:31
Hi, I am trying to use the OPTIONS_REG directive to turn on PortB pull up resistors for a 16F876 but I can't find reference to it in the PicPro manual.

Browsing the Pic data sheets sugests that this directive does other things as well.

Could some one give me the correct syntax for turning on the pull up resistors, and if possible where I can read about it in the PicPro manual

Thanks, Paul

paul borgmeier
- 27th April 2006, 03:44
See section 2.2.2.2 of the 16F876 data sheet (this is a must read)

Just add

OPTION_REG.7 = 0 'turns on weak pull-ups

or

OPTION_REG.7 = 1 ' turns off weak pull-ups


near the top of your code.

OPTION_REG is one of many Special Function Registers that can be accessed directly. Do not leave home without the PBP manual and the data sheet for your PIC!

Good Luck,

Paul Borgmeier
Salt Lake City, Utah
USA