Home-made digital camera (updates)


I didn’t have time to update this thread as I was busy with something else.

Anyway, after several tests I realised that the only way to be able to capture a picture and write it to the SD card without loosing data is not possible directly with CTS module unless using a large buffer, which is not an option on many MCU (ATMEGA328 is having only 2 Kbytes, LPC1343 is having 8 Kbytes, etc) while a full QVGA frame @ 16 bits per pixel is 153 Kbytes!

I had to add a new option to get this sorted out: instead of capturing and streaming the entire frame at once then stream it out I will have to use a different approach:
– Host initiate capture frame request and send number of lines (x) it’s buffer can take;
– CTS will start a frame capture in FIFO then disable FIFO writing;
– CTS will start to stream x lines as instructed by host, once streamed wait for host;
– Once host finished reading data from buffer and write it to SD card send back an acknowledge;
– CTS receive the acknowledge, if correct stream next x lines and wait;
– Repeat cycle until last line was streamed to host or host send terminate command (anything but acknowledge).

Using this solution I am able to get a picture and store it on the SD card. The overall flow is something like this: cts digital camera flow

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s