AN75779 with MT9P031 monochrome -- close but not quite?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
sbattazzo_arc
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

Hi all,

I'm trying to use the AN75779 project as a baseline to set up my MT9P031 as a UVC camera.

Here's what I did:

Modify GPIF state machine: changed to 16 bit wide bus with one clock per pixel, changed LD_ADDR_COUNT and LD_DATA_COUNT limits to 8183 to account for this. Changed the active clock edge to falling.

In order to fake the YUY2 I tied data 15 high and 14:8 low so the upper byte would be 0x80. Then I just attached my most significant 8 bits of my camera bus to data lines 7:0.

Overhaul to the I2C in sensor.c code. The MT9M114 uses two bytes of register addresses in its protocol while the MT9P031 only has one so I had to get rid of the upper address byte in all the functions. I got rid of all of the configuration for MT9M114 and only wrote in commands to set my sensor up to run 720p at whatever rate it runs. I figured initially setting the sensor up to do 720p to match the existing project would be the path of least resistance.

I have a 24MHz clock and the datasheet suggests it would get 60fps with 96MHz so I assume it's actually going to give 15fps instead of 30.

In the UVC Descriptor C file, I've tried just leaving everything alone, as well as increasing the frame time to double or four times the original (so 0xA2C2A or 0x145854) to account for a lower FPS but nothing is helping.

The result is that Windows recognizes the device as a camera and I'm able to select it with the Windows camera app, and I see some response on the debug serial port when I do select or de-select it.

With the additional debug print enabled, I see "UVC: Completed (n) frames and 0 buffers."

Ultimately though I just get a black screen.

Do I need to use the PLL to increase my clock rate to actually achieve 30fps? Or do I need to adjust the minimum bitrate in the descriptor to reflect what the camera actually puts through?

Or am I missing something else?

 

Thanks in advance!

0 Likes
1 Solution
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi,

If the descriptors, and probe control structure is fine, then you should be able to stream in super speed as well.

You can try to take wireshark trace to see if any uvc request is failing.

Regards,

Hemanth

View solution in original post

0 Likes
4 Replies
sbattazzo_arc
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

One update --- I am seeing video in VLC or Windows camera app, if I set the interface to high speed rather than super speed.

I tried tying my 8 most significant bits to zero to allow the 8 LSBs to be monochrome data as I mentioned before, but that part seems not to be working quite right and my image is some combination of green and magenta, but I'm sure that part of the problem will sort itself. Just have to figure out why high speed VGA resolution almost works OK but superspeed does not at all?

0 Likes
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi,

If it is working with High speed, then the frame size sent by the sensor is 640*480*2 bytes.

When you are testing with super speed, frame size indicated in descriptors is 1280*720*2 bytes.

Is the camera configuration changed accordingly when tested with super speed? Or the same camera configuration which worked for high speed is being used for super speed as well?

Also make sure probe control structure (glProbeCtrl - for super speed) is filled correctly.

Regards,

Hemanth
0 Likes

Thanks for the reply!

I actually went ahead and tried changing my high speed mode resolution to 720p, because my lower clock rate brings it down to a rate that we can achieve 720p just fine even in HS mode. So yes, I can say that the same camera configuration that doesn't work for super speed does work fine for high speed. I copied and pasted the frame size line over from the SS descriptor to HS.

I was able to fix the magenta/green thing by swapping the endianness on the GPIF state machine, I think I had changed it to Big Endian in my various trial and error attempts along the way... setting it back to LE was good.

I don't need a high capture rate so I don't know if I mind if SuperSpeed doesn't work, I can just swap my cable out for a USB2 cable and call it a day most likely.

0 Likes
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi,

If the descriptors, and probe control structure is fine, then you should be able to stream in super speed as well.

You can try to take wireshark trace to see if any uvc request is failing.

Regards,

Hemanth
0 Likes