Frank, thank you so much. I edited the *.cpp and I'm running your test sketch. It worked right of the bat. I don't know what I did wrong on Saturday, must have been a coding error, I use the same hardware as before.
Have a look:
This is the output waveform without any external circuitry apart from
47nF across the rail, powered from Vusb. Note that the scope applies averaging and due to trigger jitter the waveform is a bit distorted. In reality the waveform is even more "stepped" and slews between individual voltage levels in about 400ns, holding the voltage very stable for the rest of the sample time. So in conclusion,
there is no output filtering at all in the DAC.
Also interesting: with the sketch you provided (amplitude=0.9) I get a signal of about 920mV peak-peak, which means
barely over 1V full-scale. From the datasheet I expected more than double the amplitude. Any idea?
This is an FFT (done with the scope, so no high precision measurement, but the DAC is bad enough to have it's flaws exposed even with that...)
The leftmost peak is what we want, at 1 kHz. Scaling is 10dB per division, so the
lower harmonics are about 50db below the signal. Bad, very bad, but what do we expect for 25 cent... Notice the horrendous amount of nyquist errors mirroring around the sample frequency to the right of the spectrum, 1kHz before and after 44.1kHz. I placed the scopes cursor on one of those peaks in the third picture. I also did a FFT up to several MHz and I can see signals up to about 2MHz.
Conclusion:
We definitely need a reconstruction filter, and I'd say we go with butterworth instead of the more "audiophile" bessel to get those nyquist images as low as possible and because any attempt to treat this signal with care is a waste of time and effort.
I'll do some tests regarding the DACs sensitivity to power quality and 5V vs. 3V3 operation later this week, and I'll cobble together some filtering on the output to see what passive filtering can do.