Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

PIC16F887 ADC Channel 7 (AN7) on pin10 does not work

2 posters

Go down  Message [Page 1 of 1]

jaltiti



PIC16F887 ADC channel 7 (AN7) does not work. I randomly tried channel 0 (AN0), channel 6 (AN6) and channel 13 (AN13) all worked. I am not sure if all other channel would work. It would be wise to test all other channels when fixing channel 7. Below is the code with channel 7 selected and did not work. The code is written using mikroC PRO.

unsigned int adc_out_decimal;
void main()
{
 ANSEL = 0B10000000;
 ANSELH = 0x00;
 TRISE.RE2= 1;
 TRISB = 0x00;
 PORTB = 0x00;

 while(1)
 {
    adc_out_decimal =  ADC_Read(7);
    if (adc_out_decimal <= 512)
    {
       PORTB = 0x55;
    }
    else
    {
        PORTB = 0xAA;
    }
    delay_ms(50);
 }
}

arcachofo

arcachofo

Confirmed, there is a bug here.
It will be solved for next release.

Thanks for reporting.

jaltiti



Is this issue solved?

arcachofo

arcachofo

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum