Mackrackit,

From what I understand your code will do a PWM every time TMR0 overflows.

What I need to do is make this overflow happen every 20ms. That is 50 pulses per second. We have a 4 meg oscillator. If I were designing this counter I think I would have it set to 20,000 each time it overflows. I gather from page 74 of the Data Sheet that this is not possible. The biggest prescaler is 256.

How about a routine that counts these interrupts until 1/50 of a second has elapsed then calls PWM? I would have it send one pulse out pin 1 with the duty as defined by "duty". It would look like

PWM 1,duty,1

I have found a section on Timers in a book called Running Small Motors with PIC Microcontrollers that has an example of MicroEngineering Labs code that makes an eight digit LCD display the time in hours, minutes and seconds. I think this code must do something like I need.

Ken