Digital to Analog Converter (DAC) Module - 8-bit MCU

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 off 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:


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 Project Example

The MPLAB® Code Configurator (MCC) makes it easy to setup the DAC for your specific device. Refer to the data sheet for your device for detail on the various DAC options as it can vary slightly from device to device.

Click here for a simple step by step example of using the MCC to create a DAC project that produces this rising waveform.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.