KVN1477
Junior Member level 3
hi all,
i have written simple code to check comparator output, but nothing is happening
i have used micro c pro for pic for writing program
i have disabled PORTB A to D conversion in config bit settings. here is my program
plz help
i have written simple code to check comparator output, but nothing is happening
i have used micro c pro for pic for writing program
i have disabled PORTB A to D conversion in config bit settings. here is my program
HTML:
void main()
{
osccon=0x7c; // select 8Mhz internal oscillator
//CONFIG6H.bit1=0;
//adcon1=0x07;
//porta=0x00;
//trisa=0x0f;
portb=0;
trisb=0;
CMCON=0x02; //two independent comparator
CVRCON=0x00; // desiable internal ref vtg
delay_ms(50);
while(1)
{
if(CMCON.c1out==1)
{portb.f4==1;}
else
{portb.f4==0;}
}
}