Quote Originally Posted by skimask View Post
The 12F675 can run 4mhz on the internal clock. You should be able to easy incorporate the TMR0 interrupt and make a software PWM output that'll run at 3.9khz (which should be plenty high enough) and use the A/D input to set the duty cycle on that PWM. ... Are you familiar with doing software PWM based on interrupts?
I'd be interested to know how you could do that.
And since Malcolm was attempting to use MY software PWM routines based on interrupts, I guess you could say I'm familiar with them.

Let's see, 4 channels @ 3.9khz with 8-bit resolution.

That'll take (3900 *256) = 998,400 interrupts per second.
With a PIC running at 4mhz, it'll execute 1,000,000 intructions per second.
That leaves, 1.0016... instructions per interrupt.

You wouldn't have a code example for that would you?
<br>