i want help in a2d in mikroc
to program pic 16f877
program canot define the (ansel) code
void main() {
ANSEL = 0x04; // Configure AN2 pin as analog- errror here?
??
TRISA = 0xFF; // PORTA is input
ANSELH = 0; // Configure other AN pins as digital I/O
TRISC = 0x3F; // Pins RC7, RC6 are outputs
TRISB = 0; // PORTB is output
do {
temp_res = ADC_Read(2); // Get 10-bit results of AD conversion
PORTB = temp_res; // Send lower 8 bits to PORTB
PORTC = temp_res >> 2; // Send 2 most significant bits to RC7, RC6
} while(1);
}