Quote Originally Posted by CocaColaKid View Post
Oh, guess I missed posting all the relevant information.

16F88 @ 10MHz
Single 82Hz SPWM Channel
Single 1kHz HPWM Channel
Timer0 - Free, Timer1 - SPWM , Timer2 - HPWM
The 1kHz HPWM is being output on portb.3, it could be either portb.0 or portb.3
The porta.4/T0CKI can be made available for use, its just an input
Unfortunately the 82Hz is required, its the control signal for an ECM motor
There ya go. Now there's some room to play with.
But now you'll regret saying you want to do it yourself.

Since there's only 1 SPWM channel. I would recommend reverting the the original SSPWM program. It only uses 2 interrupts per cycle, 1 for the ON time, and 1 for the OFF time. But it would need to be modified to work at 82hz, since it currently runs at 100. And in the SSPWM routines, you can create a 1sec period for timing the input frequency's measurement.

Then by feeding the 0-1khz into Timer 0 (T0CKI), you should get a real good count/frequency that works in the background, unlike the COUNT command.