IMPORTANT: Cypress Developer Community is transitioning on October 20th. To learn more and be prepared for this change, check out our latest announcement.
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

Not applicable

Hello, i need to be able to stream monochrome data from my MT9M001 sensor to somputer.

I have CYUSB3KIT-003, and i made small board for MT9M001, just like in UVC example, same coonections.

I rewrited intitialization code, and by sniffing I2C i can see, that sensor is corectly set by FX3, as well as i get VSYNC, HSYNC, PCLK, DATA[0..9]. Even from VirtualDub i can set gain a correectly via I2C, so FX3 does comunicate with computer.

But where is no image , only black screen, i know that compresion is YUY2, and it's not monochrome, and sine i am feeding data, i should get something, right ?




Also, how to change default format from 1280x720 to 1280x1024 @10b monochrome ??

Can any one help me out, since USB programming is not my speciality, i usualy work only with microcontrollers,so this is too much for me.




Thank you

2 Replies
Not applicable

Usually, follow this process when you're adding, deleting or changing a particular video setting (i.e resolution, framerate etc):




1. If you're adding a new setting, then you need to have a new Video Streaming Frame Descriptor and optionally a new Video Streaming Format Descriptor. In the cyfxuvcdscr.c file, go to the section that says "Class specific Uncompressed VS format descriptor". This tells the PC that the camera has a bunch of settings that follow this specific format. Under this format descriptor, you'll have one or more frame descriptors which specify the actual resolution(s) and framerate(s) supported by the camera.




For example, if you need to support RGB888 1280x720, YUV422 1920x1280 and YUV422 640x480, then your descriptor structure will be something like this:






    VS FRAME DESCIPTOR (1280 x 720)




    VS FRAME DESCIPTOR (1920 x 1280)


    VS FRAME DESCIPTOR (640 x 480)




In your situation, we'll ideally need to change both the format and frame descriptors. But since 10-bit monochrome is not supported by default, the best option is to use only 8 bits of the sensor output and send these 8-bits to Y. Hardcode the U/V byte to 0x80. With this design, you'll only need to change the frame descriptor and not the format descriptor.


In the frame descriptor, look at the field commented with "Width in pixel" and "Height in pixel" and change these to 1280 and 1024. Also change the subsequent bitrate fields to the correct bit rate (i.e width x height x fps x 8).




2. If you add more video settings, then you need to filter the host requests and handle them accordingly. In UVCHandleVideoStreamingRqts(..), the GET_CUR and SET_CUR handlers under PROBE_CTRL and COMMIT_CTRL need to be changed.




The PC sends out the desired frame descriptor ID in a structure which you need to read and then change the sensor's config to that setting.

New Contributor II


May I know how to calculate min.bit rate and max. bit rate for /* Class specific Uncompressed VS frame descriptor */   in cyfxuvcdscr.c