Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

How to connect VGA CMOS camera sensor to FPGA board

FlyingDutch

Full Member level 4
Joined
Dec 16, 2017
Messages
200
Helped
28
Reputation
56
Reaction score
31
Trophy points
28
Location
Bydgoszcz - Poland
Activity points
2,081
Hello,

I would like to connect small (VGA) CMOS camera sensor to FPGA board. I had been looking for similiar thread on this forum, but I found only this thread:

https://www.edaboard.com/threads/cmos-camera-connection-to-fpga-de2-board.234189/

Tis thread is related to connecting IP camera to FPGA board, not my case. I would like to connect "OV7670 640x480 VGA CMOS Camera Modul" to Artix-7 FPGA board. My FPGA board is based on " XC7A100T-2FGG676I " Artix-7 FPGA chip:

https://pl.aliexpress.com/item/4000...chweb0_0,searchweb201602_4,searchweb201603_55

I found such OV7670 camera modules in internet shop:

https://www.banggood.com/Wareshare-...-p-1478355.html?rmmds=search&cur_warehouse=CN

https://www.banggood.com/OV7670-640...-p-1558348.html?rmmds=search&cur_warehouse=CN

The difference between these two modules is that first module hasn't FIFO buffer chip and second has. Now I am wondering which module to choose that with FIFO bufor or the one without it. I think that this model with FIFO is better because not need big buffer in FPGA internal memory. Could someone to advise me which modue to choose?

I found such projects related to connecting this OV7670 CMOS camera module to FPGA boards:

http://www.dejazzer.com/eigenpi/digital_camera/digital_camera.html

https://www.instructables.com/id/Connect-Camera-to-Zybo-Board/


https://www.fpga4student.com/2018/08/basys-3-fpga-ov7670-camera.html

https://projects.digilentinc.com/cc-ad/cmos-sensor-camera-system-9f74f8

The last projects seems to be most comprehensive and interesting, but also much complex than others from given list.

I will be graceful for any hints how to start with such project.

I am going to start with this project (it seems to me be rudimentary):

https://www.fpga4student.com/2018/08/basys-3-fpga-ov7670-camera.html

Thanks in advance and Regards
 
Last edited:

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
17,465
Helped
3,945
Reputation
7,888
Reaction score
3,815
Trophy points
113
Activity points
115,787
Hi,

What I'd do:
* contact the manufacturer
* sign the NDA
* get support (datasheets, application notes)

Klaus
 

FlyingDutch

Full Member level 4
Joined
Dec 16, 2017
Messages
200
Helped
28
Reputation
56
Reaction score
31
Trophy points
28
Location
Bydgoszcz - Poland
Activity points
2,081
Hi,

What I'd do:
* contact the manufacturer
* sign the NDA
* get support (datasheets, application notes)
it is
Klaus
Hello Klaus,

I am afraid that I wouldn't be able to know manufacturer (this is product from Chinese internet shop). I found the basic datasheet for OV7670 CMOS camera, but I think I can't do more. I think first I will buy the module without FIFO buffer and if it will working with FPGA board then I try the module with FIFO buffer.


BTW: I found on product image (this cameramodule with FIFO buffer) that the FIFO is based on "AVERLOGIC AL422B" chip. Here is link to documentation:

https://docs.rs-online.com/101c/0900766b810246d6.pdf

There are basic information and timing diagrams, I think it is enough information to connect it to FPGA.

Kind Regards
 
Last edited:

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
17,465
Helped
3,945
Reputation
7,888
Reaction score
3,815
Trophy points
113
Activity points
115,787
Hi,

Nonsense (excuse me)
Most hits of an internet search tell that the manufacturer is "OmniVision" and even a lot of them lead to their internet site www.ovt.com.

My recommendation: For any electronic part the first place of information should be the manufacturer. They are most reliable, they have the most experience and they provide them for free because the want to sell their parts.

Klaus
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
46,986
Helped
13,938
Reputation
28,124
Reaction score
12,576
Trophy points
1,393
Location
Bochum, Germany
Activity points
273,965
There are basic information and timing diagrams, I think it is enough information to connect it to FPGA.
I agree. The FIFO version is particularly interesting if your host hardware isn't able to keep up with the OV7670 pixel rate. This problem shouldn't occur with a FPGA system.
 

    FlyingDutch

    points: 2
    Helpful Answer Positive Rating

fenglei

Newbie level 5
Joined
Jul 22, 2020
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Shang hai,China
Activity points
49
Last edited:

FlyingDutch

Full Member level 4
Joined
Dec 16, 2017
Messages
200
Helped
28
Reputation
56
Reaction score
31
Trophy points
28
Location
Bydgoszcz - Poland
Activity points
2,081
Hi,I have done some work on OV7670、OV5640 sensor and both sensor has no buffer.First,if your pcb board has enough interface for sensor module and your pcb layout has done the Signal Integrity problem,the only problem can be coding、simulation and testing.To deal with sensor without buffer ,you will need a fifo in the FPGA hierarchy.
Hello,
I had finished that project successfuly some time ago. I used QMTECH Artix7 FPGA board - see link:

QMTECH Artix7 FPGA board

Camera sensor OV7670 is working properly, but with resolution 320x240. I had to modify project a little - constarint file for Artix7 QMTECH FPGA board is"
Code:
## Pin assignment
    
set_property CFGBVS VCCO [current_design]
set_property CONFIG_VOLTAGE 3.3 [current_design]
set_property BITSTREAM.CONFIG.UNUSEDPIN PULLUP [current_design]
#############SPI Configurate Setting##################
set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 4 [current_design]
set_property CONFIG_MODE SPIx4 [current_design]
set_property BITSTREAM.CONFIG.CONFIGRATE 50 [current_design]
############## clock and reset define##################
create_clock -period 20.000 [get_ports clk100]
set_property IOSTANDARD LVCMOS33 [get_ports clk100]
set_property PACKAGE_PIN M22 [get_ports clk100]
set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets {Inst_PLL/clkin1}]   

    ##VGA Connector
    set_property PACKAGE_PIN AB26 [get_ports {vga_r[0]}]               
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_r[0]}]
    set_property PACKAGE_PIN AC26 [get_ports {vga_r[1]}]               
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_r[1]}]
    set_property PACKAGE_PIN AB24 [get_ports {vga_r[2]}]               
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_r[2]}]
    set_property PACKAGE_PIN AC24 [get_ports {vga_r[3]}]               
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_r[3]}]
    set_property PACKAGE_PIN AA24 [get_ports {vga_b[0]}]               
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_b[0]}]
    set_property PACKAGE_PIN AB25 [get_ports {vga_b[1]}]               
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_b[1]}]
    set_property PACKAGE_PIN AA22 [get_ports {vga_b[2]}]               
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_b[2]}]
    set_property PACKAGE_PIN AA23 [get_ports {vga_b[3]}]               
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_b[3]}]
    set_property PACKAGE_PIN Y25 [get_ports {vga_g[0]}]               
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_g[0]}]
    set_property PACKAGE_PIN AA25 [get_ports {vga_g[1]}]               
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_g[1]}]
    set_property PACKAGE_PIN W25 [get_ports {vga_g[2]}]               
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_g[2]}]
    set_property PACKAGE_PIN Y26 [get_ports {vga_g[3]}]               
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_g[3]}]
    set_property PACKAGE_PIN Y22 [get_ports vga_hsync]                       
        set_property IOSTANDARD LVCMOS33 [get_ports vga_hsync]
    set_property PACKAGE_PIN Y23 [get_ports vga_vsync]                       
        set_property IOSTANDARD LVCMOS33 [get_ports vga_vsync]

## LEDs
set_property PACKAGE_PIN J6 [get_ports {config_finished}]                   
    set_property IOSTANDARD LVCMOS33 [get_ports {config_finished}]
                    
##Buttons
set_property PACKAGE_PIN H7 [get_ports btnc]                       
    set_property IOSTANDARD LVCMOS33 [get_ports btnc]
set_property PACKAGE_PIN J8 [get_ports btnl]                       
     set_property IOSTANDARD LVCMOS33 [get_ports btnl]
set_property PACKAGE_PIN H21 [get_ports btnr]                       
         set_property IOSTANDARD LVCMOS33 [get_ports btnr]
## OV7670 Camera header pins

##Pmod Header JB
##Sch name = JB1
set_property PACKAGE_PIN W21 [get_ports {ov7670_pwdn}]                   
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_pwdn}]
##Sch name = JB2
set_property PACKAGE_PIN Y21 [get_ports {ov7670_data[0]}]                   
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[0]}]
##Sch name = JB3
set_property PACKAGE_PIN V26 [get_ports {ov7670_data[2]}]                   
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[2]}]
##Sch name = JB4
set_property PACKAGE_PIN W26 [get_ports {ov7670_data[4]}]                   
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[4]}]
##Sch name = JB7
set_property PACKAGE_PIN U25 [get_ports {ov7670_reset}]                   
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_reset}]
##Sch name = JB8
set_property PACKAGE_PIN U26 [get_ports {ov7670_data[1]}]                   
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[1]}]
##Sch name = JB9
set_property PACKAGE_PIN V24 [get_ports {ov7670_data[3]}]                   
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[3]}]
##Sch name = JB10
set_property PACKAGE_PIN W24 [get_ports {ov7670_data[5]}]                   
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[5]}]
 

