I'm designing a system which reads values from a microphone and feeds it to the Arduino to calculate a few sound parameters. The measuring happens during a couple of milliseconds. The problem is that it's way faster than the processing speed of the Arduino. So I was wondering if it was a good idea to first feed all the data to a memory and then the Arduino would get it at its pace? What kind of memories do you recommend to this application?
closed as unclear what you're asking by Chris Stratton, Dmitry Grigoryev, Finbarr, pipe, awjlogan Oct 29 '18 at 19:46
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
SRAM will do the trick.
- It wastes minimal amount of power and it's easy to interface (just SPI);
- Unlimited writes/rewrites
Getting a chip that has 256 kB (keep in mind in most places such chips are labelled by the number of bits, so 256kB will be labelled as 2 MBit) and still retains the easy-to-use SPI interface might be more challenging, but I bet it exists. I managed to find a 1MBit one (23LC1024) in a local shop.
Keep in mind that "Arduino" has become a vague term which is more about the framework, not really about the chip. There are Arduino-compatible boards that use an ARM microcontroller inside, whose computing speed should be enough to get you computation done without the need of intermediate cache SRAM. It depends on what's most convenient and what you are actually trying to achieve.
With an external 16-bit ADC, you can sample and store at 44.1KHz to SD card, or to an SRAM or FRAM, and then process, with a 16 MHz 328P or 1284P. Mono only, not enough cycles for stereo.
There is a topic at the Arduino forum website for that. (Search for sample and store for playback later, from 2 or 3 summers ago). I'd pull up the link, but I can't access the site right now.
256K samples will take nearly 6 seconds, that's way more than a few ms.