A lot of microcontrollers have an onboard digital to analog converters (DAC). Generally the resolution is in the 8 to 10 bit range. The total harmonic distortion (THD) is around 1%. Using a cap filter on a square wave output will take up 2 i/o pins. One output is used to for the filter input, and the other is a filter clock. Both are square waves and track at 100:1 ratio. The microcontroller has to handle the wave generation, although it can be done, I find that offloading the task to a dedicated circuit frees up time and gives a better result.
Here is an external approach I found that gives a 0.2% distortion sine wave.
Use a RDD104 (selectable four-decade CMOS divider) and a MSFS5 (switchable seventh order low pass/six pole bandpass capacitor filter).
The RDD104 has 2 pins that select four dividers: /10, /100, /1000, and /10k. The whole circuit is either driven by a external clock signal or a crystal. (a crystal is in the example) The output is a 10kHz, 1-V rms sine-wave output. Current consumption is 2mA @ 5V. Output frequency range is 400Hz to 300kHz.
Although this is my solution, is there an easier option? Simpler option? My goal is to offload the sine wave from my microcontroller. Imagine having to drive a 4MHz PIC to do operations while also outputting a sine wave.
Latch