PDA

View Full Version : OPTION_REG.7=0…… Or does it ?



andybarrett1
- 12th March 2015, 21:52
Hi all

Am using a 16f818 in a simple program …all is working BUT :-

OPTION_REG.7=0 ' Enables all pull-ups on PORTB

Question is What happens if only PORTB 0-3 are inputs and 4-7 are outputs….I thought I had seen a way of enabling . disabling some pins if this was the case…..

OR Does telling PBP that pin 4-7 are outputs do it for me ???

My program is working fine….. Just wondering !

Thank you for reading

Andy

Archangel
- 12th March 2015, 22:17
0 = PORTB pull-ups are enabled by individual port latch values - inputs only get pullups

BTW OPTION_REG.7=0 Decimal point got lost in post, I will fix in your post, check your code

towlerg
- 12th March 2015, 22:18
Selecting a gpio as output automatically disables the weak pull-up. Several peripherals do the same.

George

andybarrett1
- 12th March 2015, 22:26
Selecting a gpio as output automatically disables the weak pull-up. Several peripherals do the same.

George

Is what I thought….

Just needed to confirm…. Thank you

Andy