Tuesday, December 4, 2007

[piclist] Help cant get a WPU to work on pic12f629

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
Recent Activity
Visit Your Group
Yahoo! News

Get it all here

Breaking news to

entertainment news

Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Moderator Central

Get answers to

your questions about

running Y! Groups.

.

__,_._,___

No comments: