Introduction
Author: Victor Berzan, Microchip Technology Inc. |
The Digital-to-Analog Converter (DAC) converts a digital value written to the Data (DAC.DATA) register to an analog voltage. The output can be connected to a physical pin or used internally. The conversion range is between GND and the selected internal voltage reference (VREF), provided by the Voltage Reference (VREF) peripheral module.
- Generating Constant Analog Signal:
Illustrates how to initialize the DAC, set the voltage reference, set the DAC to output a specific constant voltage
- Generating Sine Wave Signal:
Initializes the DAC, sets the voltage reference, updates the DAC output inside the infinite loop to generate sine wave samples.
- Reading
the DAC Internally with the ADC:
Shows how to initialize the DAC and ADC, set the voltage reference, configure the ADC to read the DAC output values. The DAC output voltage is incremented each step, and then it is read using the ADC.
- Using DAC
as Negative Input for AC:
Initializes the DAC and AC, configures the AC to use the negative input provided by the DAC, configures the DAC output value. The AC will compare the voltage on its positive input pin with the DAC voltage, and set the output pin to high or low, according to the compare result.