Dwayne Reid ha scritto: > This routine runs in my background task which executes every 1.024ms. Hello Dwayne, sorry for not replying earlier :) I've been making up the board - almost fine now - and hence moved to the measurer. I took your code and made it into C: if(!BusyADC10()) { // non deve succedere ADC_220_sample=ReadADC10(0); } ConvertADC10(); ADC_220_old_sample=ADC_220_sum/(1000/50); // freq. sampl ADC_220_sum-=ADC_220_old_sample; ADC_220_sum+=ADC_220_sample; // ADC_220_old_sample=ADC_220_sample; if(!(cnt % 50)) { ADC_220=ADC_220_sum; // ADC_220_sum=0; } It's called every 1mS and every 20 I take the result. It's not working so far, but will see :) thank you! -- Ciao, Dario -- Cyberdyne -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist