16F973A comparator is not working...

Status
Not open for further replies.

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
Visit site
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
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…