##Pmod Header JC
##Sch name = JC1
set_property PACKAGE_PIN V23 [get_ports {ov7670_data[6]}]                   
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[6]}]
##Sch name = JC2
set_property PACKAGE_PIN V21 [get_ports ov7670_xclk]                   
    set_property IOSTANDARD LVCMOS33 [get_ports ov7670_xclk]
##Sch name = JC3
set_property PACKAGE_PIN W23 [get_ports ov7670_href]                   
    set_property IOSTANDARD LVCMOS33 [get_ports ov7670_href]
##Sch name = JC4
set_property PACKAGE_PIN V18 [get_ports ov7670_siod]                   
    set_property IOSTANDARD LVCMOS33 [get_ports ov7670_siod]
    set_property PULLUP TRUE [get_ports ov7670_siod]
##Sch name = JC7
set_property PACKAGE_PIN W18 [get_ports {ov7670_data[7]}]                   
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[7]}]
##Sch name = JC8
set_property PACKAGE_PIN U22 [get_ports ov7670_pclk]                   
    set_property IOSTANDARD LVCMOS33 [get_ports ov7670_pclk]
    set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets {ov7670_pclk_IBUF}]
##Sch name = JC9
set_property PACKAGE_PIN V22 [get_ports ov7670_vsync]                   
    set_property IOSTANDARD LVCMOS33 [get_ports ov7670_vsync]
##Sch name = JC10
set_property PACKAGE_PIN U21 [get_ports ov7670_sioc]                   
    set_property IOSTANDARD LVCMOS33 [get_ports ov7670_sioc]
In attachement is ziped full project for Vivado 2018.3.(working properly). I have to made VGA DAC based on resitors - here is schematics (get from Basys3 FPGA board):


VGA_REz.PNG

If you have code in HDL for this (OV7670) or similaiar camera sensor and you would like share it then I will be happy .

Best regards
 

Attachments


fenglei

Newbie level 5
Joined
Jul 22, 2020
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Shang hai,China
Activity points
49
Hello,
I had finished that project successfuly some time ago. I used QMTECH Artix7 FPGA board - see link:

QMTECH Artix7 FPGA board

Camera sensor OV7670 is working properly, but with resolution 320x240. I had to modify project a little - constarint file for Artix7 QMTECH FPGA board is"
Code:
## Pin assignment
 
set_property CFGBVS VCCO [current_design]
set_property CONFIG_VOLTAGE 3.3 [current_design]
set_property BITSTREAM.CONFIG.UNUSEDPIN PULLUP [current_design]
#############SPI Configurate Setting##################
set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 4 [current_design]
set_property CONFIG_MODE SPIx4 [current_design]
set_property BITSTREAM.CONFIG.CONFIGRATE 50 [current_design]
############## clock and reset define##################
create_clock -period 20.000 [get_ports clk100]
set_property IOSTANDARD LVCMOS33 [get_ports clk100]
set_property PACKAGE_PIN M22 [get_ports clk100]
set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets {Inst_PLL/clkin1}]

    ##VGA Connector
    set_property PACKAGE_PIN AB26 [get_ports {vga_r[0]}]            
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_r[0]}]
    set_property PACKAGE_PIN AC26 [get_ports {vga_r[1]}]            
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_r[1]}]
    set_property PACKAGE_PIN AB24 [get_ports {vga_r[2]}]            
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_r[2]}]
    set_property PACKAGE_PIN AC24 [get_ports {vga_r[3]}]            
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_r[3]}]
    set_property PACKAGE_PIN AA24 [get_ports {vga_b[0]}]            
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_b[0]}]
    set_property PACKAGE_PIN AB25 [get_ports {vga_b[1]}]            
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_b[1]}]
    set_property PACKAGE_PIN AA22 [get_ports {vga_b[2]}]            
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_b[2]}]
    set_property PACKAGE_PIN AA23 [get_ports {vga_b[3]}]            
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_b[3]}]
    set_property PACKAGE_PIN Y25 [get_ports {vga_g[0]}]            
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_g[0]}]
    set_property PACKAGE_PIN AA25 [get_ports {vga_g[1]}]            
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_g[1]}]
    set_property PACKAGE_PIN W25 [get_ports {vga_g[2]}]            
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_g[2]}]
    set_property PACKAGE_PIN Y26 [get_ports {vga_g[3]}]            
        set_property IOSTANDARD LVCMOS33 [get_ports {vga_g[3]}]
    set_property PACKAGE_PIN Y22 [get_ports vga_hsync]                    
        set_property IOSTANDARD LVCMOS33 [get_ports vga_hsync]
    set_property PACKAGE_PIN Y23 [get_ports vga_vsync]                    
        set_property IOSTANDARD LVCMOS33 [get_ports vga_vsync]

