I'm trying to produce two pwm streams from a single 12F683 chip.

The first is fairly easy, a 20khz (25 or 50%) duty cycle for which i can use the chip pwm pin and module.

The second is much slower 2khz variable between 10-90% duty.

I'll need to use a simple high/low on a standard output pin and then some timming and/interrupts to maintain the second pwm output whilst the program services the rest of it's duties.

Can anyone offer an example or some ideas please?

The rest of the program is very simple, a few high/low outputs and one ADC input (joystick) which will be used to vary the 2khz pwm duty cycle.

The adc etc only needs checking say every 1/10th of a second so most of the chip time can be dedicated to the 2khz pwm.

I could use a second 12F683 and have done in the past but wan't to try and cram it all onto a single chip.