Go Down

Topic: Analog Output Solutions for Arduino Uno R3 (Read 2 times) previous topic - next topic



Two approaches, both are fairly simple to implement:

1) You can digitize the data over 1 period, including drift. You can then use a phase accumulator to output the data to a dac to produce the desired output. This approach is simple, but requires considerable amount of (flash) space. If you want to reproduce 10khz signals over  a 1 second period, you need 40k+ data points (at 4x oversampling). At 8-bit per data point, you are talking about 40Kb of space; or double that for 16-bit resolution.

2) You can separate the data into two signals, a 166hz signal on top of a 1hz drift. You can keep two phase accumulators and combine them to form the output signal. More involved programming wise but will cut down your rom requirement considerably.

Either way, it is totally doable.


The fastest I tried, using the approach I outlined earlier, is to output to a parallel 8-bit dac at 10us per data point.

So you can conceivably make this work with a highspeed spi dac as well, using hardware spi.

With more programming tricks (naked isr + inline coding + optimization), you make be able to get it even faster.


Thank you very much everyone for the extremely helpful responses.

I am particularly interested in what was proposed by dhenry, but I am unsure as to the hardware implementation of a phase accumulator. It seems I'll have to use a chip or architecture designed for a direct digital synthesizer, which not only includes the NCO, but also the DAC as well. If there is a need for a DDS chip, how will my signal and my desired application select the supply current and voltage, the optimal SFDR, and clock speed?

I found a rough example of a DDS chip here: http://www.analog.com/en/rfif-components/direct-digital-synthesis-dds/ad9830/products/product.html

You also mentioned a concern with flash space. If I were to digitize one period and rely on a phase accumulator to periodically output my desired signal, there shouldn't be a reason that the arduino's memory couldn't handle such an application should there?

Thanks again for all the help!


A phase accumulator is really a counter, or an index. It increments with time, and is used to pick up an output from an array that contains your desired waveform.

Go Up