Seems that internal pull up resistors not working?
Simple code to work with. I am using GPIO.5 as input as digital. The LED still blinks from GPIO.2. The internal pull up dont work as expected to keep input low. Am I missing something?
CODE:
Include "bs2defs.bas"
@ DEVICE PIC12F683,MCLR_OFF,INTRC_OSC_NOCLKOUT,WDT_OFF,BOD_ ON, PWRT_ON
A var word
OSCCON = %01100000 ' Internal 4MHz osc
ADCON0 = 0 ' A/D off
CMCON0 = 7 ' Comparators off
ANSEL = 0 ' Set all digital
WPU = %00110111 '0 ' Internal pull-ups = off ISSUE?????? Register 4.3
OPTION_REG.7=0 'Enable internal pull-ups
TRISIO = %100000 'set GPIO.5 as input, rest output
test var GPIO.5 'Input
START:
LOW 2
PAUSE 100
if test = 1 then high 2:PAUSE 1000
goto START
The LED still flashes. it should not be flashing unless input is triggered from +5 volt.
Bookmarks