OK, so now i have had time to investigate all the information you've given me. You have already helped me a lot to grasp the basic concepts.
Let's see if I've understood correctly:
-
timer2 is set to PWM mode. Its only function is to act as a DAC, the output voltage is controlled by the duty cycle set by OCR2. I presume were talking fast PWM mode ?
-
prescaler is set to clk/256 to get 62,5 kHz, this is just a matter of convenience (0xff = 100% duty).
-
since I'm using TCCR2B, Arduino pin 11 is the output pin (as is required)
-
phase accumulator is 16-bit, incremented with a 8-bit increment, so that I can get sub-60Hz frequencies
-
I put the phase accumulator increment in the TVout hbi_hook. I take the MSB of the phacc and put it in OCR2 ie. PWM duty
-
Alternatively I use the phacc as a pointer to a 8-bit table of values that define the waveform.
That it ?
Cheers !