I'd like to store a waveform in the memory of an Arduino Mega, and then sequentially clock through those data points and output them into a 12-bit DAC thereby producing an analog waveform. The number of data points comprising the waveform is 2,048, and upon clocking through all 2,048 points, I'd like the program to loop indefinately. So here are my questions: First, is that a reasonable goal to achieve with an Arduino Mega? Second, do I need to store the data points directly inside my program code, or can I load them separately into SRAM? Third, would an array work for this application, and if so, is there a good method for loading the arrays from my laptop into Arduino memory? Any ideas from the community will be greatly appreciated. Sincerely, Jim Laird
That seems reasonable. But, you won't be able to much, if anything, else while looping because every sample has to be timed just-right. (i.e. A soundcard has a buffer and it's own clock so the computer can multitask.)
Thanks for your reply, DVDdoug! I looked at a couple of sound cards, and they might work. I think I'd have better control, however, if I stick with just using the bare Arduino. Any thoughts on where I should load the waveform data points (SRAM vs. program memory vs. somewhere else) if I use Arduino memory?