16f887 portc input problems
Im having problems with my portc in this clock project. Portc is acting as if i had the button already pushed.portb had the same problem but it was fixed easy by switching the port to digital by using ANSELH=0. I dont know what portc is set to, analog or digital. I dont think you would need my code, but if you do just tell me and i will post it.
Re: 16f887 portc input problems
Let me guess, you are using PORTC.1 and/or PORTC.2 ?? The comparator will need dealt with.
Re: 16f887 portc input problems
Hi Dave,
This is a bit confusing, I thought that the comparator outputs was on RA4 and RA5 respectively. Looking at the device overview in the datasheet confirms this.
However, in the PortC section, under PortC.1 and PortC.2, which I believe is where you looked, it says Capture input and Compare/PWM output for Comparator C1.This LOOKS like a typo to me and THINK what they really mean is Compare/PWM output for CCP1 which i think makes more sense.Is the comparator outputs multpiplexed between RA4/5 and RC1/2 and where do you select that?
I've tried to see what could cause the OP's problem but I've failed to find anything on PortC that needs disabling in order to function as digital inputs. Weak pullups crossed my mind but there are none on PortC so that can't be it.
/Henrik.
Re: 16f887 portc input problems
Quote:
Originally Posted by
mackrackit
Let me guess, you are using PORTC.1 and/or PORTC.2 ?? The comparator will need dealt with.
I am using portc.4,5,6 and 7
Re: 16f887 portc input problems
Quote:
Originally Posted by
mackrackit
Let me guess, you are using PORTC.1 and/or PORTC.2 ?? The comparator will need dealt with.
I just disabled c1 and c2 comparators and it dident change any thing.
Re: 16f887 portc input problems
Code:
CLRF CCP1CON ;Turn CCP module off
CLRF CCP2CON ;Turn CCP module off
But those are supposed to be cleared on POR and those pins are not the question now.
Looks like we need to see your code and schematic...