Here is a modified version of Kurts code that only requires one interrupt(using my method described above).
Code:
ONINTERRUPT TIMERVINT_OVF, HandleTimerV_OVF
enable
LOW P10
; Initialize the timer
TCRV0 = 2
TCRV1 = 1 ; clock / 32
Main:
gosub setPWMDuty[64]
pause 100
gosub setPWMDuty[0]
pause 100
gosub setPWMDuty[128]
pause 100
gosub setPWMDuty[0]
pause 100
gosub setPWMDuty[192]
pause 100
gosub setPWMDuty[0]
pause 100
gosub setPWMDuty[256]
pause 100
goto main
Acc var word
Duty var word
SetPWMDuty[Duty]:
if Duty >= 256 then
; If duty is 100% just turn on pin, no need for interrupt
disable TIMERVINT_OVF
HIGH P10
elseif Duty = 0 ; likewise for 0 except simply turn off
disable TIMERVINT_OVF
LOW P10
else
enable TIMERVINT_OVF
endif
return
HandleTimerV_OVF:
Acc = Acc + Duty
if(Acc.bit8)then
High P10
Acc.bit8=0
else
Low P10
endif
resume
This produces a dirty PWM. Eg it doesn't produce clean high side/low side PWM pulses. This will produce a varying Period as the duty changes. But for dirving LEDs(no filtering required) or producing a variable voltage output(with added filtering) this works very well assuming my code doesn't have any typos.