Hi i am using pic16f676 for a cyclic timer. I am coding in MikroC. Attaching the code below. Proteas simulation is giving out errors.Help me out please
Code:
unsigned long int x,k;
void main()
{
ADCON1=0x80;
TRISA=0xFF;
TRISC=0x00;
do {
x = ADC_Read(0);
k=(x/4);
if(0<k && k<128)
{
PORTC.F5=1;
Delay_Ms(1000);
PORTB.F5=0;
Delay_Ms(1000);
}
if(128<k && k<255)
{
PORTB.F5=1;
Delay_Ms(3000);
PORTB.F5=0;
Delay_Ms(3000);
}
} while(1);
}
Unless you specify properly what errors are happening, will not be able to get any effective help. Anyway, taking an overview at code posted above, some lines seems a little strange, such that: