{"id":19856593,"url":"https://github.com/gavinlyonsrepo/mcp4725_pico","last_synced_at":"2025-05-02T01:31:38.833Z","repository":{"id":216496934,"uuid":"628945655","full_name":"gavinlyonsrepo/MCP4725_PICO","owner":"gavinlyonsrepo","description":"Library Driver for the MCP4725 DAC modules, for Raspberry pi PICO RP2040 C++ SDK","archived":false,"fork":false,"pushed_at":"2025-03-29T21:20:09.000Z","size":445,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T20:51:18.717Z","etag":null,"topics":["dac","dac-components","digital-analog-converter","digital-analog-quantum-computing","library","mcp","mcp2515","mcp47","mcp4725","pico-sdk","raspberry","raspberry-pi","raspberry-pi-pico","raspberry-pi-pico-rp2040","raspberry-pi-pico-sdk","rp2040","rpi","rpi-pico","rpi-projects"],"latest_commit_sha":null,"homepage":"https://gavinlyonsrepo.github.io/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gavinlyonsrepo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-17T09:57:59.000Z","updated_at":"2025-03-29T21:20:12.000Z","dependencies_parsed_at":"2025-03-29T22:21:49.919Z","dependency_job_id":"f165f181-5f11-489e-9a69-708e262d8ede","html_url":"https://github.com/gavinlyonsrepo/MCP4725_PICO","commit_stats":null,"previous_names":["gavinlyonsrepo/mcp4725_pico"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinlyonsrepo%2FMCP4725_PICO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinlyonsrepo%2FMCP4725_PICO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinlyonsrepo%2FMCP4725_PICO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinlyonsrepo%2FMCP4725_PICO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gavinlyonsrepo","download_url":"https://codeload.github.com/gavinlyonsrepo/MCP4725_PICO/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251969433,"owners_count":21673203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dac","dac-components","digital-analog-converter","digital-analog-quantum-computing","library","mcp","mcp2515","mcp47","mcp4725","pico-sdk","raspberry","raspberry-pi","raspberry-pi-pico","raspberry-pi-pico-rp2040","raspberry-pi-pico-sdk","rp2040","rpi","rpi-pico","rpi-projects"],"created_at":"2024-11-12T14:16:02.441Z","updated_at":"2025-05-02T01:31:38.826Z","avatar_url":"https://github.com/gavinlyonsrepo.png","language":"C++","funding_links":["https://www.paypal.com/paypalme/whitelight976"],"categories":[],"sub_categories":[],"readme":"[![Website](https://img.shields.io/badge/Website-Link-blue.svg)](https://gavinlyonsrepo.github.io/)  [![Rss](https://img.shields.io/badge/Subscribe-RSS-yellow.svg)](https://gavinlyonsrepo.github.io//feed.xml)  [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/paypalme/whitelight976)\n\n# MCP4725_PICO\n\n![image](https://github.com/gavinlyonsrepo/MCP4725_PICO/blob/main/extra/images/device.jpg)\n\n\n## Table of contents\n\n  * [Overview](#overview)\n  * [Examples](#examples)\n  * [Software](#software)\n    * [Set Voltage Input code](#set-voltage-input-code)  \n    * [EEPROM](#eeprom)  \n    * [Power modes](#power-modes)  \n    * [General call method](#general-call-method)  \n  * [Hardware](#hardware)\n  * [Output](#output)\n\n## Overview\n\n* Name: MCP4725_PICO\n* Description:\n\nLibrary Driver for  MCP4725 DAC modules,\nfor Raspberry pi PICO RP2040. \n\nThe MCP4725 is a low-power, high accuracy, single\nchannel, 12-bit buffered voltage output Digital-to-\nAnalog Converter (DAC) with nonvolatile memory\n(EEPROM). Its on-board precision output amplifier\nallows it to achieve rail-to-rail analog output swing.\n\n* Supports MCP4725 features including EEPROM r/w, Power modes and general call. \n\n* Toolchain\n\t1. Raspberry pi PICO RP2040\n\t2. SDK C++, compiler G++ for arm-none-eabi\n\t3. CMAKE , VScode\n\n## Examples\n\nThere are eight example files.\nThe example files are in example folder. To build the one you want, edit the Cmaketxt file add_executable(${PROJECT_NAME} section, comment in one example file path and one ONLY. \n\n| Path Name | Function |\n| --- | --- |\n| isConnected | Check I2C connection continuously, useful for debugging I2C bus issues |\n| demoTest | Carries out Test on various features, EEPROM, power mode's etc |\n| setVoltage | Carries out Tests on voltage and input code methods |\n| squareWave | Generates a square waveform  100 Hz  |\n| triangleWave | Generates a triangle waveform  75 Hz  |\n| sawToothWave | Generates a saw tooth waveform 150 Hz   |\n| sineWave | Generates  a sinusoidal waveform at various values, see file header |\n| random | Random data generation |\n\nThe example files output Data to the PC serial port using printf,  default settings.(baud rate 38400). \n\n## Software\n\n### Set Voltage Input code\n\nThe user can set the Voltage output using a voltage or an input code.\nThe input code is calculated using following. Example :: \n\n0. Required voltage output of 1.65 V\n1. Voltage reference of 3.3 Volts \n2. DAC resolution of 2^12 (4096) \n3. The Din or input code would be  2048.\n\n![image](https://github.com/gavinlyonsrepo/MCP4725_PICO/blob/main/extra/images/inputcode.jpg)\n\n### EEPROM\n\nThe Device can store a voltage output value and power mode status in its onboard EEPROM.\nIn the event of a software reset or power loss, The device will read EEPROM and restore these settings. If the power supply voltage is less than the POR(Power-On-Reset) thresh-\nold (VPOR = 2V, typical), all circuits are disabled and there will be no DAC output. . \nWhen Vdd increases above Vpor device \"resets\" and gets data from EEPROM(stored voltage and power on conditions).\n\n![image](https://github.com/gavinlyonsrepo/MCP4725_PICO/blob/main/extra/images/eeprom.jpg)\n\n### Power modes\n\nThe device has 4  modes. Normal and 3 power down modes. During the power-down mode, the device draws about 60 nA (typical).\n\n![image](https://github.com/gavinlyonsrepo/MCP4725_PICO/blob/main/extra/images/powerdown.jpg)\n\n### General call method\n\nThe general call address (0x00) is for addressing every device connected to the I2C-bus at the same time. This command may potentially cause issues with other slave devices on the I2C bus.\nThe MCP4725 has two possible arguments here , Reset and wakeup. Reset is a software reset and will result in EEPROM values being set. Wakeup is to exit a power down mode and return to normal.\n\n![image](https://github.com/gavinlyonsrepo/MCP4725_PICO/blob/main/extra/images/call.jpg)\n\n## Hardware\n\n**Pinout**\n\n| Pin | Function | \n| --- | --- |\n| OUT | Analog Voltage output of DAC | \n| GND | Ground Reference |\n| SDA |Digital I/O Serial data. Transmits and receives data |\n| SCL | Digital input Serial clock input. Clocks data on SDA |\n| GND | Ground |\n| VDD  | Reference + supply voltage 2.7v - 5.5v,  In PICO case connect to 3.3v |\n| A0 | I2C Address Bit Selection pin (A0 bit)^^ |\n\n^^This pin can be tied to VSS or VDD,\nor can be actively driven by the digital logic levels. The logic state of this\npin determines what the A0 bit of the I2C address bits should be. \nThe address is also effected by which variant of chip. There are 3 variant's thus\n6 choice's of I2C address\n\n![image](https://github.com/gavinlyonsrepo/MCP4725_PICO/blob/main/extra/images/hardware.jpg)\n\nThe module tested has 2 X 4.7 kOhm  pull up resistors on I2C bus and a bypass capacitor.\nAn additional 10 µF capacitor (tantalum) in parallel is also recommended to\nfurther attenuate high frequency noise.\n\n## Output\n\nSaw tooth waveform.\n\n![image](https://github.com/gavinlyonsrepo/MCP4725_PICO/blob/main/extra/images/sawtooth.jpg)\n\nSine waveform.\n\n![image](https://github.com/gavinlyonsrepo/MCP4725_PICO/blob/main/extra/images/sine32.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinlyonsrepo%2Fmcp4725_pico","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgavinlyonsrepo%2Fmcp4725_pico","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinlyonsrepo%2Fmcp4725_pico/lists"}