1
\$\begingroup\$

Im very new to the field of anything USB related, sorry in advance! I hope my question is clear in conveying my level of understanding and of what I wish to learn.


My project involves connecting a digital signal processor to a computer via a USB at as low cost as possible.

Ive found a chip that looks promising to ease in doing so, the USB3310C a "Hi-Speed USB Transceiver with ULPI Interface". Right now Im thinking of using a DSP (dsPIC33EP32MC202) to interface between the device sensors, logic and the ULPI provided by the USB transceiver.

What I think I need is some kind of library (C/C++) to run on the processor to manage the USB connection to the host, responding to tokens and such (Dont know much about how that works). What I need in the end is something that can advertise itself as my custom device, that I should then be able to exchange data with on the computer.

From how I see it there are five parts to this

  1. Slave side software that more simply handles the data itself, streaming to and from the computer, processing a stream of ~220MB/s.
  2. Slave side 'driver', controlling and responding to low level requests. (What I need)
  3. Slave side hardware, the physical layer.
  4. Host side drivers, I want to avoid having to create drivers, re-purposing another driver, maybe some kind of general purpose and cross platform driver.
  5. Host side software, some program to stream to and from the device.

I'm sure there is much more to know on this subject, but for now I just want to successfully send data around ~30MB/s from device to host, and a small amount of control data from host to device.

In summary, I need some way to interface with a USB host, having all the low level stuff managed by something other than myself so I can simply focus on the data itself. Ideally some kind of C/C++ library that can interface with the USB3310C chip, or some alternate low cost chip.

\$\endgroup\$
4
  • 2
    \$\begingroup\$ What you are trying to do is not simply at all and fairly unlikely to work on a first attempt. You should probably start with a simpler lower performance case to gain some experience with some of the challenges of working with USB. It's not clear that your chosen parts are compatible, and it seems fairly unlike that your external DSP would be faster than using the PC's processor to do the task, even without the latency and complication of getting data out to the peripheral and results back in. \$\endgroup\$ Sep 2 '20 at 0:08
  • 1
    \$\begingroup\$ That dsPIC doesn't have a USB ULPI interface to connect to a USB3310 - and there's no way you're going to bit-bang it. If you're really married to the dsPIC devices and you need built-in USB then you'll have to use one of the very few dsPIC which support it like a dsPIC33EP256MU8xx/dsPIC33EP512MU8xx. \$\endgroup\$
    – brhans
    Sep 2 '20 at 1:05
  • \$\begingroup\$ @brhans the data that is being streamed into the DSP is much more than 60MB/s, I dont want to be having to stream 270MB/s via usb, If 30MB/s is a challenge, then that will be impossible for my novice experience. I would assume the chip would be able to handle that throughput in a parallel manner? \$\endgroup\$
    – user224392
    Sep 2 '20 at 1:31
  • \$\begingroup\$ Yes, ULPI is a parallel interface. No, you 're not going to be able to connect it to your chosen PIC. You need hardware support in the micro to be able to connect a ULPI USB PHY. Even though it may be theoretically possible to bit-bang the ULPI interface in the micro, the effort would be pointless as you'd never be able to do it fast enough to make it worthwhile. \$\endgroup\$
    – brhans
    Sep 2 '20 at 1:59
0
\$\begingroup\$

Ive found a chip that looks promising to ease in doing so, the USB3310C a "Hi-Speed USB Transceiver with ULPI Interface". Right now Im thinking of using a DSP (dsPIC33EP32MC202) to interface between the device sensors, logic and the ULPI provided by the USB transceiver.

Rather than try and do this all from scratch, I'd look at a ready-made solution like an EZ-USB chip or similar. They're basically a bunch of IO pins, a programmable state machine, and a ready made USB stack. This saves you the (considerable) difficulty of implementing your own USB software, instead you can modify the examples that come with the SDK and use their USB libraries.

For example, here is a blog post showing how to interface a bare CMOS image sensor chip with some proto board and wire to an FX3 dev board and then stream video to Windows 10:

https://www.circuitvalley.com/2019/12/diy-cypress-fx3-usb3-usb-3-uvc-camera-ov7670.html

\$\endgroup\$
2
  • \$\begingroup\$ Would this solution be able to handle input of around 220MB/s, and run that data through some simple functions such as multiplexing, comparison and basic math? The data would be read through a parallel interface of about 8 bits of width. The final result would be about 30MB/s of data through the USB interface. Also as a note, looking at the chip that you recommend, its relatively high cost, around $30 in my currency. Are there cheaper solutions that still offer these benifits? \$\endgroup\$
    – user224392
    Sep 2 '20 at 21:55
  • \$\begingroup\$ The usb2 option is a lot cheaper if you only need 30MB/s. \$\endgroup\$ Sep 2 '20 at 22:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy