I've done something similar, (but with a little less accuracy) by rectifying the output of the transformer and just doing a straight average of the ADC then translating back with a fixed multiplier. Works o.k. as long as there's no other load on the transformer. You'll get better results if you calibrate this (it's difficult to depend on the repeatability of the turns ratio of the transformer for a 1% accuracy). hth, Tony Dario Greggio wrote: > I am to use a 24FJxxGA106 to (along other things) measure 220V mains > voltage with some coarse accuracy, say 1-2% > > I have a small 220->6V transformer, whose inputs goes via a partitor > (still have to decide, but let's assume it 4K7 - 2K2) to AN2 of the PIC. > So, more or less 2Vrms or 3Vpp circa when mains is nominal 220V. > > I'm planning on sampling/reading the input voltage some ... 100? times / > second, and perform a ... FFT or something simpler upon it. > > Can you suggest the simplest way to achieve that result? > > TIA > > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist