VL504 - System Design with FPGAs - course project @ IIITB, under Professor Nanditha Rao
Displaying video on a VGA monitor using an OV7670 camera
For more details on the project, see the project report in this repo. Additional references are mentioned at the bottom of the report.
- A Basys 3 development board. An equivalent is fine, but the pinouts will change.
- An OV7670 module(without the FIFO chip)
- A VGA monitor and VGA cable.
- USB wire for programming the dev-board(comes with it).
-
Create a new Vivado project
-
Add the following source files:
- Add all the files in the
src/ov7670_with_vga/
folder (including thesrc/ov7670_with_vga/ov7670/
folder). - Add all the files inside the
src/vga/
folder.
- Add all the files in the
-
Add
constraints/ov7670_constraints.xdc
file as a constraint. -
Generate the bitstream.
-
While Vivado is generating the bitstream, make the following connections:
- Connect a VGA monitor to the Basys 3 board
- Wire the OV7670 camera module as per the mapping given in:
ov7670_basys3_wiring.txt
-
Upload and run the program.
-
Create a new Vivado Project
-
Add the following files as sources to the project:
- All the files in the
src/vga/
folder. - The file in the
src/uart/
folder. - The
src/vga_over_uart_controller.v
file.
- All the files in the
-
Add
constraints/vga_over_uart_constraints.xdc
as a constraint. -
Install the following packages in Python:
- Numpy
- Matplotlib
- imageio[ffmpeg] <-- this is the exact name
- Pyserial
-
Generate the bitstream for the project in Vivado
-
Meanwhile, connect the VGA monitor to the Basys 3 board, plug in the programming cable and power on the Basys 3 board.
-
Find which COM port is being used by Basys 3. This will vary depending on your OS.
-
Open
scripts/vga_over_uart.py
. Edit line 10 to the COM port used by Basys 3. -
If you are on Linux/MacOS, you need to give write access to the comport. This can be done using
sudo chmod a+rw <COMPORT>
-
Run the
video_over_uart.py
program, and see the results on the VGA monitor. There are a variety of options in the script, which are well documented there. Feel free to play with them.
.
├── constraints
│ ├── ov7670_constraints.xdc
│ └── vga_over_uart_constraints.xdc
├── images # All the images used for the report/project. The files name are self-explanatory
│ ├── report-images
│ ├── sccb-simulation
│ ├── us.jpg
│ ├── vga_from_ov7670
│ ├── vga-over-uart
│ └── vga-simulation
├── ov7670_basys3_wiring.txt # Wiring diagram for the OV7670 module
├── scripts
│ ├── create_coe.py # Script to generate a coefficient file
│ ├── data.py
│ ├── downscale.m # MATLAB script to generate a data file from an image file
│ ├── mapping.py
│ └── video_over_uart.py # Sending video data over UART
├── simulation
│ ├── sccb
│ │ └── sccb_configuration_tb.v
│ └── vga
│ └── vga-tb.v
└── src
├── our-sccb
│ └── sccb_configuration.v
├── ov7670_with_vga
│ ├── ov7670
│ │ ├── camera_configuration.v
│ │ ├── camera_read.v
│ │ ├── OV7670_configuration_rom.v
│ │ ├── OV7670_configuration.v
│ │ ├── SCCB_configuration.v
│ │ └── top_camera.v
│ └── top_controller.v
├── uart
│ └── uart_rx.v
├── vga
│ ├── h_sync.v
│ ├── vga.v
│ └── v_sync.v
└── vga_over_uart_controller.v
For implementation based queries, feel free to raise an issue.