Just started to us the 12F683 and I have searched the forum and the datasheet but can't get the pull-ups working on the input of the attached program!
If I ground the input (GP5) the program behaves as expected rapid LED flashing. If I connect the input to 5v I again get the LED to flash with the longer flash. But disconnecting the input (floating) from either state does not change the flash sequence.
I suspect (hope!) it is something simple but can’t see it!
************************************************** *
@ DEVICE pic12F683, INTRC_OSC_NOCLKOUT
@ DEVICE pic12F683, WDT_OFF
@ DEVICE pic12F683, PWRT_ON
@ DEVICE pic12F683, BOD_ON
@ DEVICE pic12F683, MCLR_OFF
@ DEVICE pic12F683, IESO_OFF
@ DEVICE pic12F683, FCMEN_OFF
@ DEVICE pic12F683, CPD_OFF
@ DEVICE pic12F683, PROTECT_OFF
OSCCON = $60 'sets the oscillator speed
DEFINE OSC 4 'Oscillator speed in MHz
CMCON0 = 7 ' Comparators off
ANSEL=0
TRISIO=%01011
VRCON=0
WPU=%00110111 ' Pull-ups on
OPTION_REG.7=0 ' Enable internal pull-ups
LED VAR GPIO.2
LEVEL VAR GPIO.5
st:
LED =1
PAUSE 200
LED =0
PAUSE 200
IF LEVEL=1 THEN ST
LED =1
PAUSE 1000
LED =0
PAUSE 200
GOTO st
END
***************************************
Thanks,
Bob
Bookmarks