1.2 DAC
The Digital-to-Analog Converter (DAC) can be used to convert digital input values to an analog output. The DAC uses a reference voltage and outputs a corresponding fraction of that voltage, which is determined by the value loaded into the DACxDAT register.
The resolution of a DAC is determined by the number of bits in the input code and can be calculated using the following formula:
This application uses the 8-bit DAC on the PIC18F47Q43, which at 5V, gives a resolution of 20 mV. The output of a DAC with a given input code is typically defined using the following formula: