On 4/26/07, Phillip wrote: > So I've got a project where I need to replace a small sensor that outputs a > 50Hz frequency with a PWM duty cycle of 30-70%. I have designed the circuit > in analog components, but it would be cheaper and (I think) much easier to > do it with a PIC. My problem is just finding some kind of information on > where to even begin. I've found quite a few examples of PWM, obviously, but > the detail is the frequency. Is it possible to specify (for lack of better > words) a specific frequency for the PIC to output? Can the PIC (speficially > the 12F629) combine the frequency with PWM? > > I figure this must either be really easy or really hard... If anyone can > help me out, I'd be in your debt. :) I don't know how hard your choice for the 12F629 is, but I would use a 12F683 with built-in hardware PWM. Very easy to program. On the PIC-page of my site you can find some examples (dimmers) written in C. http://www;robh.nl/picsoft.php. Regards, Rob. -- Rob Hamerling, Vianen NL (http://www.robh.nl/) -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist