[sdiy] DIY Parallel DAC
ASSI
Stromeko at nexgo.de
Sun Jul 31 15:55:54 CEST 2011
On Sunday 31 July 2011, Matthew Smith wrote:
> * Why am I looking for a parallel solution? Because my original design
> is a clock driving a counter that drives the address lines of an EPROM,
> the data from which drives a DAC. The evolution of this is to replace
> the EPROM with a lookup table in the FPGA, this driving the DAC.
I understand why the EPROM solution needs this, but the FPGA works
differently.
> With
> FPGAs, you can have arbitrary data widths - no having to send 12 bits as
> 2 x 8-bit words. If I want a 12-bit DAC, I just have 12-bit outputs
> from my lookup tables, and present these to the output pins. Pure
> simplicity.
You should have a synchroneous design in an FPGA, in other words the counter
gets a fast clock and whenever it should count by one it will get an enable
pulse that is exactly one clock wide. That same pulse can enable the
shifting out of bits onto an SPI bus, the clock only needs to be fast enough
that when the next enable arrives all bits have been shifted out.
> * Why not serial? I am using 1024 bit samples, clocked at the
> appropriate rate for the frequency required. Nearly all the serial DACs
> from my regular vendor (Element14) seem to rely on SPI for timing.
Huh? The SPI is just there to load the input register of the DAC, the
actual conversion does not normally happen until "load DAC" is asserted or
CS is deasserted.
> I like to treat SPI as asynchronous, when dealing with microcontrollers.
> Send stuff out fast, but allow other tasks (from interrupts) to take
> priority. Resetting the SCK rate all the time also lacks charm.
You use a fixed SCK, that's the whole point (you can even leave it running
all the time). Think of it as a parallel bus whose data is folded onto a
single wire and then unfolded again. Do that fast enough and it becomes
indistinguishable from the real thing.
> * Which parallel DACs have I looked at? Not many - either Element14's
> search isn't up to much (I've had issues finding stuff before,) or they
> have limited lines. The reason I'm only searching on this vendor is that
> I have to get the stuff from somewhere. Digikey & Mouser are out of the
> question, as they have arm-and-a-leg freight for anything under $200.
As I said, look them up from the manufacturer, then try to find them at
distributors. The parameteic search forms from the manufacturers are bad
enough, don't get me started on the nonsense that distributors put into
theirs.
> * Picked resistors - yes, this is a one-off. It's a "how does it work"
> and a "because I can." Whilst I like to work with SMD devices, as it
> keeps PCBs small (and cheap) I do have a box of 1,000 1k ex-military
> resistors. I think I may well do some measurements and build a ladder on
> matrix board. I only have the one value, but then I can match pairs for
> series resistance for the 2R part. As far as I can make out, it's the
> MSB end that is most critical on values.
The matching needs to be done to 1/2 an LSB or better or around 1/8Ohm for
R=1K at 12bit. If you split the ladder into two or more parts that becomes
more manageable at the expense of having to add the results with appropriate
weight. Unfortunately you need to drive the ladder in inverse mode, so
you'll have to stitch the parts together in voltage mode. And no, you can't
use the FPGA outputs directly, the series resistance would be too high and
uneven (the latter is more of a problem).
> * Variation in output levels - interesting point. I've got a Spartan 3E
> demo board - think I'll set it up to pull a load of pins high, dump a
> load on them and measure the voltage, just to see what sort of variance
> I get.
Don't forget that in inverse mode your reference needs to drive a current
that varies with the DAC value. A bunch of SPDT switches controlled by the
FPGA to use the ladder in normal mode gets the part count up, but might be
all-around preferrable. You need something in the mOhm range however or
match the 2R resistors so that they compensate for the switch resistance
(differently for each leg…).
Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
Wavetables for the Terratec KOMPLEXER:
http://Synth.Stromeko.net/Downloads.html#KomplexerWaves
More information about the Synth-diy
mailing list