Hello MY,
There are still some problems with your lookup table. Since you requre symmetry between the positive and negative half-cycles of the waveform, the table should have an even number of entries, possibly 32 (not 31), and the first entry should not be zero. There also seems to be some degree of asymmetry between positive and negative peak amplitudes.
For a 32 byte table, the following would seem to be a little more accurate for a sine shape -
tonetab:
fcb 128,148,166,184,199,211,220,226
fcb 228,226,220,211,199,184,166,148
fcb 128,108,90, 72, 57, 45, 36, 30
fcb 28, 30, 36, 45, 57, 72, 90,108
For the range of values you have selected, the TMOD value for the TPM module should be 228 ($00E4) minimum. Higher values will affect both output amplitude and sine frequency. The sine wave period will be 32 times the TPM overflow period.
For a TPM clock of 2.0 MHz, and a TMOD value of, say 255, the sine frequency should be about 244 Hz, and the PWM frequency 7.8 kHz. The low-pass filter cut-off frequency should be about 500 Hz, perhaps somewhat higher if a CR passive filter is used.
Regards,
Mac