cburt

FPGA Saving Images to MicroSD Wing

Recommended Posts

Hello,

 

I am brand new to FPGAs and am trying to 1) learn about FPGAs and 2) save an image from a camera to an SD Card using FPGAs. The goal is to use this as a stepping stone to develop a stand-alone aerial imaging system for Quadcopters, aircrafts, etc. Thank you for taking the time to read this, and please excuse me for my novice comments. 

 

I am having trouble finding a project that goes through the details of writing an image from a camera module much like the ov7670 (link below) to the MicroSD Wing (link below) using a Papillo board. If you know of any projects that are in anyway similar, could you forward them? Also, I am planning on ordering the Papillo One board and a few wings so I can learn by doing. If you have any recommendations on specific hardware that would be beneficial for my goal, I would love your input.

 

ov7670:

http://www.electrodragon.com/product/ov7670-camera-module-breakout-board-power-cable/

MicroSD Wing:

http://papilio.cc/index.php?n=Papilio.MicroSDWing

 

Just to say it, I am planning on working this project and updating my status to this forum in case anyone else is interested. Open Source all the way.

 

Thank you guys!

-CB

Share this post


Link to post
Share on other sites

Hello CB,

 

Mike Fields has some info on his website:

http://hamsterworks.co.nz/mediawiki/index.php/SD_card_testing

http://hamsterworks.co.nz/mediawiki/index.php/OV7670_camera

 

I have a new OV7670 Wing and more of the uSD Wings on the way right now, they should arrive in the next week or so and we will then get them in the store.

 

I think the best solution for this problem is to first make a Wishbone core for the OV7670 that can be plugged into the ZPUino using the ZAP IDE/Papilio Schematic Library. A Wishbone core for the SD card would be nice too but not necessary to start out. We could then use the ZPUino to read data from the OV7670 and save to the SD card.

 

Jack.

Share this post


Link to post
Share on other sites

Hi,

 

What resolution image are you wanting to write? At the most the Papilio One has about 48kB of RAM, not enough to buffer a 320x240 image. However, if you use the camera with a FIFO module this can be overcome.

 

Also, what format do you want your output files? Due to limited resources you might only be able to save raw images, as there isn't enough RAM to work on the whole image at once.

 

Will you be wanting to have a FAT file system on the SD Card? To achieve this you will need some sort of CPU to manage the file system. 

 

So the setup might look like

 

CAMERA => FIFO => Camera Interface => Soft CPU with lots of software => SD card interface => SDCARD

 

It really is more suited to a 32 bit micro-controller than implementing in an FPGA's logic, as most of the magic will be in software, esp if this isn't a "I want to learn" project.

 

However, that isn't to say that FPGAs and SD cards don't go together. One project I've come across is a small portable way to log an hour of  data from an ADC at 250MB/s without losing samples. One solution is to use a RAID array of 8 fast (45MB/s) SD cards.

Share this post


Link to post
Share on other sites

Jack and Hamster,

 

Thank you for the quick responses. You guys are awesome.

 

Jack, thank you for the links and ZPUino recommendation. Sounds like a plan to me. The guidance is much appreciated.

 

Hamster, my long term goal is to capture some relatively high resolution images (definitely greater than 320x240), but at this point getting the system working with even a 160x120 image would be fantastic. I have not thought much about the output files. Saving raw images shouldn't be too much of a problem. Worst case, I could pull the SD Card after all the images have been taken and use some third party software on a laptop to convert the images. Yes, FAT file system was what I was envisioning.

 

After your responses, my plan is to get this system working with a Papillo One saving low resolution images (160x120) and then try to expand the project with a 32 bit micro-contoller. Definitely a "I want to learn" project.

 

Thank you again guys. I really appreciate the help,

-CB

Share this post


Link to post
Share on other sites

CB, 

 

You might want to split the project into three parts.

 

1. Getting image from the camera and a host computer

2. Streaming data from a host computer to a uSD card

3. Integrating the two bits to get the host computer out of the loop.

 

Each of these can then be broken down into smaller chunks that can be developed and verified seperately. Configuring the camera and getting color to work correctly is a big task - the camera has undocumented register settings and so on. Perhaps it is best to use the power-on default settings and post-process on a PC.

 

Email me direct if you want...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now