Hi Hank,
I don't think you need to resort to assembly. As I'm typing this I'm looking at scope displaying a fairly nice looking 5kHz sinewave and I'm using the 32bit accumulator code I posted earlier - all PBP and running at 8Mhz. But yes, it does get attenuated quite a bit, at 5kHz I'm looking at around 2Vp-p I think the problem in your case is the PWM carrier frequency is to low compared to the desired output frequency and I don't see how assembly will helå there. Yes, it does get attenuated, I'm looking at~4.7Vp-p at ~1kHz but only around 2V at 5kHz. My guess is that it would increase a bit if the oscillator speed is increased so I can "hit" more entries in the lookup table. An assembly routine will likely run slightly faster allowing to "hit" even more entries but I don't think it's going to make THAT much difference.
Anyway, quite fun this, I actually didn't think it was going to work this good.
/Henrik.




Bookmarks