Connect Camera to Zedboard

17,586

44

10

Introduction: Connect Camera to Zedboard

The Zedboard is a powerful hobbyist system on chip with a ARM Coretx-A9 processor and a Xilinx FPGA built in. A great addon for the Zedboard is the OV7670 camera for image and video processing. The OV7670 can output 12 bit RGB in 640x480 resolution at 30 fps and can purchased for less than $20. The OV7670 camera used for this tutorial can be found here.

This tutorial will show you how to connect the OV7670 camera to the Zedboard and stream the camera through the VGA port on the board. The VHDL modules allow for easy interface to the frame information for further image processing.

A datasheet for the OV7670 is attached.

Step 1: Import VHDL Code

The first step is to install Vivado 2015 on your computer and create an RTL project using the ZedBoard Zynq Evaluation and Development Kit. Next thing to do is to download all of the VHDL files attached to this step then add them to the project by clicking Add Sources under Project Management. If everything has been added correctly you should see the ov7670_top file under Design Sources and then all of the over various VHDL sources underneath it.

Step 2: Add Block Memory

The frame of the image is stored in a piece of block ram. To add the block ram to the project, click on the IP catalog under Project Manager and search for Block Memory Generator. The settings of the block ram can be seen in the images attached.

Step 3: Add Constraints File

To connect the FPGA to the camera a constraints file defining the inputs and outputs has to be declared. To add the constraints file, click on Add Sources then Add Constraints then import the XCF file connected. After the XCF file is imported the camera has to be connected. The XCF file lists all of the net names of the FPGA pins and the connections to the camera. You must connect the camera pins to the FPGA pins by using the PMOD/Pin table and the PMOD pinout.

Step 4: Generate Bitstream

Now the final step is to generate the bit stream by clicking Program and Debug then Generate Bitstream and connect the Zedboard to a monitor through the VGA port. After the bitstream has been generated and uploaded to the FPGA you should see the camera streaming on the monitor. Make sure to take the lens off the camera and to focus the camera!

The implementation guide attached describes the register settings in the camera to change various settings. To change the camera settings the ov7670_registers.vhd file must be edited. To decrease resource utilization, the camera can be changed to output only YUV and record the Y component which would store a greyscale version of the image which would reduce the memory block width from 14 bits to 8 bits.

Be the First to Share

    Recommendations

    • Battery Powered Contest

      Battery Powered Contest
    • Plywood Challenge

      Plywood Challenge
    • Plastic Contest

      Plastic Contest

    10 Discussions

    0
    panteha100
    panteha100

    1 year ago on Introduction

    I don't know how to connect camera OV7670 to the Zedboard? can anyone help me please

    0
    Bhargav12
    Bhargav12

    1 year ago

    Hello!
    I am trying to implement the above code on my Zedboard, the camera output is displayed on the board but it isn't very clear! Could anyone please help me with some modified Register settings for the same camera OV7670.
    Thank you in advance!

    0
    ananthamar
    ananthamar

    Reply 1 year ago

    hello!!!! just adjust the lens of your camera
    rotate the lens in anti clock wise till the streaming looks better.
    enjoy!!!!!!!!!

    0
    ananthamar
    ananthamar

    Reply 1 year ago

    i too implemented the project. but the output is not clear like your output. i've made some changes to the ov7670 register settings..but it is useless... if u find anything useful kindly let me know that modification u made...... thank you.

    0
    ananthamar
    ananthamar

    Question 1 year ago

    hi there!!! can anybody share the step by step process for this project...???

    thanks in advance

    0
    sus_singh
    sus_singh

    2 years ago

    How to connect power and GND pins? I think there is 1 mistake, JA3 should be connected to Y10. Please confirm.

    0
    ApoorvU2
    ApoorvU2

    2 years ago

    I want use my pc camera for image processing. Please tell me steps to do that.

    0
    TerryC132
    TerryC132

    3 years ago

    Can't read the Memory block settings. Pressing Download requires going Premium...

    0
    KevinH215
    KevinH215

    4 years ago

    Hi I was interested in trying this project. When I attempt to synthesize the project I receive an error. Any ideas on how to get around this?



    • [Synth 8-549] port width mismatch for port 'addra': port width = 18, actual width = 19 ["C:/Users/Khugh/OneDrive/Documents/embedded_systems/final/fivenine/ov7670_top.vhd":144]
    0
    wold630
    wold630

    4 years ago

    Lots of great info, thanks!