High speed USB devices

Apr 03, 2011 24 Replies

Hi,



I'm building a custom USB-camera. There will be an FPGA chip doing some simple data handling for the sensor data and after that the image needs to be transmitted to a PC or an embedded Linux computer.



Estimated raw data rate is almost 30 megabytes per second without any compression. Basically a single endpoint is enough for the task.



What are the available chips in addition to Cypress FX2, NXP ISP1581 ?



And how much compression will I be needing, i.e. what is the best performance available ?


OH2HVJ Mikko

On a project where we used the Cypress FX2 we were able to get data rates of about 32 MBytes/s, though I remember that some fine tuning on the FX2 side was needed to achieve this rate. So in theory you don't need compression.

imple

ance

It depends on the sensor and image, capturing frame or video. For example, we are dealing with single frame 2048x1536 24 bits color. The image is ~ 9MB raw and 150KB compressed. We have 96KB frame buffer on the controller. Our controller is capable of push/pull temporary storage data on the camera's SD card as well.

something like this in fifo mode:

formatting link
should do it. Or just a 2.0 phy and an usb 20.0 core, theres one on opencores I think

-Lasse

Simpler to just buy an existing camera.

You are obviously already in over your head.

Thanks for the comment. Can you remember what tuning did you do ? We managed to get 22MBytes/s just by requesting larger transfers from the Cypress API. This way the function did not return to user-mode code until a larger tranfer was done. This capped out with 8kB transfers.

Mikko OH2HVJ

formatting link

What kind of performance can be expected from the FT232H ?

USB2.0 IP core might indeed be quite interesting, does anyone here experience on them ? I do have an experienced FPGA guy in team, but would like to use as simple approach as possible.

Mikko OH2HVJ

Unfortunately I don't know the details (the fine tuning was not done by me). I vaguely remember it had to do something with configuring buffering and endpoints on the FX2 side to squeeze the last bit of performance out of it. I'm sorry I cannot be more specific than that.

T2232H.htm

ence on

s simple approach

One thing to consider is that you might have to run the FPGA at 400MHz for HS. Dedicated chips usually have internal PLL to multiple from slower external crystal (i.e. 12mHz).

Ok, thanks for giving faith anyway!

I remembered that I have USRP software radio that I used for a GPS project. I googled for USRP USB bandwidth and it seems that even 45MBytes/sec is possible!

Mikko

The UTMI interface runs at 60MHz, 8-bit wide. This route would be interesting, as we're size constrained and the PHY chips seems to be in almost tiny packages.

Mikko

t. I googled for

That's the USB bandwidth, but does not mean you can stream at max. speed without latency and delay. You must have enough buffers to take care of milli-seconds gaps. Otherwise, you will have scrambled pictures or black spots.

mode:

formatting link

ft2232H not ft232H, I've never used it but they claim 40Mbyte/sec in single channel fifo mode

-Lasse

ting, as

ges.

yeh, the phy does the serial-parallel, parallel-serial conversion clock recovery etc.

I'd think integrating the usb into the fpga it is unlikely that there will be any bottlenecks on the device side, with an external device you never know what limitations there might be

-Lasse

mode:

formatting link

FT232H should be similar to FT2232H in synchronous FIFO mode. However the FT232H has not been released yet.

Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

mode:

formatting link

you are right, I missed the significance of the H and assumed is was the old full-speed rs232 device

-Lasse

googled for

In most cases we have seen the bottle-necks on the PC side. The FX2 with the default 512 EP FIFO was sufficient to get to ~30MB/sec. The buffering and threading on the PC side has to be handled carefully. It will depend on the drivers you are using on the PC, how often you get the data (poll or block), and how many threads.

.chris

ject. I googled for

e

But the image sensor data is very critical in timing, you have to clock in 24 bits in parallel and reformat usb serial out. Buffering needs to be done at the FPGA side as well.

ect. I googled for

When you add the framing and bit-stuffing, 480Mbps becomes 40MBps. USB is an "expensive" protocol. And when using a "consumer grade graphical OS" streaming for anything other than direct disk reads/ writes is limited to about 1/2 of that.

Ask me how I know some time...

Fortunately in this application we'll have almost full control of the PC. The first version will be using the common consumer-grade OS, but later on there will be a custom Linux box on the other end of the USB.

We'll have a buffer for a few frames, so matching the sensor timing with USB traffic is 'easy'.

Thanks everyone, this was a very useful thread!

-- Mikko

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required