Electronic – Arbitrary Function Generator or DAC with memory IC help

dacfunction generator

I am trying to look for a hardware solution to my current problem. Currently I am using an AFG preprogrammed with a signal (example below, 8bit resolution is OK, using 30 or more data points each 1us in duration). I would like to replace this AFG with an IC that I can program through SPI or similar. Then when I want a signal trigger it with TTL or equivalent.

I have found a few IC's that are similar to what I want, specifically a SPI DAC, with memory for one data point MCP4725.

Also I have found a few sweep programmable square and sine wave systems but not anything that can satisfy my needs.

I understand there may not be a solution, but I am hoping that it is just that I am using the wrong search terms.

Terms used;

"DAC with memory and frequency"
"IC AFG"
'IC arbitrary function generator'

enter image description here

Best Answer

Use either a microcontroller (if you're comfortable writing software) or an FPGA (if you're comfortable with VHDL/Verilog hardware design). Same basic idea either way:

Organize memory using phase from 0 to 360 degrees as the memory address, and store one or more complete waveforms in that space. The data should be scaled to fill the available dynamic range.

Designate a counter (wide enough to address the memory) as the "phase accumulator". This counter will run from 0 to 360 degrees. Use modulus arithmetic to handle overflow e.g. 355 degrees plus 10 degrees = 5 degrees.

Use a timebase (such as a clock oscillator or a timer tick interrupt) to periodically read the memory, at the location addressed by the phase accumulator. Scale the data before sending it to the DAC -- this is where you can add an offset or adjust the gain. Be sure to handle overrange/underrange saturation of the DAC codes.

After writing the DAC, increment the phase accumulator to point to the next sample. The output frequency depends on the phase increment and the frequency of the timebase.

For best results, ensure that each output cycle gets at least 10 points per cycle. Although 2 points per cycle is barely sufficient to avoid frequency aliasing (Nyquist limit), this condition also has 100% error in amplitude and phase, so is not really sufficient for signal reconstruction. At around 10 points, a reconstructed sine wave begins to resemble an actual sine wave.

I've never seen a single IC solution for arbitrary function generation. The DAC usually is just a DAC without any signal processing backend. I was involved in the design of the Maxim Integrated MAX5318 Evaluation Kit, which uses a Xilinx Spartan 3 FPGA to implement arbitrary function generation.

I think the reason you're not going to find an integrated DAC plus Arbitrary Function Generator all on one IC package, is because precision DAC is fairly expensive to design and test, while RAM is a commodity. Every year RAM designs get squeezed tighter and cheaper, while precision DAC solutions get designed into long-term industrial and ATE applications. In other words, the DAC customer base and RAM customer base pull in opposite directions. There's no economical way to integrate the two functions into a single IC. If you want to bankroll a custom IC project, I'm sure it could be technically feasible for some price. But I guarantee you're not going to like the price, especially at low volume.