Author Topic: Best way to add external dacs  (Read 10843 times)

0 Members and 1 Guest are viewing this topic.

Offline rhdfTopic starter

  • Contributor
  • Posts: 44
  • Country: se
Best way to add external dacs
« on: February 05, 2016, 11:11:01 am »
How would you solve the "simple" task to add 5-6 dac channels to a MCU (stm32f4)?

what I need is 5 (or 6) voltages that updates "simultaneous" They will be used as controlvoltages for a syntheziser.

At the moment I have one MCP4822 (dual 12 bit dac) that is controlled with  2 encoders just so i can adjust 2 parameters for testing other parts of the circuit. Triple that might work, but its not that "nice" since I then have to make sure the right chip gets the right data. (A 6 channel 12bit SPI dac would be nice...)




 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7369
  • Country: nl
  • Current job: ATEX product design
Re: Best way to add external dacs
« Reply #1 on: February 05, 2016, 11:14:58 am »
Ti and AD, Linear sells bunch of multichannel DACs. Try 8 channel, they dont make it in 6. Just forget microchip, their analog stuff is not nice anyway.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26896
  • Country: nl
    • NCT Developments
Re: Best way to add external dacs
« Reply #2 on: February 05, 2016, 12:17:00 pm »
Another option would be to use PWM. If the signals don't need to change fast you might even be able to do it in software and apply filtering in hardware.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline rhdfTopic starter

  • Contributor
  • Posts: 44
  • Country: se
Re: Best way to add external dacs
« Reply #3 on: February 05, 2016, 12:48:13 pm »
PWM is an option I  have considered. The problem comes that day I need more outputs than available pins ...
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Best way to add external dacs
« Reply #4 on: February 05, 2016, 01:46:30 pm »
Maybe I2C, SPI or I2S DAC would help? Not sure about STM32F4 I2S interface supporting more than 2 channels.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3238
  • Country: gb
Re: Best way to add external dacs
« Reply #5 on: February 05, 2016, 01:51:35 pm »
AD5628/48/68 are octal 12/14/16 bit DACs with an SPI interface (up to 50MHz).  You can preload the input registers for each channel and then either send a single SPI command or toggle the LDAC pin to transfer the input registers to the DAC code registers, so all outputs update simultaneously.  They have a very good on board reference as well (5ppm/C).  The only snag is they are expensive parts.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26896
  • Country: nl
    • NCT Developments
Re: Best way to add external dacs
« Reply #6 on: February 05, 2016, 05:42:12 pm »
PWM is an option I  have considered. The problem comes that day I need more outputs than available pins ...
In that case you can use a microcontroller with more pins. Another option is to use one DAC, CMOS switches and a FET input opamp (like the TL071/72/74) and create a sample & hold. That way you can create many precise control voltages very cheap.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline cloudscapes

  • Regular Contributor
  • *
  • Posts: 198
Re: Best way to add external dacs
« Reply #7 on: February 06, 2016, 12:31:36 am »
single dac -> multiplexer -> simple opamp sample & hold

I want to build a synth as well, so I've been thinking about how to do it
 

Offline uncle_bob

  • Supporter
  • ****
  • Posts: 2441
  • Country: us
Re: Best way to add external dacs
« Reply #8 on: February 06, 2016, 02:01:53 am »
Hi

There are an enormous number of DAC's from 8 bit through 20 bit that you can load a bunch off off of a single SPI port. You daisy chain the output of one to the input of the other. Shift out bits times DAC's worth of data and send a single pulse to load them all. One clock line, one data output line and one strobe line. You may have a single chip select line as well depending on the DAC. Update will be simultaneous to within however good the timing on the parts is (nanoseconds). No pops, burps, clicks or buzz.

With 12 to 16 bit DAC's as cheap as they are today, there is not a lot to be saved in a one up design trying to shave off a couple of bits. The days of 8 bit is all my audio setup can afford are long gone.

Bob
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26896
  • Country: nl
    • NCT Developments
Re: Best way to add external dacs
« Reply #9 on: February 06, 2016, 02:05:21 am »
I wouldn't call DACs cheap. A good DAC (IOW: not one from Microchip or Rohm) still costs a few dollars each.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Best way to add external dacs
« Reply #10 on: February 06, 2016, 02:12:37 am »
You are looking for a dac with a latxh pin. Multi channel output makes programming easy.

