Based on PMs I've received there seems to be some interest in DIY STM32 USB-I2S boards. Earlier I have published designs and software for I2S input board mainly for ADCs (https://www.diyaudio.com/community/threads/diy-adcs.419922/). So let's up the ante and do the same for I2S output board for DACs. Over the last few years I've made several board designs with STM32F7 and STM32H7 having both I2S output and input or I2S output/I2S input only. I believe the STM32H7 based design presented here is quite versatile and should work well with most DACs.
HW specs:
The board works "out-of-the-box" with stand-alone DACs. For DACs requiring I2C or GPIOs a "driver" can be implemented. Currently I have driver implementations for ES9038Q2M, ES9039Q2M, AK4490, AK4493, AK4499+AK4191.
Connection to DAC can be made either through the 16-pin header or using MMCX for I2S with separate wiring for I2C, GPIOs and isolator power. In my DACs I have "sandwiched" the USB-I2S board with DAC board as all my DAC boards have same format and connector placement.
With display/control board, power supply (e.g. SilentSwitcher) and headphone amp board it is possible to build a compact DIY USB DAC having versatile functionality and good performance. Even bettering commercial offerings.
Attached are the gerbers, schematic and BOM. BOM has Mouser part numbers except for the NZ2520SDAs which are available from Digikey. Board is quite challenging for hand soldering. Smallest resistors are 0402 size and some ICs are leadless. I have assembled lots of these boards but I have a reflow oven. If there is larger interest it would probably be easiest (and most economical) to organize a group buy and have the boards manufactured professionally.
For sofware development I recommend STM tools which are excellent and license-free. For uploading software to an empty MCU a ST-Link programmer is needed. Easiest is to use a STM32 Nucleo development board which are available for about 15 EUR in Mouser. After initial programming DFU interface can be used for software updates. I will not publish the software source code here but it is available directly from me. If interested send me PM. Sorry, not for vendors.
HW specs:
- STM32H723 running at 550MHz
- USB3343 USB HS PHY. USB connector is mini-B.
- 16-pin header for output
- I2S with 4x SD (digitally isolated). All I2S signals are buffered and routed through same number of gates/buffers to maintain timings. Digital isolators are lowest jitter 6-channel isolators currently available.
- I2C bus (digitally isolated)
- 3 output GPIOs (digitally isolated). In addition unused SD lines can be used as output GPIOs as well.
- Isolator power (3.3V)
- MMCX connectors for I2S and external clock.
- 6 GPIO pin header for jumper configuration or I/O.
- 2x audio clocks (size 2520/3225) with independent enable control. Clocks can be either 22M/24M or 45M/49M. I use NZ2520SDAs.
- External clock input (MMCX). Digitally isolated clock selector GPIO for external clock.
- 20-pin header with 2x SPI (for touch screens) and encoder interface for display/control.
- I2C bus for displays etc. (independent from output I2C)
- Battery for backup memory and RTC.
- 6-pin header for SWD
- 4 status LEDs
- Powered either from USB or external 5V supply
- Board size 75x50mm (without outer mounting holes)
- I2S
- 2 channels up to 768kHz/32bits (with 45M/49M clocks)
- 4 channels up to 384k/32
- 8 channels up to 192k/32
- DSD up to DSD512 or DoP256. Native DSD only in Linux as no ASIO driver yet.
- TDM
- TDM128 (4 channels) up to 384k/32
- TDM256 (8 channels) up to 192k/32
- TDM256x2 (16 channels) up to 96k/32
- TDM256x4 (32 channels) up to 48k/32 (not tested).
- PCM
- 2 channel single ended or differential up to 768k/32
- 4 channels up to 384k/32
- Format: 2's complement, offset binary, simultaneous (also 16fs)
- Bit depths: 16, 18, 20, 24, 32.
- HID interface for configuration
- DFU interface for firmware upload.
- ASIO driver. I've read that a 3rd party "universal" open source ASIO driver may be available later this year.
- GUI for HID interface. I have used simpleHIDwrite (linkhttps://github.com/benbaker76/SimpleHIDWrite).
The board works "out-of-the-box" with stand-alone DACs. For DACs requiring I2C or GPIOs a "driver" can be implemented. Currently I have driver implementations for ES9038Q2M, ES9039Q2M, AK4490, AK4493, AK4499+AK4191.
Connection to DAC can be made either through the 16-pin header or using MMCX for I2S with separate wiring for I2C, GPIOs and isolator power. In my DACs I have "sandwiched" the USB-I2S board with DAC board as all my DAC boards have same format and connector placement.
With display/control board, power supply (e.g. SilentSwitcher) and headphone amp board it is possible to build a compact DIY USB DAC having versatile functionality and good performance. Even bettering commercial offerings.
Attached are the gerbers, schematic and BOM. BOM has Mouser part numbers except for the NZ2520SDAs which are available from Digikey. Board is quite challenging for hand soldering. Smallest resistors are 0402 size and some ICs are leadless. I have assembled lots of these boards but I have a reflow oven. If there is larger interest it would probably be easiest (and most economical) to organize a group buy and have the boards manufactured professionally.
For sofware development I recommend STM tools which are excellent and license-free. For uploading software to an empty MCU a ST-Link programmer is needed. Easiest is to use a STM32 Nucleo development board which are available for about 15 EUR in Mouser. After initial programming DFU interface can be used for software updates. I will not publish the software source code here but it is available directly from me. If interested send me PM. Sorry, not for vendors.
Attachments
Here is a somewhat out of the ordinary DAC I made for testing multichannel PCM.
It is a quad AD1862 NOS DAC sandwiched on top of the USB-I2S board. With 4 PCM data streams the DAC chips can be configured as 2 channels, parallel 2 channels, differential 2 channels or 4 channels. All this without any glue logic.
If 2-channel NOS sounds great think about how much better 4-channel NOS sounds 🙂
It is a quad AD1862 NOS DAC sandwiched on top of the USB-I2S board. With 4 PCM data streams the DAC chips can be configured as 2 channels, parallel 2 channels, differential 2 channels or 4 channels. All this without any glue logic.
If 2-channel NOS sounds great think about how much better 4-channel NOS sounds 🙂
Hi Martti, how do you control power and signal sequencing when building an AKM DAC? I think there are only two ways to do this.
1. uC turns on the PSU, and pulls the PDN high a little later.
2. A hard switch (e.g. a toggle switch) turns on the PSU, and at the same time inputs a High to the uC. The uC notices this, and pulls the PDN high a little later.
1. uC turns on the PSU, and pulls the PDN high a little later.
2. A hard switch (e.g. a toggle switch) turns on the PSU, and at the same time inputs a High to the uC. The uC notices this, and pulls the PDN high a little later.
I use more or less the second alternative although the USB-I2S board can also be powered from USB port. Anyhow after reset MCU starts the audio output task which initializes the DAC specified in the settings if needed. Standalone DACs (e.g. using HW mode) do not typically require any initialization from the MCU.
The source code includes a "driver" for AK4493. All AKM AK449x DACs have similar PDN handling.
The source code includes a "driver" for AK4493. All AKM AK449x DACs have similar PDN handling.
Code:
/* Reset AK4493 */
HAL_GPIO_WritePin(AK4493_PDN_PORT, AK4493_PDN_PIN, GPIO_PIN_RESET); //PDN low
DWT_Delay_us(10);
HAL_GPIO_WritePin(AK4493_PDN_PORT, AK4493_PDN_PIN, GPIO_PIN_SET); //PDN high
DWT_Delay_us(5000); // 5ms
Hi! Can you prognose the price of finished board for a group buy ?If there is larger interest it would probably be easiest (and most economical) to organize a group buy and have the boards manufactured professionally.
At least with European manufacturers pricing is quite dependent on batch size as there are setup costs. Anything below 50 boards can become expensive per board.
Last time I checked the price of components from Mouser & Digikey is about 65 EUR (excluding VAT) using single qty prices. Manufacturers get much lower prices for components as they buy larger quantities.
As a wild guess I would say 80 EUR per board + VAT if batch size is 100 boards.
Last time I checked the price of components from Mouser & Digikey is about 65 EUR (excluding VAT) using single qty prices. Manufacturers get much lower prices for components as they buy larger quantities.
As a wild guess I would say 80 EUR per board + VAT if batch size is 100 boards.
Very interesting!
What is supposed to be better than, say, an xmos with a fifo reclock?
More raw power I think.
What about asynchronous reclock?
I understand that there will be almost zero jitter introduced by the board, but I believe an asynchronous reclock is always a good idea in that it excludes the potentially jitter injetted by a not perfect transport.
Or I'm missing something?
What is supposed to be better than, say, an xmos with a fifo reclock?
More raw power I think.
What about asynchronous reclock?
I understand that there will be almost zero jitter introduced by the board, but I believe an asynchronous reclock is always a good idea in that it excludes the potentially jitter injetted by a not perfect transport.
Or I'm missing something?
How many open-source XMOS implementations have you seen?What is supposed to be better than, say, an xmos with a fifo reclock?
More raw power I think.
What about asynchronous reclock?
The board operates in UAC2 async mode with FIFO so there already is a built-in fifo reclocking. As UAC2 async mode uses feedback buffer over/underruns can be eliminated. With downstream FIFO reclock there is no feedback mechanism so buffer over/underruns will eventually happen unless FIFO is reseted which means stream is not bit-perfect anymore. Asynchronous reclock is also not bit-perfect.
In UAC2 async mode USB jitter is eliminated as USB clock is not used for audio clocking.I understand that there will be almost zero jitter introduced by the board, but I believe an asynchronous reclock is always a good idea in that it excludes the potentially jitter injetted by a not perfect transport.
Really impressive work. This chip has the fpu so it can do some FIR on its own I think. (Have experimented with the nucleo board)
Hope there will be a group buy
Hope there will be a group buy
Do anyone know if there is a TDM new chip solution around. The marked are flooding with really good DAC chips. But can’t find a resonably priced TDM card
I haven't thought about running a group buy unless there is serious interest. There are already members who have built this board themselves. Feedback has been very positive.
So reclocking of the output is done inside the STM32, right? I guess hardware reclocking after the isolators for 8ch would consume too much board real estate. What are the expected jitter specs?
No reclocking but not because of PCB real estate. IMO reclocking should be done at DAC board as the requirements for reclocking depend on the DAC solution. For DS dacs no reclock is needed (only MCK is critical) and in fact should be avoided as e.g. with AKM dacs edges of BCK and LRCK should not be aligned (minimum 5ns separation required). For R2R DAC chips BCK and/or LRCK should be reclocked but better to do that at DAC board using MCK.
- Home
- Source & Line
- Digital Source
- DIY STM32 USB-I2S Multichannel board