BTW Philip, I did realise you've got 12F629 and suggested other methods as PICs are very easily sampled from Microchip (do it) If you're going to do this with the 12F629, which has no PWM and no ADC, start with the basic 50Hz timing. You may use the internal 4MHz (not terrifically stable) or a crystal. 4MHz will give you 1us instruction time, which is the potential resolution 50Hz = 20ms per cycle = 16-bit timer loading of 10000. An IRQ using this will give you the start point of each cycle What you have to do during each cycle is determine what period the outpin pin will be high, and what period it will be low. How you do this depends on what resolution you want. If you want 30:70, then you'll need to put the pin high at the IRQ, count 3000 IC and then send the pin low until the next IRQ, 7000 IC later. That 3000 could be counted using TMR0 or hard-coded loops and a table or variables Send money, women, to ..... -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist