MCU for USB Audio out - Page 1
Forum section: electronics / general

author: davorin
author_rank: Unknown
timestamp: January 25, 2022, 02:50:30 pm
content: Good afternoon (o;Looking around for a cost-effective MCU solution to hook up directly to USB FS/HS and use it as a USB audio speaker/line out with separate I2S codec...and no 24-bit and high sample rates are needed.So far I looked at following families/MCUs:- STM32F446 (old and over compliocated example prohject)- PIC32Mx (probabla free license wouldn't even allow to compile such a project, despite I don't like Microchip ;o)- XMOS, heavily over-priced eval boards- ESMT AD62550A, hard to get, but combine everything, USB , though I never used their ModusToolbox IDEaudio and Class-D amplifier, perfect for USB speakers- Cypress PSoC 6 family (has a github repo for an example)There's a nice ST application note (AN4711) describing how a STM32F0x2 series could be used as a cheap USB audio receiver with RC oscillator trimmingin software...but also here no code snippets and it is rather old....Any other suggestions?thanks in advancerichard

author: Bassman59
author_rank: Super Contributor
timestamp: January 25, 2022, 03:02:56 pm
content: For production or for a hobby toy?

author: davorin
author_rank: Unknown
timestamp: January 25, 2022, 03:11:05 pm
content: Mass production is my hobby (o;No seriously.....hobby of course.....Just installed the PSoC 6 IDE...and after some fiddling (Modus Toolbox doesn't like that you install it where you want ;o) the sample project compiled out of the box....but not sure I should put CY8CPROTO-062-4343Wkit on my shopping list....as PSoC devices mostly come in high pin count packages....

author: Bassman59
author_rank: Super Contributor
timestamp: January 25, 2022, 03:20:30 pm
content: Quote from: davorin on January 25, 2022, 03:11:05 pmThen if you want it to work out of the box use the XMOS kit and be done with it.Anything else and you'll spend ages trying to deal with chip vendor USB stacks and interfacing to the converters.

author: HB9EVI
author_rank: Frequent Contributor
timestamp: January 25, 2022, 04:38:12 pm
content: maybe I missed something, but why do you want use a mcu for this purpose??just go with the PCM2704 and you get all you needif it's not just turning about learning how to do it, it simply doesn't make any logic sense to go down the mcu route

author: darkspr1te
author_rank: Frequent Contributor
timestamp: January 25, 2022, 05:39:23 pm
content: Quote from: davorin on January 25, 2022, 03:11:05 pmI also got into the PSoC 6 pool but found it very much hammer to swat fly when i last did a usb-mcu-audio out project , i've since had to repeat that project and found pi-pico to offer the same but with a lot less setting up and i had better access to USB side of things so implementing dual USB was easier.i have not dusted off my PSoC 5/6 devices since (also the massive ide/libs needed killed my bw )darkspr1te

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 25, 2022, 05:42:43 pm
content: Ditto, first, figure out why you want to use a MCU for this, as there are a number of existing integrated solutions for this, either for USB FS or HS.Now if you still want a MCU-based solution for the flexibility, you can have a look at the Teensy 4 boards. Very powerful MCU, cheap boards, and they are Aduino-"compatible", coming with a number of audio libraries which should allow you to not only implement an USB to I2S device relatively easily, but also add some serious processing along the way. I'm not a big fan of the Arduino environment myself, but for this use case, and unless you're very proficient with all this, I'd say it's a very good option.https://www.pjrc.com/teensy/td_libs_Audio.htmlYou can of course directly use the NXP SDK (which I have done) with those boards, although it's of course more involved.

author: davorin
author_rank: Unknown
timestamp: January 25, 2022, 05:55:28 pm
content: Well the non-MCU approach is preferred ;-)And I could order now a few AD62550A chips on aliexpress....as mentioned USB FS and stereo d-class amp.The PCM2704 looks promising...but as with many audio eval boards from TI, they are rather overpriced to the chip costs....Nevertheless I will take a parallel road going the STM32 way...can't hurt to learn something about USB audio ;-)Maybe PSoC 6 as well as their audio in/out example from github compiled out of the box...

author: neil555
author_rank: Contributor
timestamp: January 25, 2022, 05:57:54 pm
content: You could always use the Raspberry PI PicoThere's a USB soundcard project here ...https://github.com/raspberrypi/pico-playground/tree/master/apps/usb_sound_card

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 25, 2022, 06:21:14 pm
content: Quote from: davorin on January 25, 2022, 05:55:28 pmThe "problem" with the dedicated ICs is that the pricing of the official "eval boards" will usually be much higher than your typical MCU dev board.But you can find a number of third-party boards that are much cheaper. eBay and Aliexpress are full of those boards with a PCM2704, for instance. For a few dollars...

author: davorin
author_rank: Unknown
timestamp: January 25, 2022, 06:23:52 pm
content: Interesting project...especially as I have few of those boards hete....

author: nudge
author_rank: Contributor
timestamp: January 26, 2022, 03:57:21 am
content: NXP LPC551x or LPC552x (Cortex-M33) might fit the bill.Cheap devboards and heres some app notes:AN12939 Implementation of 5.1-channel Audio Solution on LPC55xxhttps://www.nxp.com/docs/en/application-note/AN12939.pdfAN13447 How To Implement Multiple USB Audio Formats On LPC5500https://www.nxp.com/docs/en/application-note/AN13447.pdf