Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx

Discussion Groups

Discussion Groups | Piclist | Help cant get a WPU to work on pic12f629

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.

Help cant get a WPU to work on pic12f629 - wibbley - Dec 13 15:28:40 2007


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 )