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.
Bookmarks