> You could just as well connect one leg to ground, and the divider between > the other leg and Vdd. > > > Sounds super easy, no body diodes at risk, no diode drops, > > minimum components, full cycle of waveform, ... > > No. =A0Go show us real component values and you'll find the flaw in your > topology. Yes. I understood the limitation with the voltage specified (as you might expect :-) ). My subsequent description didn't completely replicate the original - but I've now don't ahat below :-). Originally there was no mention of the "dimmer" afair and I gained the impression that the transformer voltage mentioned was semi-arbitrary could have a voltage output to suit. Not a good assumption in retrospect. As noted, adding one more resistor allows you to both scale and shift the waveform, allowing arbitrayy input voltage. You could even do it with main input and 3 resistors :-) :-) :-) :-) . As the early stuff hasn't been seen by some, here's how I originally described it (11 days ago now.) ______________ On March 10th j'escrit: How does a transformer and 2 resistors sound? If you wanted a relatively minimalist implementation you could connect one side of the secondary to a resistive divider across Vdd-Gnd and the other to a resistive divider to ground with the PIC A2C tapped off that. As long as Vpp < Vdd the output is always positive. In the limiting version of this you connect one side of transformer to Vdd and the output to a divider to ground and tap ADC input off the divider. ADC input is always positive. Total requirement =3D transformer + 2 resistors. Here Vpp must be less than 2 x Vdd and output divider ratio K such that (Vdd + Vpp/2) x k < Vdd The smallish downside is that the available measured voltage may be slightly less than in some other systems - BUT you lose the non linearity / offset introduced if diodes are used, notionally* need no clamp diodes etc. * Here mains noise can appear at reduced V on PIC pin scaled by transformer ratio. Protecting against this may or may not be a good idea [tm] but is not a terrible one unless minimum parts count is absolutely crucial. Clamp Schottkys to each rail may be OK. Small cap on PIC pin may be all that is needed, noting phase delay and peak V reduction caused (both of which can be small). -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist