I'm using a dsPIC30F4011 in my project with XC16, and I'm currently programming its ADC. But my question is also general:

Do I have to turn off and then back on the peripheral (ADC in this case) in every interrupt?

Here's my code:

void __attribute__((__interrupt__, auto_psv)) _ADCInterrupt(void) {
IFS0bits.ADIF = 0;   //turn interrupt flag off
}

• What led you to do that in code in the first place? – Matt Young Sep 18 '17 at 2:06
• I don't think //do stuff is adequate. Without seeing what the "stuff" is, no one is going to be able to give you an accurate answer. – D Krueger Sep 18 '17 at 2:12
• @MattYoung I'm using the ADC to cycle through every input read it automatically. When it finishes reading the last one, it fires this interrupt. – Iaka Noe Sep 18 '17 at 2:52
• @DKrueger It reads and saves all buffers in an array, to be used when needed. – Iaka Noe Sep 18 '17 at 2:53
• Let me rephrase my question. Why did you think you need disable and reenable the ADC? – Matt Young Sep 18 '17 at 2:55