Hank, before you go to far let me just get some clarity for those who are a little slow at time (me). If we break this down just a little and start slow is this correct: (back to pwm)
Across 1 cycle you need to generate different duty cycle waves for each angle of the wave?
So if you chop the wave into 255 steps(prolly too many at higher freq), each step will have a unique duty cycle. (in practice they may not all be unique at high freq)
The amount of time that duty is output depends on the duration of the step, which is determined by the desired freq.
Is this correct so far?
Assuming so, seems to me you just have nested for loop structure here. If the only job of the pic isto spit out this wave, maybe doing it as a loonnnggg program with each step coded separately will work better then the interrupt. So in essence expand the lookup table to be the next for loop in the program.
To test all of this I would just deal with the 5k freq as the slow end seems pretty easy.
I really hope that all made sense
Bookmarks