On 4/25/07, Jinx wrote: > > BTW Philip, I did realise you've got 12F629 and suggested other > methods as PICs are very easily sampled from Microchip (do it) See, these are exactly the kind of suggestions I need! :) 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 I've already run into some odd timing issues with the simple LED flashers I've made. 1000 miliseconds seems suspiciously more like 1500-2000. Are the internal crystals on these chips hugely affected by the input voltage? 50Hz = 20ms per cycle = 16-bit timer loading of 10000. An IRQ > using this will give you the start point of each cycle I don't understand this at all, but i'm guessing it's just not being familiar enough with the language yet. At least I now know what to search for. :) 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 Ok, I ran into one little comment on a random page that was explaining something similar. I'm trying to wrap my brain around what you're saying. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist