Giter VIP home page Giter VIP logo

dac7568-library's Introduction

DAC7568 Library

Arduino Library to control the 8 channel digital to analog converter IC DAC7568 from TI.

DAC7568 Features

  • 8 programmable voltage outputs
  • Buffered outputs, no need for external OP amp
  • 3.3V or 5V supply operation
  • Internal high accuracy reference 2.5V (not yet supported in this libarary)

Important Notes

There are 2 versions of this IC:

  • -A gain 1x, max output 2.5V when using internal ref, or 1x VREF_IN pin if using external voltage ref
  • -C gain 2x, max output 5V when using internal ref, or 2x VREF_IN pin if using external voltage ref

Connecting the DAC

DAC Pin Arduino Pin Desctipion
SYNC Your choice, specify in code Chip Select
DIN MOSI SPI Data
SCLK CLK SPI Clock

Using the Library

#include <Arduino.h>
#include "DAC7568.h"

DAC7568 DAC = DAC7568(3300, 17); // setup DAC, 3.3V external reference (VREF_IN pin), pin 17 for SYNC

void setup()
{
    DAC.begin();
}

void loop()
{
    DAC.set_chan_voltage(0, 1000); // set channel 0 (A) to 1V
    DAC.set_chan_voltage(3, 2500); // set channel 3 (D) to 2.5V

    delay(3000);

    DAC.set_chan_voltage(0, 3000); // set channel 0 (A) to 3V
    DAC.set_chan_voltage(3, 500);  // set channel 3 (D) to 0.5V

    delay(3000);
}

Functions

Set chan_num (0-7) to voltage_mv mv

set_chan_voltage(uint8_t chan_num, uint16_t voltage_mv);

Set chan_num to mode (see enum in .h file for options), either ON or OFF with different pulldown resistor values

set_chan_mode(uint8_t chan_num, channel_mode_t mode);

dac7568-library's People

Contributors

cammiboi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.