A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.
Hi all, I have been pulling my hair out trying to enable a WPU in a
12F629. The pin detects an input if i put 5V on it, but shows as
clear when not. If a WPU was set, it should show an input (bit set)
when nothing is on the pin and clear when grounded. Isn't that right?
I have set GP0 as my input and enabled the WPU. Any help appreciated.
START
BCF STATUS,RP0
CLRF GPIO
MOVLW 7H
MOVWF CMCON
BSF STATUS,RP0
MOVLW B'00000010'
MOVWF OPTION_R
MOVLW B'00001001'
MOVWF TRISIO
CALL H'03FF'
MOVWF OSCCAL
MOVLW B'00000001'
MOVWF WPU
BCF STATUS,RP0
;***************************************************************
BEGIN ;WINK THE LIGHTS TO SHOW PROGRAM START
BSF GPIO,GP2
CALL DELAYP5
BCF GPIO,GP2
BSF GPIO,GP5
CALL DELAYP5
BCF GPIO,GP5
CALL DELAYP5
GPTEST BTFSC GPIO,GP0
GOTO GPSET
BSF GPIO,GP4 ;GET HERE AS GP0 CLEAR
BSF GPIO,GP1
CALL DELAY1 ;my 1 second delay routine
BCF GPIO,GP4
BCF GPIO,GP1
GOTO GPTEST
GPSET BSF GPIO, GP2 ;GET HERE AS GP0 SET
BSF GPIO,GP5
CALL DELAY1
BCF GPIO,GP2
BCF GPIO,GP5
GOTO GPTEST
END
to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )