sarathsnairpoonjar
Member level 2
- Joined
- Nov 12, 2012
- Messages
- 50
- Helped
- 2
- Reputation
- 4
- Reaction score
- 2
- Trophy points
- 1,288
- Location
- Cochin,Kerala,India
- Activity points
- 1,560
i am using pic 16f873a and mikroc
i want to make us of pic's inbuilt comparator
code is given below...
void main() {
delay_ms(100);
ADCON1=0x00;// making all pins analog
CMCON=0x01;// one independent comparator mode
TRISA=0x29 //A0,A3,A5 as input pins
TRISA4_bit=0;//A4 comparator output
TRISC4_bit=0;
RC4_bit=0;
RC4_bit=1;//to make sure pic is working...
while(1);
}
is there any problem with above configuration
i want to make us of pic's inbuilt comparator
code is given below...
void main() {
delay_ms(100);
ADCON1=0x00;// making all pins analog
CMCON=0x01;// one independent comparator mode
TRISA=0x29 //A0,A3,A5 as input pins
TRISA4_bit=0;//A4 comparator output
TRISC4_bit=0;
RC4_bit=0;
RC4_bit=1;//to make sure pic is working...
while(1);
}
is there any problem with above configuration