Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
The ADC interrupt only fires when an ADC has completed. You need to read your pot at a regular interval using a timer interrupt.
Alternatively, check out the Special event trigger mode of the PWM module. On earlier pics you could use it to automatically start the ADC conversion and an interrupt would be generated when it completed.
This feature seems to have been removed from the latest chips.
Setup timer 1 to count at a suitable speed - say 1uS per tick.
Setup PWM as Special event with CCP1L and CCP1H equal to the event time - 20,000 will make it happen every 20mS.
Setup the ADC to read your potentiometer - select the channel and turn it on - no acquisition time.
Setup the ADC interrupt.
In the ISR read the ADC result and use it.
Only the ADC interrupt should be turned on.