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
Earn your degree in as few as 2 years - Advance your career with an AS, BS, MS degree - College-Finder.net.
Fed Lowers Rates Again - Think you pay you much for your mortgage? No SSN Required - Estimate New Payment.
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___
No comments:
Post a Comment