element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Test & Tools
  • Technologies
  • More
Test & Tools
Blog The Modular Bench Power Supply ++, Arduino UNO and precision ADC, DAC + MDO3000 I2C debugging
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Test & Tools to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Robert Peter Oakes
  • Date Created: 17 Feb 2015 5:12 AM Date Created
  • Views 1950 views
  • Likes 2 likes
  • Comments 1 comment
  • ads1220
  • dac
  • dac8574
  • uno
  • adc
  • arduino
  • modular_bench_power_supply
Related
Recommended

The Modular Bench Power Supply ++, Arduino UNO and precision ADC, DAC + MDO3000 I2C debugging

Robert Peter Oakes
Robert Peter Oakes
17 Feb 2015

UPDATE Feb 11 2017:- An observant viewer spotted a discrepancy between the code in the video and the code attached/published here. I have now updated it to all match.

 

In the following two videos we look at the use of a TI ADC and DAC TSSOP-16 chips to extend the abilities (Resolution and accuracy) of the Arduino UNO for use with the Power Supply project

 

First up the ADC - ADS1220

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

and now the DAC, DAC8574, Oh and some more I2C debugging image with the MDO3000

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Here is the DAC8574 code for those that are interested, sorry for the delay posting

#include <SPI.h>
#include <Wire.h>


#define PGA 1
#define VREF 2.048
#define VFSR VREF/PGA
#define FSR (((long int)1<<23)-1)


//#define DAC8574_ADD 0x98
#define DAC8574_ADD 0x4C // allowing for RW bit being added
#define DAC8574_CTR 0x34 // broadcast to all dac channels


volatile byte MSB;
volatile byte data;
volatile byte LSB;
//volatile char SPI_RX_Buff[3];
volatile byte *SPI_RX_Buff_Ptr;
byte val = 0;


unsigned int Sin_tab[256] = { 32768,33572,34376,35178,35980,36779,37576,38370,39161,39947,40730,41507,42280,
43046,43807,44561,45307,46047,46778,47500,48214,48919,49614,50298,50972,51636,
52287,52927,53555,54171,54773,55362,55938,56499,57047,57579,58097,58600,59087,
59558,60013,60451,60873,61278,61666,62036,62389,62724,63041,63339,63620,63881,
64124,64348,64553,64739,64905,65053,65180,65289,65377,65446,65496,65525,65535,
65525,65496,65446,65377,65289,65180,65053,64905,64739,64553,64348,64124,63881,
63620,63339,63041,62724,62389,62036,61666,61278,60873,60451,60013,59558,59087,
58600,58097,57579,57047,56499,55938,55362,54773,54171,53555,52927,52287,51636,
50972,50298,49614,48919,48214,47500,46778,46047,45307,44561,43807,43046,42280,
41507,40730,39947,39161,38370,37576,36779,35980,35178,34376,33572,32768,31964,
31160,30358,29556,28757,27960,27166,26375,25589,24806,24029,23256,22490,21729,
20975,20229,19489,18758,18036,17322,16617,15922,15238,14564,13900,13249,12609,
11981,11365,10763,10174,9598,9037,8489,7957,7439,6936,6449,5978,5523,5085,4663,
4258,3870,3500,3147,2812,2495,2197,1916,1655,1412,1188,983,797,631,483,356,247,
159,90,40,11,1,11,40,90,159,247,356,483,631,797,983,1188,1412,1655,1916,2197,
2495,2812,3147,3500,3870,4258,4663,5085,5523,5978,6449,6936,7439,7957,8489,9037,
9598,10174,10763,11365,11981,12609,13249,13900,14564,15238,15922,16617,17322,
18036,18758,19489,20229,20975,21729,22490,23256,24029,24806,25589,26375,27166,
27960,28757,29556,30358,31160,31964 };




void setup()
{
  Wire.begin(DAC8574_ADD);
}


void loop()
{


  SetDAC(0, 0x4000);
  SetDAC(1, 0x8000);
  SetDAC(2, 0xC000);
  SetDAC(3, 0xFFFF);
  while (1)
  {
  for (int x = 0; x<256; x++)
  {
  SetDAC(0, Sin_tab[x]);
  }
  }
}


void SetDAC(unsigned int channel, unsigned int value)
{
  int DACCmd = 0;
  switch (channel)
  {
  case 0:  DACCmd = 0x10; break;
  case 1:  DACCmd = 0x12; break;
  case 2:  DACCmd = 0x14; break;
  case 3:  DACCmd = 0x16; break;
  default: break;
  }
  Wire.beginTransmission(DAC8574_ADD); // transmit to device
  Wire.write(DACCmd);
  Wire.write(value >> 8);
Wire.write(value);        //
  Wire.endTransmission();    // stop transmitting
}

Attachments:
DAC8574 Updated.zip
  • Sign in to reply
  • DAB
    DAB over 10 years ago

    Good job Peter.

     

    What speed are you using for the I2C communication?

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube