Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

Project Components

  • Hardware

Spartan-7 SP701 FPGA with MIPI interface implemented using resistor network

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

OV5640 MIPI interface

  • Software

AMD Vivado version 2020 or above

AMD Vitis 2020

Introduction

MIPI interface is very popular now, and domestic FPGAs generally come with MIPI interfaces. AMD-Xilinx started supporting MIPI levels from the U+ series. From the usage in China, the Spartan-7 FPGA is the most widely used device, so this example uses the Spartan-7 FPGA to implement MIPI levels using a resistor network. For specific hardware solutions, see:

Xilinx FPGA MIPI Interface Simple Explanation

Setting Up the Project

For this project, it is recommended to use Vivado version 2020 or above, as MIPI IP is now free.

Step 1: Create a Vivado Project

Run Vivado

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

(1) “Create Project” –> (2) Click “Next”

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

Specify (1) “Project Name” –> (2) Specify Project Directory –> (3) Set Checkboxes –> (4) Click “Next”

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

(1) Select Project Type –> (2) Set Checkboxes –> (3) Click “Next”

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

(1) Select the “Boards” tab –> (2) Find and select SP701 –> (3) Click “Next”

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

(1) Click “Finish”

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

Step 2: Generate Example Design

In Vivado, (1) “Create Block Design” –> (2) Click “OK”

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

(1) Click “+” or “Ctrl+I” –> (2) Type “mipi” in “Search” –> (3) Double-click “MIPI CSI-2 Rx Subsystem” IP core

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

(1) Right-click on IP –> (2) Select “Customize Block”

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

(1) Open the “Application Example Design” tab –> (2) Select “SP701” –> (3) Click “OK”

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

(1) Right-click on IP –> (2) Select “Open Example Design”

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

Click “OK” to save design changes

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

(1) Specify the directory for the example project (Note: Path on Windows must be as short as possible) –> (2) Set Checkboxes –> (3) Click “OK” –> (4) Click “OK”

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

The example project will open in a new Vivado window. Wait a few minutes for the project to build.

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

In the example project Vivado, (1) “Generate Bitstream” –> (2) Click “YES”

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

Wait for the bitstream to generate

Step 3: Hardware Testing

Connect the OV5640 sensor to the MIPI CSI interface on the FPGA board. Connect an HDMI display or MIPI display to the development board.

Step 4: Running Debugging

Open VITIS software from Vivado. (1) “Tools” –> (2) “Launch VITIS”

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

(1) Specify workspace (Select the provided mipi_csi2_rx_subsystem_0_ex :: SW :: xmipi_app) –> (2) “Launch”

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

Close the VITIS “Welcome” tab

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

Now you will see the software part of the project. Code for the MicroBlaze soft processor.

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

(1) Follow the arrow –> (2) Click “Debug Configurations”

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

(1) Double-click “Single Application Debug (GDB)” –> (2) Select “Debugger Executable” –> (3) Specify the bitstream.bit file generated by Vivado –> (4) Set Checkbox –> (5) Click “Debug”

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

Press the run button and follow the messages on the serial terminal

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS
Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

Conclusion

Generating an example project for the MIPI interface on the FPGA board from Vivado is very simple.

https://www.xilinx.com/products/boards-and-kits/sp701.html#resources

Building a MIPI Camera Interface with Spartan-7 FPGA and OV5640 in 15 Minutes Using VITIS

Leave a Comment

×