1.2 Digital-to-Analog Conversion (DAC)

The Digital-to-Analog Converter (DAC) peripheral can be used to convert the digitally stored values to an analog output. By setting the voltage reference correctly to define maximum output value and use a timer to replicate sampling frequency as output frequency, the original signal is reconstructed. Each sample is held on the output for one output period (corresponding to the time in between the samples being taken). The example signal will look similar to the one shown in Figure 1-5.
Figure 1-5. Reconstructed Signal
The output filter smoothens the signal from the DAC. In the example used, the output signal will end up similar to Figure 1-6. The signal is very similar to the original analog input signal except for the error from quantization, which is significant in the example displayed since the 3-bit samples have only eight possible values.
Figure 1-6. Output Signal After Filtering