It depends.
If you want a line-level output for headphones, recording, other audio systems, yes you should filter off the 45kHz PWM component. I would suggest the "3rd order Sallen-Key low-pass filter" from your filter design page as a starting point. It ought to provide a clean enough signal to prevent damage to anything downstream.
But if you want to re-record this signal you may need to clean it up further : you can add 2nd-order Sallen-Key stages to make a 5th or 7th order filter, but a nice alternative would be the "twin-T notch filter" on that site, with the notch at 45 kHz.
If you want power output, take the raw PWM signal to a half-bridge to form a Class-D amplifier. Then I would recommend the R-L-C lowpass filter from that site with R = 4 or 8 ohms : in reality, your loudspeaker.
I have answers for all your stated questions:
- Your circuit will not provide a varying voltage on the output by itself, just a varying current source. The actual voltage generated will depend highly on the impedance of the device connected to the output. You may want to fix this with an additional resistor to ground, and/or an opamp.
- Your circuit will likely allow serial communication, especially at slower rates like 19200 which I think are by default used by Arduino-style serial bootloaders. The 50 kOhm pull-up effect doesn't matter. The 1 kOhm resistance doesn't slow down too much.
- Your circuit is unlikely to burn or stress the Atmega or the serially connected device.
- I can think of three other ways, see below.
The first way would be to use a ICSP USB programmer to program the Atmega instead of serial programming, Arduino-style. This is more robust, faster, and avoids the problem entirely, and optimizes for BOM cost for the actual device (at the expense of requiring a few dollars of programmer hardware if you need to actually program it.) This can be implemented even on an Arduino board.
The second way is to run the Atmega328p on the internal RC oscillator, not using a crystal, and use port B instead of port D for the DDS output. This leaves the serial port entirely un-touched.
The third way is to write PORTB and PORTD one after the other, and use PORTB for the two bits that the serial port uses. This will generate a two-cycle glitch at about 4-8 Mhz. Given that you will need a low-pass filter anyway to generate any kind of smooth waveform, you simply need to lower the cut-off frequency of that filter to eliminate these glitches. To properly write the two ports in sequence, load the values into registers, disable interrupts, write the two ports, and re-enable interrupts.
Finally, you could use a small-signal diode (like 1N4148) instead of R17.
Best Answer
I think you're looking for a Flash ADC:
https://en.wikipedia.org/wiki/Flash_ADC
You can't use the same arrangement though. You need a lot more resistors.