## LEDs
set_property PACKAGE_PIN J6 [get_ports {config_finished}]                
    set_property IOSTANDARD LVCMOS33 [get_ports {config_finished}]
                 
##Buttons
set_property PACKAGE_PIN H7 [get_ports btnc]                    
    set_property IOSTANDARD LVCMOS33 [get_ports btnc]
set_property PACKAGE_PIN J8 [get_ports btnl]                    
     set_property IOSTANDARD LVCMOS33 [get_ports btnl]
set_property PACKAGE_PIN H21 [get_ports btnr]                    
         set_property IOSTANDARD LVCMOS33 [get_ports btnr]
## OV7670 Camera header pins

##Pmod Header JB
##Sch name = JB1
set_property PACKAGE_PIN W21 [get_ports {ov7670_pwdn}]                
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_pwdn}]
##Sch name = JB2
set_property PACKAGE_PIN Y21 [get_ports {ov7670_data[0]}]                
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[0]}]
##Sch name = JB3
set_property PACKAGE_PIN V26 [get_ports {ov7670_data[2]}]                
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[2]}]
##Sch name = JB4
set_property PACKAGE_PIN W26 [get_ports {ov7670_data[4]}]                
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[4]}]
##Sch name = JB7
set_property PACKAGE_PIN U25 [get_ports {ov7670_reset}]                
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_reset}]
##Sch name = JB8
set_property PACKAGE_PIN U26 [get_ports {ov7670_data[1]}]                
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[1]}]
##Sch name = JB9
set_property PACKAGE_PIN V24 [get_ports {ov7670_data[3]}]                
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[3]}]
##Sch name = JB10
set_property PACKAGE_PIN W24 [get_ports {ov7670_data[5]}]                
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[5]}]


##Pmod Header JC
##Sch name = JC1
set_property PACKAGE_PIN V23 [get_ports {ov7670_data[6]}]                
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[6]}]
##Sch name = JC2
set_property PACKAGE_PIN V21 [get_ports ov7670_xclk]                
    set_property IOSTANDARD LVCMOS33 [get_ports ov7670_xclk]
##Sch name = JC3
set_property PACKAGE_PIN W23 [get_ports ov7670_href]                
    set_property IOSTANDARD LVCMOS33 [get_ports ov7670_href]
##Sch name = JC4
set_property PACKAGE_PIN V18 [get_ports ov7670_siod]                
    set_property IOSTANDARD LVCMOS33 [get_ports ov7670_siod]
    set_property PULLUP TRUE [get_ports ov7670_siod]
##Sch name = JC7
set_property PACKAGE_PIN W18 [get_ports {ov7670_data[7]}]                
    set_property IOSTANDARD LVCMOS33 [get_ports {ov7670_data[7]}]
##Sch name = JC8
set_property PACKAGE_PIN U22 [get_ports ov7670_pclk]                
    set_property IOSTANDARD LVCMOS33 [get_ports ov7670_pclk]
    set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets {ov7670_pclk_IBUF}]
##Sch name = JC9
set_property PACKAGE_PIN V22 [get_ports ov7670_vsync]                
    set_property IOSTANDARD LVCMOS33 [get_ports ov7670_vsync]
##Sch name = JC10
set_property PACKAGE_PIN U21 [get_ports ov7670_sioc]                
    set_property IOSTANDARD LVCMOS33 [get_ports ov7670_sioc]
In attachement is ziped full project for Vivado 2018.3.(working properly). I have to made VGA DAC based on resitors - here is schematics (get from Basys3 FPGA board):


View attachment 163197

If you have code in HDL for this (OV7670) or similaiar camera sensor and you would like share it then I will be happy .

Best regards
Hi,
The following file is found on the internet.And it involved configuration to ov7670 sensor and data receiving from sensor.The problem in image scale may refers to configuration.
At last,do you used the software weak pull-up on the SDA signal.
 

Attachments

Last edited:

FlyingDutch

Full Member level 4
Joined
Dec 16, 2017
Messages
200
Helped
28
Reputation
56
Reaction score
31
Trophy points
28
Location
Bydgoszcz - Poland
Activity points
2,081
Hello,

I will look into files that you attached to your post this weekend. The smaller resolution in project I implemented had been intended (on original Basys3 FPGA board there was to little BRAM memory for full VGA buffer and only every fourth pixel was captured). ON my QMTECH FPGA board is enough BRAM memory to implement full VGA frame-buffer and I am going to change resolution to higher in the near future :)

Best Regards
 

Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top