Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top