Spi is good for high speed, assuming that you prefer a serial interface.
================================
https://dannyelectronics.wordpress.com/
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Best way to add external dacs
« Reply #11 on: February 06, 2016, 11:20:11 am »
If you still want to use MCP4822, that's possible without too much hassle, assuming you have enough GPIO pins available.

You'll need one separate /CS outputs from the MCU per DAC (as the 4822 only has a serial data in -> no daisy chaining) and another output to be connected to the all /LDAC inputs (pin 5) on the DACs to load them at the same time (as dannyf suggested).
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26896
  • Country: nl
    • NCT Developments
Re: Best way to add external dacs
« Reply #12 on: February 06, 2016, 12:16:49 pm »
Be careful with Microchip's DACs: their logic levels are choosen very stupidly so they don't work if you have mixed logic levels (for example powering a microcontroller from 3.3V and the DAC from 5V).
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline uncle_bob

  • Supporter
  • ****
  • Posts: 2441
  • Country: us
Re: Best way to add external dacs
« Reply #13 on: February 06, 2016, 02:35:26 pm »
I wouldn't call DACs cheap. A good DAC (IOW: not one from Microchip or Rohm) still costs a few dollars each.

Hi

The price delta (even on good DACS) has dropped to the point that anything under 12 bits is not really worth chasing. If you have a size constraint that forces you to some sort of single package part, that's different. Yes, if you get the sample rate high enough, this falls apart, we aren't talking about those sort of DAC's here.

Bob
 

Offline rhdfTopic starter

  • Contributor
  • Posts: 44
  • Country: se
Re: Best way to add external dacs
« Reply #14 on: February 06, 2016, 04:57:59 pm »
You'll need one separate /CS outputs from the MCU per DAC (as the 4822 only has a serial data in -> no daisy chaining) and another output to be connected to the all /LDAC inputs (pin 5) on the DACs to load them at the same time (as dannyf suggested).

That is one of my ideas, but there is that thing with the (in my case) 3 separate chips. Sure the are dirt-cheap and have internal reference.

After all good tips in here I'm starting to look at a solution with a 8-channel dac. 2-3 extra channels at the moment, but who knows.I might come up with some crazy idea where I need them.

Then I just have to handle one CS and "LDAC" pin
 

Offline uncle_bob

  • Supporter
  • ****
  • Posts: 2441
  • Country: us
Re: Best way to add external dacs
« Reply #15 on: February 06, 2016, 05:13:07 pm »
Hi

Be careful with the "8 channel" parts. There are two very different approaches to them and the manufacturers are not very careful about telling you which one you are getting. Some are a single DAC with an output mux. Others are a full eight independent DAC's. With the mux parts, you only get one output at a time. When the DAC is not tied to an output, that line just floats (or grounds). If you need 8 simultaneous outputs. You can't do it with a mux.

I have seen this being done for years. Even today I'll get handed a part and look at it. From the data sheet, it's 8 independent parts. Dig down into the programming details on page 97 and surprise !!! There is only one DAC data register. It's a mux part.

=========

If you get into a case that requires multiple chips selects, a 74 series demultiplexer chip is a cheap and dirty way to come up with the required signals without using a lot of MCU pins.

Bob
 

Offline rhdfTopic starter

  • Contributor
  • Posts: 44
  • Country: se
Re: Best way to add external dacs
« Reply #16 on: February 09, 2016, 12:06:34 am »
Just realized that 8-channel dacs is pretty cheap ( as in price/channel) compared to 4-channel versions. But one thing that's interesting is that most of them comes in tiiiiiny packages, like tssop16. Why not in "normal" sizes like soic16?

With some rough planning i can fit a MCU, 8 channel dac and a audio-dac + all passives needed for them on something like a creditcard sized PCB.
 ;D
 

Offline uncle_bob

  • Supporter
  • ****
  • Posts: 2441
  • Country: us
