Go Down

Topic: Finding the right DAC for multiple Analog outputs (Read 1 time) previous topic - next topic

RihamArduino

Hi,

I have a project that needs to drive 4 different modules, they each require an analog signal between 0-5V, I found a few options but can't decide which one works best (or whether there is any difference at all?)

1- using multiple MCP4725 converters, my understanding is that I can connect only two to the Arduino pin, but I found that Microship.com has different models that work with A0, A1, A2 & A3
http://www.microchip.com/wwwproducts/en/MCP4725, so I will be able to use two chips to drive 4 outputs.

2- Using one MCP4728 [MCP4728 is a quad channel, 12-bit voltage output Digital-to-Analog Convertor with non-volatile memory and I2C compatible Serial Interface] http://www.microchip.com/wwwproducts/en/MCP4728

3- Using one MCP4922 [a dual channel, 12-bit DAC with an external voltage reference and SPI interface. It offers high accuracy and low power consumption and is available in various packages.

Any guidance on which option is best for my scenario?

Thanks!

raschemmel

Quote
1- using multiple MCP4725 converters, my understanding is that I can connect only two to the Arduino pin 
If you are referring to the address pin limitations of the MCP4725 you are wrong. If you use a multiplexer or analog switches you can select different modules. I haven't tried this myself but you might look into I2C addressing to see how this can be done.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

RihamArduino

That was my understanding based on Adafruit comments about the chip - did I miss something?
"Most of a chip's address is built into the silicon, but some chips expose 'address pins' that you can set HIGH or LOW to give multiple copies of the chip different addresses. The MCP4725 only has one address pin though, so you only get 2 unique addresses, and thus can only have 2 on the same bus."

raschemmel

#3
Mar 11, 2016, 10:02 pm Last Edit: Mar 11, 2016, 11:27 pm by raschemmel
As I said you need to add multiplexers to address the chips. If you pull one of "n" dac's A0 LOW, and all the rest HIGH and access the one on A0, will it matter how many other dacs are connected to the I2C bus if they are all address 1 and you are not accessing address 1 ?

Look at this code:
Code: [Select]
/*
Using the Sparkfun Breakout Board for MCP4725 I2C DAC

this link made me understand how to use MCP4725 digital to analog converter
http://blog.michaelbparks.com/2008/09/sparkfun-dac-breakout-board-tutorial_8918.html


DAC MCP4725  values 0 - 4095;  0 - 5 volts

byte Device = 96;  //= binary 1100 000 = (MCP4725 device code) & A2 & A1 & A0
factory sets A2 & A1 to 0 & 0, we can set A0 to 1 or 0
A0=0 if connected to Ground, A0=1 if connected to Vdd

Stephan Schulz / www.maybevideodoes.de   /  27/03/2009
*/


byte Program = 64;
byte Device = 96; // This hardwired into the IC and the BoB, in other words, it is a given.

int maxValue = 1570; // 1570 is the max output for my project but can go up to 4095

int minValue = 0;
int value = minValue;
int dir = 1;

#include <Wire.h>

void setup()
{
  Wire.begin();

  Serial.begin(9600);
  Serial.println("i2c");

}

void loop()
{

  byte b1 = byte((value / 16));
  byte b2 = byte(value % 16);

  Wire.beginTransmission(Device);
  Wire.send(Program);
  Wire.send(b1);
  Wire.send(b2 << 4); // Needed twice, since the 4 lowest bits (of 12) are in the fourth byte
  Wire.endTransmission();


  value = value + dir;
  if(value > maxValue) dir = -1;
  if(value < minValue) dir = 1;

  delay(5);
}  


If the multiplexer chip is only pulling ONE of the A0s LOW (out of "n" MCP4725S), WHICH MCP4725 will you be talking to if you ran this code ?

Your firstt question should be WHICH multiplexer chips ?

Your second question should be which output do you use "Y" or "W" ?

Can you guess how many DACs you can select with this chip ?
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

MarkT

Hi,

I have a project that needs to drive 4 different modules, they each require an analog signal between 0-5V, I found a few options but can't decide which one works best (or whether there is any difference at all?)
Do you need DACs at all?  What bandwidth and resolution do you need?  Low pass filtering PWM outputs
might be simpler.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

raschemmel

Quote
What bandwidth and resolution do you need?   
If the OP knew what that was would he be posting here ?
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

CrossRoads

#6
Mar 12, 2016, 12:52 am Last Edit: Mar 12, 2016, 12:53 am by CrossRoads
I like MCP4922,
http://www.digikey.com/product-search/en?keywords=mcp4922
but only because I prefer the faster SPI interface.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

tbenner60

I have used the TCA9548A I2C multiplexer to drive four different MCP4725 DACs each having the same address. The multiplexer is simple to use and can have up to 8 devices attached to it.

I know I'm late to the party, but just wanted to add this to the discussion.

Go Up