4 ms·
That's definitely possible. The actual DAC but it's trivial - the hard but is that you would need to implement the USB Audio device class and a USB stack. That'
by IshKebab 6y ago
That's definitely possible. The actual DAC but it's trivial - the hard but is that you would need to implement the USB Audio device class and a USB stack. That's a hell of a lot of code. Also what would be the point?
- Kliment 6y agoLuckily there are wonderful USB stacks implemented in open FPGA toolchains these days - check out the toolchains described at https://workshop.fomu.im/en/latest/ https://workshop.fomu.im/en/latest/
- IshKebab 6y agoI wondered if there might be, but did you post the right link? I can't see anything about open source USB device implementations there.
- ohazi 6y agoKate Temkin's Luna project is super cool, although I think it's still a WIP: https://github.com/greatscottgadgets/luna https://github.com/greatscottgadgets/luna It's a USB stack implemented as pure gateware - no hard/soft CPU needed, although I think you can hook one up if you want to.
- Kliment 6y agoThe code linked there is all open, and has a USB device softcore. It's the most approachable FPGA USB implementation I've played with. edit: Here is the actual USB core that's in there: https://github.com/im-tomu/valentyusb/ https://github.com/im-tomu/valentyusb/
- ranma42 6y ago> USB Audio device class and a USB stack. That's a hell of a lot of code. Its actually not that much for the bare minimum needed, though the USB docs are pretty daunting. If you go with USB1, you basically just need enough to answer the descriptor and set interface queries and set up the endpoints (in particular the isochronous endpoint for audio is a bit more complex). If you stick to exactly one supported format and sample rate and don't include any control units, you can basically skip all the audio class control messages. For USB1, in a pinch, you can use a cheap generic 24MHz usb logic analyzer and pulseview to decode the raw usb protocol for debugging (though with 24MHz you get some corruption in the capture from clock drift, you need at least 48MHz for more reliable signal sampling). I'd guess you can make do with ~1k LOC in this case.