Re: Best way to add external dacs
« Reply #17 on: February 09, 2016, 12:14:06 am »
Just realized that 8-channel dacs is pretty cheap ( as in price/channel) compared to 4-channel versions. But one thing that's interesting is that most of them comes in tiiiiiny packages, like tssop16. Why not in "normal" sizes like soic16?

With some rough planning i can fit a MCU, 8 channel dac and a audio-dac + all passives needed for them on something like a creditcard sized PCB.
 ;D

Hi

If it's a TSSOP, that's a *big* package these days. A small package would be one of 1.x by 2.x mm packages with no leads. That's considered a "big" package for a fixed voltage regulator these days. It's also a do-able package for MCU's.

The why is pretty easy. Things like cell phones (or worse watches) are the volume users of semi's these days. Size is a really big deal in this stuff.

Bob
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Best way to add external dacs
« Reply #18 on: February 09, 2016, 12:55:56 am »
Quote
From the data sheet, it's 8 independent parts. Dig down into the programming details on page 97 and surprise !!! There is only one DAC data register. It's a mux part.

Which part would be that?
================================
https://dannyelectronics.wordpress.com/
 

Offline uncle_bob

  • Supporter
  • ****
  • Posts: 2441
  • Country: us
Re: Best way to add external dacs
« Reply #19 on: February 09, 2016, 01:14:23 am »
Hi

It's a part from Maxim. There are a lot of similar parts. I have no idea what they get used in. Whatever the application, somebody must like to do it that way. My guess is it's some sort of built in test sort of thing. Poke at each point and make sure it wiggles correctly. Once you have poked at all 8 points, shut the DAC down and continue the boot process.

Bob
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Best way to add external dacs
« Reply #20 on: February 09, 2016, 01:19:28 am »
Quote
It's a part from Maxim.

And its part number is?
================================
https://dannyelectronics.wordpress.com/
 

Offline uncle_bob

  • Supporter
  • ****
  • Posts: 2441
  • Country: us
Re: Best way to add external dacs
« Reply #21 on: February 09, 2016, 01:43:50 am »
Hi

I've got it on a demo board at work. I'll try to dig it up tomorrow, if I can even find the darn thing.

Bob
 

Offline rhdfTopic starter

  • Contributor
  • Posts: 44
  • Country: se
Re: Best way to add external dacs
« Reply #22 on: February 09, 2016, 10:24:44 am »
The why is pretty easy. Things like cell phones (or worse watches) are the volume users of semi's these days. Size is a really big deal in this stuff.

Bob
I realize that, but there are obviously still a market for 2 and 4 channel-dacs in DIP-packages ;) Are there really that many small sized products where you need a lot of DAC-cannels?.

 I won't have any problems fitting the pcp in the enclosure, thats for sure ;) (the size of it will be dictated by a bunch of encoders and buttons with some kind of usable spacing)
 

Offline cloudscapes

  • Regular Contributor
  • *
  • Posts: 198
Re: Best way to add external dacs
« Reply #23 on: February 09, 2016, 02:23:10 pm »
If he's building a synth, then I wouldn't consider this project "small sized" ;)
I'd be extremely interested in seeing the result!
 

Offline uncle_bob

  • Supporter
  • ****
  • Posts: 2441
  • Country: us
Re: Best way to add external dacs
« Reply #24 on: February 09, 2016, 06:21:12 pm »
The why is pretty easy. Things like cell phones (or worse watches) are the volume users of semi's these days. Size is a really big deal in this stuff.

Bob
I realize that, but there are obviously still a market for 2 and 4 channel-dacs in DIP-packages ;) Are there really that many small sized products where you need a lot of DAC-cannels?.

 I won't have any problems fitting the pcp in the enclosure, thats for sure ;) (the size of it will be dictated by a bunch of encoders and buttons with some kind of usable spacing)

Hi

Yes, there is just about zero demand anymore for DIP parts in new designs. They hang around mainly for re-builds of old designs or the repair business. Cell phones have a lot of internal controls, thus a lot of DC loops. Even stuff in your car gets crammed into a small package. The feature list grows, what goes in grows, the car gets smaller .... parts have to shrink.

Dug into my Maxim part, it seems to have wandered off. It may have been an ADC or mixed signal part. I don't see an obvious candidate in their selector guides.

Bob
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf