6. ADAU1701-based stereo 3-way DSP Board

Objective

There are a number of boards using the ADAU1701 that provide a 2-input with 4-output capability, and those boards are good choices for building a stereo 2-way active speaker.  However, there aren’t any comparable boards that are small and low-cost that will work for 3-way speakers or 2-way speakers with one or two subs.  So that’s our goal:  a low-cost stereo 3-way DSP board.

The ADAU1701 supports 8 output channels, and it turns out that adding the extra two channels needed for a stereo 3-way active crossover is relatively easy.  This article describes the extra hardware required and it walks through all of the steps required to design, fabricate, assemble and test this DSP board.

The stereo 3-way board has many applications.  We can use it to make active 3-way systems, or use it for “active 2.1” systems.  By “active 2.1” I mean stereo active speakers, each with a separate woofer and tweeter channel, plus one or two subwoofers.  This is not a commonly referenced configuration, but it turns out to be very useful for computer speakers or TV speakers.  This is a “centralized” electronics configuration, where all of the electronics can be housed in the subwoofer box or in a small amplifier chassis.  I’ve used configurations like this for many years, and in case study #2 we will show the details of building some nice computer or TV speakers with the electronics inside of a subwoofer cabinet.  But first we need that stereo 3-way DSP board!

Block Diagram

The block diagram below shows all of the major functions of the stereo 3-way DSP board.  This is the block diagram for the first version of the board, and the second version of the board is very similar.  The first version works well, and you can download the board files and build it and have a lot of fun.  But the first version has a lot of tiny surface mount components, and building it requires a lot of tedious effort and more “inspiration” from inebriating spirits.  The second version fixes some problems and uses as many commonly available “eBay modules” as possible to simplify the construction.  The goal of the second version was to reduce the small parts count by a factor of 2 by using the modules.  Of course, modules available in 2017 may not survive beyond 2018, but that’s a feature of the rapidly moving world we live in.  Since you can download the source files for this board, you can change the board design to use other modules that may be available.

 

The Rev 1 board has a lot of commonality with the miniDSP or freeDSP boards, in that both are adaptations of the reference circuit in the data sheet for the ADAU1701.  However, our DSP board has some key differences.  First, we’ve added those extra two channels by including a stereo DAC.  We’ve selected the Wolfson/Cirrus Logic WM1824 for this DAC, as it is reasonably high quality, is readily available, and it has an on-board charge pump to eliminate the output capacitor and provide additional voltage swing for driving subwoofer plate amps.  Second, we have eliminated the EEPROM needed for self-boot on the freeDSP board, as the Adruino CPU loads the code into the ADAU1701.  The reason for not using self-boot mode is that the Arduino code needs to “know” the addresses for the Parameter RAM for each of the ADAU1701 DSP cells, by processing the output of the SigmaStudio compiler.  In order to ensure that the cell addresses correspond to the ADAU1701 Program RAM, it is best to have the Arduino microprocessor load that code.

The third way in which this board is unique is by using an Arduino CPU to provide a high-level interface to external computers or by providing a local user interface with an LCD display.  A lot more will be said about this Arduino CPU in the article on the Arduino Software.  This high-level interface provides 4 different physical control interfaces.  The user can use a “smart” LCD display (the Nextion displays) along with an IR keyboard, a “heavyweight” speaker design client running on a PC, or a Bluetooth cell phone app to select crossover types and frequencies, baffle step control, EQ, and other DSP functions.

Revision 1 DSP Schematic and PCB

The DSP boards were designed using DesignSpark PCB.  DesignSpark is free, it is easy to use and well documented, and it generates the Gerber files we need to get the board manufactured.  The schematic is shown below, but in order to examine the circuit you will need to download the project files and open them in DesignSpark.  There are also some custom library components made for this board, and you will need them if you want to make changes.  The files are in the Download section of this web site.

The boards were made using ITEAD.  For about $45 you get 10 good quality boards.  It will cost another $20 if you want them shipped quickly, but I’ve gotten some boards back in about 2 weeks using the standard shipping option.

The figure below shows the completed board, along with the low-cost ($16) Nextion touch screen display.  The figure shows the board before I modified it to add a Bluetooth interface.  There was a lot of interest on the Parts Express Techtalk board about being able to control the DSP from a cell phone app, so I removed the parts for the FTDI interface and hot-melt glued a Bluetooth board in their place.  This figure also shows the teensy-LC board, which was the initial selection for the Arduino CPU.  However, as the code kept increasing in size, I exceeded the code space limitation of the teensy-LC (64K) and had to switch to the teensy3.2 board.  The board will accept either module, since they used nearly identical pinouts.  The teensy3.2 board is more expensive, but it is also a lot faster, and it has plenty of code space for this project to evolve.  It’s also got 5V-tolerant pins, so we don’t need a level shifter to connect the 5V Nextion display.

As noted earlier, this board works fine for the stereo 3-way project described in Case Study #2, but only if you are OK with soldering all of these components.  However, there are a lot of SMD parts on this board that can be replaced by some readily available modules.  For example, the stereo DAC chip, which is in the upper right section of this board, uses a 24-lead QFN package and has about 8 supporting components.  You can buy a PCM5102 module for about $4 on eBay that uses an easy-to-solder 6 pin connector, and that is much less work.  Similarly, there are a number of switching regulator modules, FTDI modules, and Bluetooth and WiFi modules available at surprisingly low prices.  So the next iteration of the board is a bit larger to accommodate these modules, but it is much easier to assemble.

Revision 2 Board

The block diagram shows the modules in a reddish color, with the blue blocks indicating areas of SMD components that need to be assembled.  When this part of the article was written, there were no ADAU1701 modules that met our needs.  So for this revision there is still some tedious SMD soldering involved, but this situation has improved to where you can view this as a one day, one or two beer project, instead of a multiple evening effort.  [update, 4/2020:  About two years after this part of the article was written, the “ADAU1701 Learning Board” has become available, and it is possible to make the stereo 3-way board with no SMD soldering at all.  That approach is described in Part 2 of this article].

The block diagram also shows a new component:  an isolated 5V supply.  This is needed for the external Dayton WiFi Adapter, which makes a lot of interesting noises unless it uses an isolated ground.

 

The assembled PCB is shown below, and you can see from the schematic that it is more modular and there are fewer SMD components to deal with.  Some of the modules are “stuffing options” to provide different interfaces.  For example, you can use either Bluetooth or WiFi to control the DSP, but you can’t use both because they share the same serial port.  And you can use the FTDI USB interface for controlling the DSP from a PC or for the Arduino debugger, or you can leave this module off the board if you don’t need those interfaces.  You will still need to solder on the 64-pin ADAU1701, but all of the passive SMD components are 0805-sized, which isn’t that difficult to solder.  If someone wants to investigate getting these boards machine assembled or if someone wants to build some up to sell, I’d be happy to help with some of the details.

Getting Boards Made

There are many good PCB manufacturing companies that will allow you to upload the Gerber files and have boards made within several days.  Since most of these PCB companies are in China, the cost of quick shipping is often about the same as the cost of the board fabrication.  However, if you are willing to wait for relatively slow economy shipping, you can get a small run of boards made for about $40 with shipping about $10.  I’ve been using ITEAD for the last two years to have the boards made, and I’ve had consistently good service.

Places like ITEAD (https://www.itead.cc/open-pcb.html) require that you pay them for the boards using an online form, and then they will send you a link for uploading the zipped Gerber files.  The files are automatically analyzed, and for some reason, my DesignSpark files don’t pass the automated test.  But don’t worry–they look at the files manually before making the boards and they will send you email if they find problems.  I’ve had some part issues where the silkscreen turned up in the wrong layer, or one layer didn’t use the same measurement scale, and ITEAD was very good about pointing out the problems.  If you run into problems, download the Gerbv program or other Gerber viewer app to help debug the problems.  DesignSpark has a tutorial on preparing the manufacturing files that can also be helpful.  The zipped Gerber file will include about 15 files, with top and bottom layer information and drill data.

The zip file in the Download section for this project is what was used for the current design.  You should be able to send it to ITEAD and have your own boards made without any problems.

Assembly Instructions

This board is for those who have the tools and skills to work with SMD devices.  These tools are not that expensive and the required skills aren’t that difficult to master.  However, there is now an easier way to build this board using an ADAU1701 module, and if you want to build this design, you are “on your own”.

Revision 3 Board

The Revision 2 boards are a good solution for an active 2.1 system or a stereo 3-way system, and they are easier to build than the original board.  But this site is about active speakers, which are increasingly moving toward wireless connections.  So the Revision 3 board is about adding a WiFi input to the basic ADAU1701 design.  Obviously, we could simply add an SPDIF/ASRC interface to the ADAU1701 and use one of those Dayton WiFi boxes such as the WFA-28 or WBA31.  But that’s too easy.  This board will use the module that is inside of those boxes, with a direct connection to the ADAU1701 serial port.  This configuration is depicted in the block diagram below:

 

But first some venting.  This board is an experimental  prototype because the openly available data on the Linkplay module is skimpy, misleading and incorrect.  For example, the user manuals for the Linkplay A28 and A31 modules say that the modules can operate as either masters or slaves, but there is no information on how to set the mode.  The example for master mode shows the connection to a WM8918 CODEC, but if you wire up that circuit there won’t be a bit clock or L/R clock–the module just sits there with no activity on any pins!  What’s the secret to get the module to be a master, and why isn’t it written down in the user manual?

And there’s more.  The pin description table on page 7 says that pin 5, I2S_WS is an output (“O”), whereas I2S_CLK is I/O.  But if this module is a slave, I2S_WS will need to be an input–it is the L/R or word clock, and that signal needs to come from a master.  That “O” in the table can’t be right!

And then there’s the issue of clock rates.  The literature says the module supports up to 24-bit audio at 192K, but is that really the case, and what are the limitations, if any?  If the device outputs data at a 48K sample rate, is the incoming data via DLNA requested at the same rate?  Is there a resampler with ASRC capability in the chip?  And since the device supports clocking at 48K (see next paragraph), why do the boxes that use these modules stick to 44.1K as the sample rate?  (that’s true of the Dayton boxes, at least).

And to continue the rant, the reset signal is active low, but it is not indicated that way in the data sheet.  C’mon guys, just put a slash or star in front of the signal name to tell us it is active low–that’s a basic engineering courtesy that transcends all languages and cultures.

OK, enough ranting, but this project proved unnecessarily frustrating due to lack of clear information on using the Linkplay device.  The initial board design assumed that the Linkplay A28 would default to a master and provide a 2.822MHz bit clock and 44.1KHz word clock.  The bit clock was sent to the ADAU1701, which would generate a 45.16 core clock using the Fs x 1024 mode of the ADAU1701 PLL.  So, I built up the board and guess what–no clock, because that A28 wasn’t a master generating a bit clock and word clock.

So this board has some cuts and jumpers.  I’m using a 3.072 MHz oscillator for the ADAU1701 to generate a “standard” 49.152 core clock frequency.  This gets divided by 16 to generate the bit clock for the Linkplay module (and the PCM5102 DAC) and the ADAU1701 provides the 48K L/R clock as well.  So the ADAU1701 is the master, generating the clocking data, and the A28 module is a slave, fetching data from the network to keep up with those clock rates.  And it works great!  But the board has too many hacks to be satisfying, so 9 of the run of 10 PCB’s will get dumped in the trash.

But the good news is that the rest of the board works well, with excellent audio.  No problems with ground loops–the board is quiet whether you are using the digital input (from the A28 module) or the analog input (on the ADAU1701).  What’s more, the Android code to control this board has been updated to add a selector switch for Analog vs Digital input.  So this board proved useful from a learning perspective, and provided the information needed for a subsequent revision.  The follow-on to this board is the Fully Modular WiFi board that is described in Part 2 of this article.

Some other evolutionary changes are worth pointing out.  First, those big down-converter modules are inexpensive, but they take up too much space.  The VXO7805-1000 is reasonably priced and it takes up a lot less space.  However, the datasheet specifies a 10uf capacitor on the input and a 22uf capacitor on the output.  I found out that these aren’t suggestions; they are requirements.  But with these components properly placed the VXO7805-1000 works great.

Here is a look at the Revision 3 board, without the cuts and jumpers to add an oscillator:

Note:  see Part 2 of this article for follow-up designs