Hi guys I have made a switch mode battery charger and am trying to monitor some parameters like voltage, current and temperature. The problem I am having is that whenever the PWM is running my A2D values are flying all over the place, I am taking the median of 16 each time but that isnt helping much. I can just shut down the PWM to get the voltage and temperature values, but would rather not. However this is impossible for the current reading (from a sense resistor) So I thought that synchronising the A2D readings with the beginning off the off part of the cycle would fix it, I used the code.... BTFSS PORTC,2 ; the PWM output goto $-1 BTFSC PORTC,2 goto $-1 BSF ADCON0, GO ; DO A2D conversion beginning of off period. However this doesn't help, infact it makes it much worse!? Now is what I am trying to do a sound concept? Perhaps someone who has experience with this problem can put me on the right track? Thanks Ed Cooper -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads