Monday, December 2, 2019

DIY USB 3.0 Camera: UVC Video Device Class VGA Camera Using Cypress FX3

This Project is going to next in the series of previous projects. Previously i interfaced inexpensive OV7670 VGA Camera to MCU.

In this post we will overcome the 10FPS limit of frame rate caused by slow Parallel port of PIC32MZ. This version of Camera will use 4.8Gbps Cypress FX3 USB 3.0  controller, with use of this controller comes 32bit 100Mhz GPIF interface, which make it possible to easily implement 30 FPS 640x480 live video transfer. 

Capability of Cypress FX3 is way higher than VGA 30FPS, but for this test project i will be limited the by the max resolution of OV7670. 

Hardware Connection

FX3 has Extremely flexible 32bit 100Mhz GPIF II interface for picking up data from external application processor/Data Producer. OV7670 Connected to GPIF II with 8bit prallel bus with Hsync and Vsyn line. GPIF is driver as slave with interface clock supplied from the camera pixel clock.

Here is how camera is connected to FX3

Signal CLK is pixel clock generated by camera
GPIF interface is Driven by a state machine , Here is the state machine which i used to latch data into DMA buffers. this state machine is from cypress FX3 application note AN75779 more details about can be found in the PDF document by cypress.

Test with VLC 


Firmware as usual can be found in my github account


  1. In Hardware Connection: - OV7670 has two clock PCLK and External clock. Here you mention only one clock connected GPIO16 of Fx3.

  2. How to interface PIXCLK,SCL,SDA of OV7670 with FX3?

    1. External clock for the camera in my demo is supplied from signal generator.
      Camera need external clock , either have a external oscillator or use a signal gen.

      PCLK is output from camera and input to FX3. While XCLK is input to camera and not connected to FX3.