uchip / mcp47x6 Goto Github PK
View Code? Open in Web Editor NEWArduino library for MCP4706, MCP4716 and MCP4726 DACs
License: Other
Arduino library for MCP4706, MCP4716 and MCP4726 DACs
License: Other
Would you like to publish your library onto the Arduino Library Manager?
If you are still active on this project I can submit a pull request...
12 bit version MCP4726: maxium output voltage is about V_ref/4095 * 255 (0xFF) instead of V_ref/4095 * 4095 (0xFFF).
fix_max_out_level.patch.txt
line 133 should chang from :
Wire.write((config | MCP47X6_CMD_VOLALL) & MCP47X6_PWRDN_MASK);
to
Wire.write((config | MCP47X6_CMD_VOLDAC) & MCP47X6_PWRDN_MASK);
Hi! Thank you for developing this. I'm using the following code to select the Vref pin as the voltage reference source (which is a 2.5V precision reference). However, I still see the DAC output at 5V when I setOutputLevel
at 0xFF. Just wondering how this is happening...
// Include libraries this sketch will use
#include <Wire.h>
#include <MCP47X6.h>
// Instantiate objects used in this project
MCP47X6 theDAC=MCP47X6(MCP47X6_DEFAULT_ADDRESS);
void setup() {
Wire.begin();
TWBR = 12; // 400 kHz (maximum)
Serial.begin(115200); // Open serial connection to send info to the host
while (!Serial) {} // wait for Serial comms to become ready
Serial.println("Starting up");
Serial.println("Testing device connection...");
Serial.println(theDAC.testConnection() ? "MCP47X6 connection successful" : "MCP47X6 connection failed");
theDAC.begin();
theDAC.begin(MCP47X6_VREF_VREFPIN_BUFFERED & MCP47X6_GAIN_1X);
theDAC.setVReference(MCP47X6_VREF_VREFPIN_BUFFERED);
theDAC.setGain(MCP47X6_GAIN_1X);
theDAC.saveSettings();
theDAC.setOutputLevel((uint8_t) 0x00);
delay(3000);
theDAC.setOutputLevel((uint8_t) 0xFF);
}
void loop() {
}
The code for begin() includes a comment about reading the current settings from the EEPROM, but does not include an implementation, and the function for saveSettings() has no implementation at all.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.