HOME    PROJECTS    LIBRARIES    RESOURCES    LINKS    CONTACT  
Select category:
Arduino
chipKit
  DS1307
  DS3231
  DS3234
  KeyPad
  LCD5110_Basic
  LCD5110_Graph
  LCD5110_SPIflash
  LEDmatrix7219
  MCP4725
  MGLCD
  OLED_I2C
  OLED_SPIflash
  OLED_StatusIcons
  relay8
  SPIflash
  URTouch
  UTFT
  UTFT_Buttons
  UTFT_Geometry
  UTFT_SPIflash
  WiiChuck
ESP8266/32
TI LaunchPad

IF YOU LIKE,
and use any of my projects or libraries, and would like to encourage further development you can donate through PayPal here:

Rather donate hardware directly? Then click here.




Library: MCP4725

This library has been made to easily interface and use the MCP4725 DAC with an Arduino or chipKit.

MCP4725 (illustration)MCP4725 pinoutMCP4725 connection example

The MCP4725 is a low-power, high accuracy, single channel, 12-bit buffered voltage output Digital-to-Analog Convertor (DAC) with non-volatile memory (EEPROM). Its on-board precision output amplifier allows it to achieve rail-to-rail analog output swing.

The DAC input and configuration data can be programmed to the non-volatile memory (EEPROM) by the user using I2C interface command. The non-volatile memory feature enables the DAC device to hold the DAC input code during power-off time, and the DAC output is available immediately after power-up. This feature is very useful when the DAC device is used as a supporting device for other devices in the network.

The device includes a Power-On-Reset (POR) circuit to ensure reliable power-up and an on-board charge pump for the EEPROM programming voltage. The DAC reference is driven from VDD directly. In power-down mode, the output amplifier can be configured to present a low, medium, or high resistance output load.

The MCP4725 has an external A0 address pin. This A0 pin can be tied to VDD or VSS of the user’s application board.

 IMPORTANT: 

The library has not been tested in combination with the Wire library and I have no idea if they can share pins. Do not send me any questions about this. If you experience problems with pin-sharing you can move the MCP4725 SDA and SCL pins to any available pins on your development board. This library will in this case fall back to a software-based, TWI-/I2C-like protocol which will require exclusive access to the pins used.

It should be noted that the output voltage from the MCP4725 is referenced to the operating voltage of the chip. If your operating voltage is below/above nominal the output will also be below/above what you expect from the set value.

If you are using a chipKit Uno32 or uC32 and you want to use the hardware I2C interface you must remember to set the JP6 and JP8 jumpers to the I2C position (closest to the analog pins).

Download:

MCP4725.zip
(Filesize is 367.77 KiB. Downloaded 4150 times)


Some demos are included to demonstrate most of the functions.
This is a multi-platform library that will work with several different development board types.

Changes:
v1.017 Aug 2014initial release

Nice to know:

This library will default to I2C Fast Mode (400 KHz) when using the hardware I2C interface.

Datasheet:

CLICK HERE TO VIEW

Compatibility:

WorkingchipKit Uno32
WorkingchipKit uC32
WorkingchipKit Max32
Working = Working   Not working: Not working
Not tested, Unsupported = Not tested, Unsupported

Manual:

CLICK HERE TO VIEW
The manual is included in the download

License:

By downloading the library you accept the following license:
Creative Commons BY-NC-SA Logo
Creative Commons (CC BY-NC-SA 3.0)
View SummaryView Legal