Not too long ago (around 2004) there wasn’t any Arduino code for the active speakers described on these pages. In fact, Arduino didn’t even exist at that time. Instead, there was a lot of 6808 assembly code and even Excel VB6 code that I used to control the new-fangled TAS3002 and Apogee DSP chips that I was using for those speakers. The emphasis on the code design for the MCU was providing a user interface for controlling the DSP chips, using an integrated LCD display. Unfortunately, assembly code not easy to read and maintain, and the memory limitations of early MCU’s required using code practices that are not acceptable today.
Over the years, this code has evolved in many good ways, so that the code is more modular, more maintainable, and more sharable. It’s still evolving, mostly because the code keeps getting adapted to make new and unusual speakers. Today, the MCU code is mostly in a good state, and it is all written using the popular Arduino Integrated Development Environment (IDE).
A useful way to visualize the Arduino code is shown below. The code is layered, and each layer only needs to communicate with the next layer “below”. The topmost layer, labelled “Main & HCI”, is the one that still needs additional evolution, as it still has vestiges of its roots as 6808 assembly code. That topmost layer is described in the article Arduino Software, Part 2. The inner layers are all written as libraries, and the innermost layer, labelled “SPI” is a built-in Arduino library. The other inner layers have all been designed as libraries, with header files and corresponding cpp files to implement the functionality. These inner layers are discussed in the article Arduino Software, Part 1. The blocks labelled “bilinear library”, “Lookup Tables” and “Enumerations” are also library files, but they are only used by the ADAU1466_DSP software.

There is a similar design for the ADAU1701, where the innermost circles are “Wire” and “ADAU1701_I2C”. The other library files are renamed to start with ADAU1701, but the code is essentially the same as the ADAU1466 counterpart.
There have been numerous rewrites and refactoring of many code modules and much of this code has proven to be reliable and maintainable. The library files have proven to be stable and robust over the course of many different speaker designs, and they can be used without modification by others to quickly build active speakers with these DSP chips. However, the outermost layer (“Main & HCI”) is where new functionality is added for unique designs, and there is still much “unevenness” and “brute force programming” in this layer. Since this outermost layer is all visible in the Arduino sketch, I have never felt comfortable sharing this code with others. Nonetheless, the code is presented in the ensuing sections of this article, and if you are willing to jump into it, you might find some useful gems. Of course, you might also end up scratching your head and wondering how this code could ever make sense to anyone.