5 Replies Latest reply on Oct 28, 2020 2:39 AM by YashwantK_46

    CYUSB3KIT-003+AN75779 for OV7725 and OV5640not working

    mata_4758791

      CYUSB3KIT-003+AN75779 not working

       

      anybody could help me?

       

      I configure 2 board with ov7725, to get easy analysis, I use a very slow rate: 640*480*30FPS, YUV2.

       

      I'm sure that both I2C image sensor configuration are OK! the image sensor is giving the right signal.

       

      (1) my customer board cyusb3014+FPGA+imagesensor, I use FPGA as an intermediate device to capture signals to my PC for analysis , FPGA get imagesensor signals and then forward to cyusb3014, the job is extremely simple, all meaning ful FPGA code is given as follows,

       

      reg LV_reg=0,FV_reg=0,PCLK_reg=0;

      reg [15:0]DQ_reg;

      always@(posedge cmos_pclk)begin

         LV_reg  <= cmos_href;

         FV_reg  <= cmos_vsync;

         DQ_reg <= {8'd0,cmos_data};

      end

      always@(posedge cmos_pclk)begin

         LV <= LV_reg;

         FV <= FV_reg;

         DQ <= DQ_reg;

      end

      assign PCLK = cmos_pclk;

       

      where LV, FV, DQ, PCLK are output wires to cyusb3014 directly

      The custom board works fine!

       

      (2) the same code was used for CYUSB3KIT-003, but I cannot get a trace of image. (FAILED anyway)

      the configuration is similar to

      https://www.circuitvalley.com/2019/06/opensource-diy-usb-webcam-ov7670-ov2640-pic32-USB-UVC-Video-device-class.html

       

      I cannot figure out what is the problem....

        • 1. Re: CYUSB3KIT-003+AN75779 for OV7725 and OV5640not working
          mata_4758791

          By the way, I tested both OV5640 and OV7725, it is the same problem, I never get a trace of image signal from CYUSB3KIT-003.

          For I2C sensors configuration, just uncomment the SensorInit() function when use CYUSB3KIT-003 (when no FPGA configuration available). and I can see that the ID are read OK, wave frequency is OK. for OV7725, PCLK is 24M as configured in the program.

           

          Debug print for CYUSB3KIT-003

          [2020-10-26 12:56:25.645]# RECV ASCII>

          Sensor Reset OK...

           

          [2020-10-26 12:56:25.804]# RECV ASCII>

          OK: Sensor configuration done!

          UsbEventCB: Detected SS USB Connection

          USBSetupCB:In SET_FTR 0::1

          USBSetupCB:In SET_FTR 0::1

          USBSetupCB:In SET_FTR 0::1

          USBSetupCB:In SET_FTR 0::1

           

          [2020-10-26 12:56:26.684]# RECV ASCII>

          Current SM state: 0

          UVC: Completed 0 frames and 0 buffers

           

          [2020-10-26 12:56:27.660]# RECV ASCII>

          Current SM state: 0

          UVC: Completed 0 frames and 0 buffers

           

          [2020-10-26 12:56:28.645]# RECV ASCII>

          Current SM state: 0

          UVC: Completed 0 frames and 0 buffers

           

          [2020-10-26 12:56:29.392]# RECV ASCII>

          AppEntry: Current status = 0

          Application Started

          Current SM state: 1

          UVC: Completed 0 frames and 0 buffers

           

          [2020-10-26 12:56:30.355]# RECV ASCII>

          Current SM state: 12

          UVC: Completed 7 frames and 0 buffers

           

          [2020-10-26 12:56:31.331]# RECV ASCII>

          Current SM state: 7

          UVC: Completed 7 frames and 0 buffers

           

          [2020-10-26 12:56:32.309]# RECV ASCII>

          Current SM state: 6

          UVC: Completed 7 frames and 0 buffers

           

          [2020-10-26 12:56:33.291]# RECV ASCII>

          Current SM state: 6

          UVC: Completed 7 frames and 0 buffers

           

          [2020-10-26 12:56:34.262]# RECV ASCII>

          Current SM state: 6

          UVC: Completed 7 frames and 0 buffers

           

          [2020-10-26 12:56:34.996]# RECV ASCII>

          Clear feature request detected...

          AppEntry: Current status = 10

          Application Stopped

          Current SM state: 6

          UVC: Completed 0 frames and 0 buffers

           

          [2020-10-26 12:56:35.960]# RECV ASCII>

          Current SM state: 6

          UVC: Completed 0 frames and 0 buffers

           

          [2020-10-26 12:56:36.940]# RECV ASCII>

          Current SM state: 6

          UVC: Completed 0 frames and 0 buffers

          • 2. Re: CYUSB3KIT-003+AN75779 for OV7725 and OV5640not working
            YashwantK_46

            Hello,


            Please refer to the following KBA: UVC Troubleshooting Guide – KBA226722

             

            "the same code was used for CYUSB3KIT-003, but I cannot get a trace of image. (FAILED anyway)"

            => Can you please confirm what you mean by, "i cannot get a trace of image"?

            Does it mean that you are not able to see the HSYNC, VSYNC when probing using an Oscilloscope?

            If that's not the case, can you probe the HSYNC and VSYNC lines physically using an Oscilloscope and see if you are getting the data properly and share the traces with me?

             

            Regards,

            Yashwant

            • 3. Re: CYUSB3KIT-003+AN75779 for OV7725 and OV5640not working
              mata_4758791

              Dear Yashwant,

                  I'm very greatful for your attention´╝îsince this problem has stuck me for several days and I have no idea how to debug the problem.

                  I have several imagesensors, none of them can work with the CYUSB3KIT-003.

                  For OV5640, the configuration is perfect, product ID and manufacturing ID can be read correctly, but NO image data captured;

                  For OV7725, the IDs cannot be read correctly (I don't know why, since the I2c code was not open source); but the oscilloscope indicates the configuration is OK (e.g. by default VSYNC is low level, after configuration, the VSYNC signal turn high for each frame).

               

                Below info are for OV7725.

                The sensor is OK, the HREF and VSYNC is OK, when I start the program, I can see obvious change in the oscilloscope (which should be indication of sucessful configuration), attached please refer to the oscilloscope-images. The CYUSB3KIT-003 is a new one. I use oscilloscope and can see the signals, just the KIT doesn't work. Up till now I rarely observed anything captured data into the USB FIFO (sometimes a little bit, but rarely, indeed), no to say the whole image.

                The problem is quite strange, and  I have no idea where to start debugging the problem. The same code works perfect with my custom board (with FPGA).

               

                  I see the trouble shooting guide, since you know, the code works with my custom board, the settings such as DMA buffer or UVC descriptor should not be the problem. and I see the PCLK, VSYNC, HREF.

               

                Please guide me a little bit where I should start debugging the problem....

                I attached the last version (almost no change) being test today.

                Best regards with great thanks

              matthew

               

              HREF.pngPCLK.pngVSYNC.pngVSYNC2.png

              • 4. Re: CYUSB3KIT-003+AN75779 for OV7725 and OV5640not working
                mata_4758791

                Dear Yashwant,

                      I suppose I got the reason, the problem is the CYUSB3KIT-003 design.

                      I finally got the data transmitted to the PC, the image quality is very bad, sometimes totally blue, obviously som wrong data is sampled; but, anyway, it is sampling data, VSYNC and VHREF, PCLK signals should be correctly matched. It seems the customed connector (image sensor to the kit) is determined on the signal, may be a length match should be carefully selected according to this development kit.

                      I searched and found that lot of people has problem with this development kit with OV cameras when they use customed connectors, it is normal if they can not get the image with this kit, since THIS DEVELOPMENT KIT IS EXTREMELY PICKING on signal timing.

                      My FPGA board is carefully designed with impedence match, it is no so picking on incoming signals, that explains why I can get the image without any problem.

                     By the way, I didn't do any detailed study of the board routing yet, all the conclusions are based on my debuggin experience.

                 

                Best regards,

                Matthew Tan

                • 5. Re: CYUSB3KIT-003+AN75779 for OV7725 and OV5640not working
                  YashwantK_46

                  Hello Matthew,

                   

                  Please refer to Section 6 of the app note AN70707 which states, "If the GPIF lines are to be routed for more than 5 inches or routed through a medium that can cause impedance mismatch, we recommend doing signal integrity simulation using the EZ-USB FX3 IBIS model, and come up with a termination."

                   

                  It is necessary to maintain the impedance matching on the GPIF lines to get a proper sampling of the incoming data.

                  Also, it is recommended not to use jumper wires to transfer the high bandwidth video stream over to the GPIF interface from the image sensor.
                  A customer board needs to be built around the image sensor which can handle the incoming data and pass it effectively onto the FX3.

                   

                  " searched and found that lot of people has problem with this development kit with OV cameras when they use customed connectors, it is normal if they can not get the image with this kit, since THIS DEVELOPMENT KIT IS EXTREMELY PICKING on signal timing."

                  => The FX3 SuperSpeed Explorer Kit has an accessory to support the ON Semi MT9M114 (then Aptina MT9M114) image sensor with the means of an accessory board CYUSB3AAC-004A (then CYUSB3AAC-004) and you can find the hardware files for the interconnect board in the link inserted.


                  Please make a custom PCB interconnect board for the OV image sensor you are trying to use and test it.

                   

                   

                  Regards,
                  Yashwant