At 05:22 PM 5/27/2005 +0100, you wrote: >Hey, > >I know this is probably a bad idea, because it isn't always perfect at >timing, but I run my pwm routine inside my delay routine - I padded it >out with nops, to get it to the right length, and because my program >spends nearly all it's time in delays, there is only a few >instructions between the delays, meaning it's almost continuously >updating the pwm. I guess if it works well enough for your application, it wasn't such a bad idea after all.. ;-) This kind of thing works well if you can make it an "update" sort of thing rather than PWM, like RC servos- the pulse length is the signal rather than the average level of the signal. That would be easy to do in a delay routine as you describe. Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com ->> Inexpensive test equipment & parts http://search.ebay.com/_W0QQsassZspeff -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist