PICcoder.co.uk Forum  


::post new topic::
Help with 12F683 GP1 bit
Date: 2007/06/12 14:47 By: Randy Status: Visitor  
 
Hello all,

I am having trouble when trying to set GP1 as a digital input. After executing the code below, GP1 is high, if I toggle it to low it still goes back to a high.

; Begin
R0L EQU 0x20
R0H EQU 0x21
R1L EQU 0x22
R1H EQU 0x23
R2L EQU 0x24
R2H EQU 0x25
R3L EQU 0x26
R3H EQU 0x27
R4L EQU 0x28
R4H EQU 0x29
R5L EQU 0x2A
R5H EQU 0x2B
ORG 0x0000
BCF PCLATH,3
BCF PCLATH,4
GOTO L0002
ORG 0x0004
RETFIE
L0002:
; 1: Low CMCON1.1
BCF 0x1A,1

; 2: AllDigital
BSF STATUS,RP0
CLRF 0x1F
BCF STATUS,RP0
MOVLW 0x07
MOVWF 0x19

; 3: loop:
L0001:
; 4: Goto loop
GOTO L0001
; 5: End
L0003: GOTO L0003
; End of program
L0004: GOTO L0004
; End of listing
END

The last statement in the AllDigital section (MOVWF 0x19) causes GP1 to go high. Cany someone help with this?

Thanks,

Randy
reply | quote


      Topics Author Date
    thread link
Help with 12F683 GP1 bit
Randy 2007/06/12 14:47
    thread link
thread linkthread link Re:Help with 12F683 GP1 bit
dariog 2007/06/23 08:56
::post new topic::