- Fri May 16, 2008 3:06 am
Looking a bit closer at the way you write to a SD card you:
1) send a write command, with a byte address aligned with the SD card block boundary
2) wait for a response from the card to proceed
3) send a start token, then a block of data
4) finish with a CRC-16 word of the data
5) wait for a accept/reject response from the card
6) the DO line of the card is held low while the card is busy
So 1-3 should be easy enough for the micro+simple logic to do however calculating the CRC-16 code for the data block might be difficult without pushing the data through the micro.
If the DO line can be used to throttle the camera output or perhaps to stop the clock the data could possibly be written without overloading the card.
So unfortunately a simple shifting logic looks like it doesn't go far enough. I wonder if there is a way to perform a CRC-16 calculation in logic. I'm guessing it is possible, but not practical to do with simple logic chips and a FPGA/CPLD would be necessary. However apparently the CRC code requirement can be turned off with a special command.
Alternatively there might be special purpose chips out there that take a stream of data, do appropriate buffering and stream it to an SD card. I've looked at the Vinculum chip (to use USB thumb drives) however they have a serial interface...which would be too slow, as again the processor would have to suck in the data, process it and output to the Vinculum chip.
Possibly the only alternative is to move to a high end microcontroller like the dsPIC range.
A conventional solution would be to squirt the JPEG data from a frame (via a simple clocking logic circuit) into a ram chip, then the micro could interrogate the ram buffer at its leisure and send it to the SD card. I presume this is how older cameras worked, given they usually had a delay after taking a picture. However I'd prefer a direct streaming approach to keep open the option of taking video instead of single frames, particularly with the cheap abundance of fast SD cards.
Anyway, just my current thoughts on possible solutions.