Hello folks, I have a PIC10F206 Im working with here. It is connected to 3 LED's on GP0 GP1 GP2, and a push button switch that shorts to ground on GP3. GP0 does nothing, GP1 and GP2 are supposed to start blinking when the button is pushed. I'm having some trouble with the setup. It appears that GP2 is using the TOCKI option somehow, although I believe I have that disabled by setting bit 5 in the option to 0. When I push the button, GP1 starts blinking too, So I know that the program is functioning, Im just having a hard time with setup. How do I shut of TOCKI and make GP2 an output? Thanks in advance.
;
;
#include P10F206.INC ; standard Microchip register names definitions
#include header.inc ; standard header stuff including OSCCAL save and GOTO MAIN
__config (_MCLRE_OFF & _CP_OFF & _WDT_OFF & _IntRC_OSC )
dly0.5msec ; 0.5msec delay
MOVLW D'100'
MOVWF DDY0
dl0.5_0
DECFSZ DDY1, 1
GOTO dl100_0
DECFSZ DDY0, 1
GOTO dl100_1
RETLW 0
dly100msec ; 100msec delay accomplished by just idling in a loop
MOVLW D'130'
MOVWF DDY0 ; load the outer loop delay
dl100_1
MOVLW D'255'
MOVWF DDY1 ; load the inner loop delay
dl100_0
DECFSZ DDY1, 1
GOTO dl100_0
DECFSZ DDY0, 1
GOTO dl100_1
RETLW 0
MAIN ; here we start the main program with some setup stuff
MOVLW B'00001111'
OPTION ; set up WDT with a long prescale; wakeup on pin change
MOVLW B'11110111'
MOVWF CMCON0 ; set up comparator controls so they don't get in the wayo they don't get in the way
MOVLW B'00001001' ; Tris controls
TRIS GPIO
;***************************************************************************
; here we really get started on the program
buttonstate
CALL dly100msec ; wait for button-bounce
BTFSS GPIO, 3 ; check if button is high, if so skip the next step
step_loop
BSF GPIO, 1 ; Set GPIO,1 high
BSF GPIO, 2 ; Set GPIO,2 high
CALL dly0.5msec ; wait for 0.5msec
BCF GPIO, 1 ; Set GPIO,1 low
BCF GPIO, 2 ; Set GPIO,2 low
GOTO MAIN
END