# Library for easily interfacing with USB tranciever

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.

• 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. Sep 2 '20 at 0:08
• 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. Sep 2 '20 at 1:05
• @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?
– user224392
Sep 2 '20 at 1:31
• 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. Sep 2 '20 at 1:59