MCP4725 DAC AVR ATmega library

Summary of MCP4725 DAC AVR ATmega library


The article discusses the MCP4725, a cost-effective 12-bit single-channel DAC with onboard EEPROM, controlled via I2C. The author uses the ATmega8 microcontroller with an embedded I2C interface and employs Peter Fleury's I2C library to drive up to eight MCP4725 devices by setting their addresses via hardware selectors. The DAC output voltage ranges between 2.7V and 5.5V with a 25mA current limit, extendable with opamps and power transistors. The project, tested on an ATmega8 at 8MHz, includes example code to facilitate library use.

Parts used in the MCP4725 DAC AVR ATmega project:

  • MCP4725 DAC (12-bit, single-channel with EEPROM)
  • ATmega8 microcontroller
  • Opamp (optional, for higher current/voltage output)
  • Power transistors (optional, for higher current/voltage output)
  • Hardware pulldown selectors (for I2C address selection)

The MCP4725 DAC is a pretty common and cheap single channel 12 bit buffered voltage DAC, it also has an onboard EEPROM.

To drive this chip we can use I2C interface.

 

MCP4725 DAC AVR

The ATmega8 used for my implementation has an embedded I2C interface, so we just can use that interface.
The selected I2C library is the one proposed by Peter Fleury, you can find it here: http://homepage.hispeed.ch/peterfleury/avr-software.html

To library provides simple functions to set the output channel of the IC by using raw value or a voltage value.
MCP4725 DAC AVR (2)

The voltage output of this chip is limited by his voltage input, that is 2.7v to 5.5v, and the current allowed at the output pin is 25mA.
If you need more current, or more voltage, you can use a combination of opamp and power transistors.

Up to 8 MCP4725 can be driven using this library, the IC address has to be selected using the hardware pulldown selector.

This project has been developed and tested on an ATmega8 running at 8Mhz.

An example program is provided in order to help the library usage.

MCP4725 DAC AVR (3)

Code

Read More Detail:MCP4725 DAC AVR ATmega library


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top