what is the problem if the PIC16F877A don't provide an output? and it cant read input..
when I tried to load this to my friends PIC it works properly but in my PIC, it wont provide an output? whats wrong?
when I tried to load this to my friends PIC it works properly but in my PIC, it wont provide an output? whats wrong?
Code:
void main()
{
unsigned int adc_val; //hold adc value
init_LEDS();
init_ADC();
PORTB = 0X00;
start:
adc_val = read_ADC();
DelayMs(40);
if(adc_val < 573)
{
RB6 = 0;
RB5 = 1;
}
if(adc_val >=573 && adc_val <= 860)
{
RB6 = 1;
RB5 = 0;
}
if(adc_val >=880)
{
RB6 = 1;
RB5 = 1;
}
DelayMs(20);
goto start;
}
Last edited: