Giter Club home page Giter Club logo

deca_usb3_cam's Introduction

DECA_USB3_Cam

Streaming video over USB 3.0 using MAX10 FPGA and CYUSB3014 synchronous slave mode.

Video: Video

Block diagram

                        ____________________________________
                       |                FPGA                |
            ______     |  ________       __________         |    ___________
           |      |    | | CAMERA |     | MAIN FSM |        |   |           |
           |CAMERA|----->| CAPTURE|<--->| & FIFO   |<---------->| CYUSB3014 |
           |______|    |  --------       ----------         |   |___________|
               ^       |  ________            |             |
               |       | | CAMERA |           |             |
               ----------| CONFIG |           |             |
                       |  --------            |             |
                       |          Pixel clock | USB clock   |
                       |          domain      | domain      |
                       |______________________|_____________| 

Top level module parameters

Top level module parameters define image resolution, color mode (grayscale or RGB565), camera I2C address and camera registers memory init file.

Parameter Description
IM_X Image width
IM_Y Image height
COLOR_MODE 1 - Grayscale, 2 - RGB565
FPGA_PROCESSING 1 - Convert RGB565 -> 8-bit Grayscale, 2 - No processing
CAMERA_ADDR Camera I2C address
MIF_FILE Camera registers memory init file
FAST_SIM 0 - Normal mode, 1 - Fast sim mode, skip camera initialization

Camera configuration module

The camera configuration module initializes camera registers based on mif file and I2C address.

Camera capture module

When configuration is done and start_stream signal set by the main FSM, the module waits for VSYNC falling edge and then captures pixel data from the camera by parallel DVP interface. If grayscale mode has been selected, the module converts RGB565 -> RGB888 -> 8-bit grayscale using simple pipeline. Otherwise, pixel data is written straight to the FIFO.

Main FSM

The main FSM module handles the following commands from the PC:

Command Description
0x0101 Get image parameters
0x1111 Start video stream
0x0f0f Stop video stream

After receiving the get image parameters command, a six-byte image parameters packet will be sent to the PC.

Byte Parameter Description
0 IM_TYPE Grayscale - 0xAA, RGB565 - 0xBB
1 NONE Reserved
2-3 IM_X Image width
4-5 IM_Y Image height

Hardware

This design is based on the ARROW DECA, Cypress CYUSB3KIT-003 development kit and OV5642 camera module.

CYUSB3014 settings

This design uses CYUSB3014 synchronous slave mode with a 16-bit data bus. The clock signal is generated by the CYUSB3014. Two auto DMA channels are used to move data. The FX3 SDK is required to build the firmware.

DMA Channel DMA buffer size DMA buffer count
USB -> FPGA 1024 bytes 1
FPGA -> USB 16384 bytes 4

Software

Simple python-based client are included. Tested on Ubuntu linux and Windows 10 (WinUSB driver).
Dependencies: Python 3.7+, NumPy, OpenCV, libusb-1.0, python-libusb1

deca_usb3_cam's People

Contributors

korob14 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.