http://ww1.microchip.com/downloads/e...f684%20data%22
the link above will get you the data sheet, the code below is copied from the data sheet page 33 I believe it is what you need, I would add that input pin appears to require a pullup resistor too.
ASM
BCF STATUS,RP0 ; BANK 0
CLRF PORTA ;Init PORTA
MOVLW 07H ; Set RA >2:0> to
MOVWF CMCON0 ;Digital I/O
BSF STATUS, RP0 ;Bank 1
CLRF ANSEL ;Digital I/O
MOVLW 0Ch ;Set RA<3:2> as inputs
MOVWF TRISA ; and set RA<5:4,1:0>
BCF STATUS,RP0 ;Bank 0
ENDASM
if this turns out to be wrong, keep this in mind,
I did all the typing for you
JS
More lost than many . . too dumb to know it, too darn old to care.
Bookmarks