EEVblog Electronics Community Forum

Electronics => Microcontrollers => Topic started by: ezalys on December 10, 2018, 01:32:18 pm

Title: Best Inexpensive USB Hi-Speed Solution
Post by: ezalys on December 10, 2018, 01:32:18 pm
Hey all,

I'm looking for a simple and cheap way to have a USB hi-speed interface that can sustain 10 MB/s or so to an FPGA. Crucially, I need to be able to control the endpoints so it comes up under a specific device class... so these FTDI FIFO USB and UART USB ICs are not appropriate. The closest I've seen are the cypress FX2 chips but they're surprisingly expensive. There's also the XMOS ICs with built-in USB... which are pricey but can potentially subsume the FPGA I'd be interfacing to. Finally, some of the microchip/atmel SAM devices have USB 2 with on chip PHY. They seem pretty appealing. I could of course just stick a PHY on the board and make my FPGA speak ULPI but that sounds pretty time consuming. Any alternative chips/ideas?

E
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: xaxaxa on December 10, 2018, 02:45:25 pm
USB3343 PHY with this usb serial core: http://jorisvr.nl/article/usb-serial (http://jorisvr.nl/article/usb-serial)
Use this ULPI to UTMI bridge: http://vr5.narod.ru/fpga/usb/index.html (http://vr5.narod.ru/fpga/usb/index.html)

This is what I used in several of my projects; sustained throughput of 35MByte/s half duplex is possible.
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: T3sl4co1l on December 10, 2018, 03:32:55 pm
Most of the MCUs I've seen, have Full Speed PHY onboard, but not High Speed.  The HS core is integrated and the ULPI interface has to be connected to an external PHY.  YMMV, there's probably both available.

The desired bitrate would be adequate through MCU interfaces, though (maybe not QSPI, but a parallel port + DMA would seem like more than enough).  Kind of an odd solution pairing that with an FPGA, but sometimes that's the way, I guess.  It will run at least a few bucks extra -- not the cheapest solution in quantity.

The better way would be putting the ULPI controller inside the FPGA, which I'm sure is available, but yeah, probably harder to use.

Tim
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: ezalys on December 10, 2018, 04:09:45 pm
From xaxaxa's links it doesn't look like speaking ULPI is super super hard. Thanks!
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: lucazader on December 10, 2018, 06:50:10 pm
The STM32F730 series of chips has an inbuilt USB HS phy etc, and are quite cheap. They start at about $3@1k qty.

Just not 100% sure the best way to get the data into the chip. Maybe either qspi or the FMC (ram) interface?
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: Rasz on December 10, 2018, 08:34:37 pm
cypress FX2 chips but they're surprisingly expensive.

define expensive, I see them <$5 in 100 volume CY7C68013A
not to mention you can buy $5 whole FX2 dev boards
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: TimCambridge on December 10, 2018, 09:24:48 pm
Worth a look: FTDI FT93x, around $4.
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: SiliconWizard on December 11, 2018, 02:36:52 pm
Define inexpensive.

But you can take a look at the ATSAM3U. (Eg. https://www.microchip.com/wwwproducts/en/ATSAM3U2C (https://www.microchip.com/wwwproducts/en/ATSAM3U2C) )
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: PCB.Wiz on December 19, 2018, 12:41:38 am
The closest I've seen are the cypress FX2 chips but they're surprisingly expensive.

As mentioned above aliexpress shows CY7C68013A modules for $3.70 (yes, less than Cypress suggested chip selling price!) , and chips from $1.85


I'm looking for a simple and cheap way to have a USB hi-speed interface that can sustain 10 MB/s or so to an FPGA.

Cheapest ready to go HS-USB part I know of, is the FT4222H, but that comes in just below your 10MB/s target.
Nuvoton have MCUs with HS-USB, like NUC505, and M48x series have HS-USB
http://www.nuvoton.com/hq/products/microcontrollers/arm-cortex-m4-mcus/?__locale=en (http://www.nuvoton.com/hq/products/microcontrollers/arm-cortex-m4-mcus/?__locale=en)

or, there are FTDI FT601/FT600 that can do both HS-USB and  USB 3.0 (5G), designed for FPGA/ASIC interface
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: tggzzz on December 19, 2018, 08:46:18 am
There's also the XMOS ICs with built-in USB... which are pricey but can potentially subsume the FPGA I'd be interfacing to.

Without knowing your application and constraints, I would have thought that was a significant advantage.

You can download their IDE and verify that it could satisfy the timing constraints on the FPGA side of your application. The I/O port timings can easily be understood from their application notes, and they are very simple to configure in software.

The more interesting part is usually the "loop time", i.e. how frequently the software can feed the I/O. The IDE will specify that for you code without having to measure running code. It will, of course, presume that any I/O channel (i.e. port or comms to another core) is ready for I/O to occur. If another core isn't ready, then unsurprisingly it will stall the loop.

The certainty in the timings defined by the IDE should be compared and contrasted with the effects of an FPGA's place and route algorithms.

Be aware that
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: TimCambridge on December 19, 2018, 02:01:44 pm

Cheapest ready to go HS-USB part I know of, is the FT4222H, but that comes in just below your 10MB/s target.


FT4222H is capable and low cost but it has zero availability everywhere.
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: xaxaxa on December 19, 2018, 03:16:35 pm
Example instantiation of usb-serial and ulpi bridge:
https://github.com/xaxaxa-dev/vna/blob/master/vhdl/ulpi_serial.vhd

The module "ulpi_serial" connects to the ULPI phy signals and exposes a FIFO interface.

USB3343 is $1.3 on mouser at qty 1.
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: xaxaxa on December 19, 2018, 03:27:41 pm
On the software side the device shows up as a USB CDC device, meaning no special drivers are needed on linux/mac. Windows however ties drivers to USB ID, so I have spoofed VID/PID as 04b4:0008 (Cypress Semiconductor) to use it with this signed driver: http://www.cypress.com/documentation/software-and-drivers/usb-serial-software-development-kit (http://www.cypress.com/documentation/software-and-drivers/usb-serial-software-development-kit)
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: blueskull on December 20, 2018, 04:47:07 am
Do you need to crunch data? If you need a lot of multiplications and accumulations, consider Analog Devices ADSP-BF70x family.
Built-in DSP library in ROM, built-in large L2 RAM, built-in L1 and scratchpad, and built-in HS-USB.
The IDE & compiler will set you back $1000, and they offer free 30-day trial license. You can hack the license generation server to let it to spit a 3 year license.

They don't provide free USB libraries, unless you pay $8000 on uC-OSiii. They do provide a HAL level driver for USB without documentation for free with their IDE.
I was able to crack the uC-OSiii installer and extract the code, reverse engineer how it talks to the HAL driver, and document the ADI USB HAL driver.
based on the API document, I wrote a simple USB stack for BF70x with the help of forum member Alex, a few books, and USB spec.

If you decide to use the chip, I can post the code on GitHub.
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: AlexY on January 29, 2019, 09:41:31 am
Hi, blueskull
I've read about your difficulties with USB stack on BF-707 in this topic https://www.eevblog.com/forum/microcontrollers/blackfin-usb-driver/ (https://www.eevblog.com/forum/microcontrollers/blackfin-usb-driver/) as I faced this module by myself.
One of goals of my master's degree project is to transmit audio and video data through USB of this DSP.
So can I ask you to share your code?
Thanks in advance!
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: NANDBlog on January 29, 2019, 10:59:02 am
Most of the MCUs I've seen, have Full Speed PHY onboard, but not High Speed.  The HS core is integrated and the ULPI interface has to be connected to an external PHY.  YMMV, there's probably both available.

The desired bitrate would be adequate through MCU interfaces, though (maybe not QSPI, but a parallel port + DMA would seem like more than enough).  Kind of an odd solution pairing that with an FPGA, but sometimes that's the way, I guess.  It will run at least a few bucks extra -- not the cheapest solution in quantity.

The better way would be putting the ULPI controller inside the FPGA, which I'm sure is available, but yeah, probably harder to use.

Tim
Yes, HS requires much higher switching speeds than typical microcontollers. The signalling rate is 480MHz, while the internals of a MCU run much slower. The microcontrollers have different process nodes, that are optimized for power and not high speeds.

To be honest, I would rather use an FTDI or a Cypress chip, if you put ULPI or UTMI interface, then you either need to handle USB relevant things in your FPGA. There are blocks for that, but probably not free and for sure much more complicated. With an FTDI, you have a simple parallel bus.
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: technix on January 29, 2019, 11:47:03 am
The Cypress CY7C68013 has a USB 2.0 High Speed interface with built-in high speed PHY. Ditto Microchip ATSAM3X8E as used in Arduino Due.

If you have an FPGA already, how much logic does it takes to implement ULPI in the logic fabric? It might be better to use ULPI IP core and an external PHY instead. Some PHY even has crystal clock output, allowing you to clock the FPGA from a cheaper crystal resonator.
Title: Re: Best Inexpensive USB Hi-Speed Solution
Post by: blueskull on January 29, 2019, 06:12:05 pm
So can I ask you to share your code?
Thanks in advance!

I didn't pursue too much. To this point, I only have a simple code that enumerates.

You're welcome to further expand it.

Please PM me with your email address so I can send it to you.