On Thu, 9 Aug 2001, Alan B. Pearce wrote: > >Based on this, I simply don't understand the F84 fixation. > > because from an earlier reply to one I suggested the 16F627/8 he already has > a number of them. > > The way to do it without having the CCP is to use the INTR input to start > the timer on the rising edge of the waveform, change the edge sensitivity to > falling edge, on the next interrupt save the timer count and set the edge > sensitivity back to rising edge. Initialise the timer ready to start > counting again on the next interrupt. The value you have saved is the pulse > width. If you want a software PWM routine that has single instruction cycle resolution then check out: http://www.dattalo.com/technical/software/pic/pwm256.txt It can be configured for pulses 256 or 4096 cycles wide. It works. I've used and others have used it too. I suppose one could convert it into a servo controller. But special care must be taken to ensure the code is isochronous. Scott -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu