squarewave said:
It does? Why can't the ADC serial data out pin simply be connected directly to the flash chip data in pin?
I guess you're talking about just blasting the entire SPI output into memory and then taking it apart later. Not such a bad idea, but as I seem to understand it, SPI is a master slave protocol where, for example, the master can ask the ADC for the data from channel N of the ADC the last time it was sampled, repeat that for all channels, and then wait until a new set of samples have been generated, and repeat. So, there's no stream of samples pouring out of an ADC via SPI to be blindly stuffed into memory - it's a serial bidirectional interface that a master could use to read samples out of the ADC, synchronous to the sampling.
You're extracting samples from the ADC manually anyway, so you might as well pack them into something like a WAV format, collect blocks of those files, and tell some code to write those formatted blocks to files using filesystem code that someone already wrote.
There's also the issue of erasing flash. This is where the block nature of flash comes about. You can write a zero anywhere, but to write a one over a zero, you need to erase the entire block, creating all ones, and then re-write the zeros you wanted to keep in that block. So, in the general case, it's far easier to do everything in blocks. When you ask the filesystem to write a page to a file, it will get a free block from the free list of the flash device, erase that, and then copy your data to the erased page. So, just using a FA32 format will allow a lot of pleasant things to happen, at the price of using a micro that you probably want anyway - board space, chips, and placement cost are expensive, and micros are cheap.
To keep it simple, you could start with a raw, block addressed chunk of flash memory, make your own format up, and pre-erase it, sort of like formatting a digital tape. You will at this point have only channels and a starting block for each recording, or maybe just one recording per piece of media starting at zero. From this, you could 'write the zeros' in and pretty menially write audio sample data directly to flash. However, you still need to do the basic SPI extraction from the ADC, assemble the data into a block, or at least a stream, and then use SPI to tell the flash to write your block to the chosen address. AFAIK, there is no auto-magic way to just connect the ADC and flash to the same SPI bus and watch the two record. You need a third thing to act as a SPI master to alternately drive the ADC and then the flash.
I could be wrong though, so if you can get it to work the way you propose, it'd be interesting to hear about the details!