PIC12F675 ADC not working properly
The ADC is only returning the least significant bits with return ADRESL;.
So, if the pot was in such position the returned ADC value was 0b011, "increasing the pot" will return 0b000 as next step.



You should either return ADRESH; or set ADCON0 = 0b**1**0000001; or change freq to an unsigned int and return (ADRESH&lt;8) &amp; ADRESL