8-bit PIC® MCU Digital-to-Analog Converter (DAC)

Last modified by Microchip on 2023/11/09 09:02

The Digital-to-Analog Converter (DAC) is a peripheral for taking digital data and producing a variable (i.e., analog) output level. The PIC® MCU output supplies a variable voltage reference that is ratiometric with the input source. The input source is spread across a resistor ladder within the device and the output of the ladder is controlled by the digital signal. This peripheral is built into many different PIC MCU devices. Some internal DACs have a 5-bit (32 levels) resolution and some have an 8-bit (256 levels) resolution. On some devices, you get both. In all cases, the limited output current drive capability will typically require a buffer to boost the output drive capability. The circuit below shows a typical example:

PIC MCU output, circuit example

Output Selections

The 5-bit DAC offers 32 levels of output while the 8-bit DAC offers 256 selectable output levels of resolution. Depending on the device, the output can be selected to connect to other peripherals within the device such as:

  • Comparator Positive Output
  • ADC Input Channel
  • Op-amp Positive Input
  • DAC1OUTx I/O pin

Input Selections

The input voltage can come from the following sources:

  • External VREF+ pin
  • Vdd Supply Voltage
  • Fixed Voltage Reference (FVR)

Ratiometric Output Level

The DAC output value is derived using a resistor ladder with each end of the ladder tied to a positive and negative voltage reference input source. If the voltage of either input source fluctuates, a similar fluctuation will result in the DAC output value.

DAC output value diagram