It sure sounds as though you're controlling a servo ;-) I'm using TMR1 to do this. It generates the 17ms interupt. On interupt, it begins counting down a variable and setting the output bits controlling four servos. This takes 1ms. Then it sets up a 1 ms interupt and processes the main code loop in the meantime. After this 1ms delay, the servo control bits are set low and TMR1 is set to generate an interupt in 17ms. I know that this isn't what you want but I couldn't think of a way to use the PWM generator that was any easier. Let me know if you'de like my code. Andrew akieran_at_ureach.com ________________________________________________ Get your own "800" number Voicemail, fax, email, and a lot more http://www.ureach.com/reg/tag ---- On , Robert B. (piclist@NERDULATOR.NET) wrote: > I need a PWM signal with the following specifications (from the > manufacturer): period 17ms, minimum duty 1ms, maximum duty 2ms. > > I'm using a PIC16F873A on this project, and would really really really like > to generate the PWM in hardware. Reading the chip's datasheet implies that > the slowest PWM signal on the CCP1/2 is 1.2kHz (about 20x too fast). Are > there any clever tricks that can slow it down to about a 17ms period? All > the timers and interrupts are free for use, but like I said if there's a way > to get the PWM module to do it that would be ideal. If all else fails I can > cobble together an interrupt to do it, but the code is fairly time critical > so it would need to be really quick. > > Thanks! > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics