Some input pins not working?

Status
Not open for further replies.

Thorpydo

New Member
Hey,
I have 4 input pins, pin0-pin3. The physical circuit is setup the same way for each pin but I can't use them interchangeably. Pins 2 and 3 work fine; 0 and 1 don't. I believe it's because the comparator could be set? Or something like that? I've looked through the datasheet but everything looks disabled. The only initilization I have is as follows:
bsf STATUS, RP0 ;changes banks
movlw b'00001111' ;0-4inputs 5,6outputs
movwf TRISIO ;setting input/output (1=input)
bcf STATUS, RP0 ;changes banks

movlw b'00000000' ;
movwf GPIO ;setting high/low (1=high)

Thanks
 
Yes, they're the comparator pins.

Add the following lines of code to the top of your program

BANKSEL CMCON
MOVLW .7
MOVWF CMCON
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…