Arduino-based ADAU1701

Neil Davis

Member
Paid Member
2004-12-07 3:23 am
Reston, Virginia
This project still has a ways to go, but much of it is actually working. I've got .NET code that sends commands to the Arduino Redboard, which controls the ADAU1701. You can specify filters, volume and delays and signal routing from the .NET code and hear the changes in real time.

I've still got a long ways to go, but I've got enough working to know that it will eventually work as intended. The goal is to have a low-cost active crossover circuit with an LCD display.

Just sharing to see if there is some interest...not selling anything, at least not yet :).

Arduino_shield.jpg


One of the nice tools that's working now is the ADAU1701 debugger. It lets you browse the Parameter RAM from the PC, and it shows the corresponding cell name. It also displays the Program RAM and Registers, although that information isn't too useful. The debugger window is shown in the lower right.


ASD.png
 

Neil Davis

Member
Paid Member
2004-12-07 3:23 am
Reston, Virginia
The project is moving along, but I took something of a detour by making an Arduino replacement CPU for the PGA2311 preamp kits that are sold on eBay. So you can buy the preamp chassis and preamp kit and throw away their CPU board, and connect the ADAU1701 shield to the I2C connector on my CPU. Or, just make an Arduino sandwich by stacking the LCD display on top of the ADAU1701 shield:
Arduino.jpg
. The same code will run on the Arduino Redboard or my PGA2311 replacement CPU.

My CPU replacement for the PGA2311 preamp allows you to customize the preamp, by adding new devices on the I2C bus (such as the ADAU1701 shield). It's also got a connector for controlling relays to use the PGA2311 preamp as a volume-compensated A/B box. And by using the pin-compatible Newhaven OLED displays in place of the LCD's, the preamp looks a lot classier. I don't have a picture yet for the CPU, but it looks like the CPU board for the PGA2311 kit, but with a lot more connectors on it.

So with this replacement Arduino CPU, the same software base can go in a lot of directions -- preamp, DSP/EQ, A/B box, 2.1 amplifier crossover, active crossover, etc.

The software is coming along. The menu system is working, the rotary encoder code is working, the IR remote control works, and the board loads the ADAU1701 program and can update parameters via the USB. There is still a lot of work left to control the ADAU1701 from the LCD display, but that's not going to be too hard.
 

Neil Davis

Member
Paid Member
2004-12-07 3:23 am
Reston, Virginia
Update:
All of the "hard stuff" for the local controller software is working. You can now "dial-a-crossover" and listen to the changes in real time. This version of the software supports 5 crossover types: BW1, BW3, LR2, LR4 and LR8. And there are seven frequencies: 1200Hz, 1600, 2000, 2400, 2800, 3200 and 3600. You can move through the menu and the crossover changes instantly, with no pops or clicks (all of the filter updates use the safeload write). Also, the master volume works.

There are several other menu items that still need to get implemented, but it is "more of the same". The coefficient tables take up a fair amount of space--right now I'm using 65% of the program space, and I've still got the biggest tables to finish (the 9-band EQ will use a lot of data). But pre-calculating everything makes the interface very fast, as it doesn't require the 8-bit micro to do a lot of floating point trig functions to calculate the coefficients.

But I might try doing the coefficient math in the micro for comparison. I know there be errors due to the single-precision math limitation, but it might be OK for these frequencies.

When this is done, it will be a fairly nice general-purpose Arduino controller that will work with any ADAU1701 board: miniDSP, the board shown in the original post, or any board that someone wants to build. Just provide power and the two I2C lines and this controller will manage the ADAU1701.

The code also supports a rotary encoder. I don't know yet whether there will be enough memory left to add the IR remote control, but I'll see in a few weeks whether there is enough space left over for that library.

Menu.jpg
 
Update:
All of the "hard stuff" for the local controller software is working. You can now "dial-a-crossover" and listen to the changes in real time. This version of the software supports 5 crossover types: BW1, BW3, LR2, LR4 and LR8. And there are seven frequencies: 1200Hz, 1600, 2000, 2400, 2800, 3200 and 3600. You can move through the menu and the crossover changes instantly, with no pops or clicks (all of the filter updates use the safeload write). Also, the master volume works.

There are several other menu items that still need to get implemented, but it is "more of the same". The coefficient tables take up a fair amount of space--right now I'm using 65% of the program space, and I've still got the biggest tables to finish (the 9-band EQ will use a lot of data). But pre-calculating everything makes the interface very fast, as it doesn't require the 8-bit micro to do a lot of floating point trig functions to calculate the coefficients.

But I might try doing the coefficient math in the micro for comparison. I know there be errors due to the single-precision math limitation, but it might be OK for these frequencies.

When this is done, it will be a fairly nice general-purpose Arduino controller that will work with any ADAU1701 board: miniDSP, the board shown in the original post, or any board that someone wants to build. Just provide power and the two I2C lines and this controller will manage the ADAU1701.

The code also supports a rotary encoder. I don't know yet whether there will be enough memory left to add the IR remote control, but I'll see in a few weeks whether there is enough space left over for that library.

Menu.jpg

I have the Arduino and the shield, which ebay board goes with this? Thanks
 

Neil Davis

Member
Paid Member
2004-12-07 3:23 am
Reston, Virginia
I have the Arduino and the shield, which ebay board goes with this? Thanks

I don't know of any ADAU1701 shields being sold on eBay. I made my own. You are welcome to have the design files (DesignSpark), but you would have to have boards made and do your own assembly.

I would like to get someone to manufacture these boards and make them available for purchase, but right now they are strictly DIY.
 

Neil Davis

Member
Paid Member
2004-12-07 3:23 am
Reston, Virginia
Hello expert, please share your programming.

It will be a while before that happens.

I changed the way the biquad coefficients get calculated. Previously, I calculated the coefficients using Excel and put the data into tables. The micro just copied the table data into the ADAU1701 Parameter RAM. But now, I'm calculating the coefficients using floating point math in the micro. It's slower, with a audible artifact as each biquad gets updated several milliseconds after the other. But it's also a much more flexible design, in that there can be a high-level interface to an "ADAU1701 library", in which the crossover type and frequencies aren't restricted to a limited set of pre-calculated values. Also, I've implemented a nice 9-channel EQ and BSC. And now the code takes up much less space, so I can add in the IR control or Bluetooth control without running out of code space.

Right now I'm thinking about where to head with this project and how to implement a general-purpose ADAU1701 library that could be used with any Arduino board and any ADAU1701 board. But this has taken a lot of time and I've got some other priorities that were pushed off that I need to address. So it may be a while before I return to this.
 

bassApe

Member
2018-08-03 12:18 am
I don't know of any ADAU1701 shields being sold on eBay. I made my own. You are welcome to have the design files (DesignSpark), but you would have to have boards made and do your own assembly.

I would like to get someone to manufacture these boards and make them available for purchase, but right now they are strictly DIY.

Hello,

Can I also have the design files?

Ty
 

Neil Davis

Member
Paid Member
2004-12-07 3:23 am
Reston, Virginia
The design files were posted on Audiodevelopers a long time ago: ADAU1701 Shield – Audiodevelopers Reborn

I've got some extra built-up working boards that you can buy at cost. Not sure how many I have, but I can check if you PM me. The cost will be around $40 ea.

I've also got a number of 3-way boards built up that I can sell.

Not trying to make a profit--just want to free up some storage space. :)

The current version has Bluetooth control, but the next generation will feature WiFi audio input.
 

Neil Davis

Member
Paid Member
2004-12-07 3:23 am
Reston, Virginia
I've posted two files on Audiodevelopers.com in the download section that provide information on how to communicate with the ADAU1701 from the Arduino. The download is I2C.zip, which contains two files: "12C.ino" and "Notes on I2C_ino.txt".

As noted on the website, a lot of this code derived from assembly language code for the 6801 that was written many years ago. But there are programming techniques for assembly language code that aren't appropriate for distribution as Arduino code, so until I can recast this code as "respectable" C code, I'm not going to share much of it. But if you are just trying to communicate with the ADAU1701, the code referenced above might be what you need.
 

Neil Davis

Member
Paid Member
2004-12-07 3:23 am
Reston, Virginia
The other variable that isn't defined in those notes is the I2C address:

const uint8_t ADAU1701_addr = 0x34;
uint8_t I2C_addr = ADAU1701_addr;

The notes were cut and paste from an email to someone else, so there is some extra "stuff" in response to his specific questions.
As I said, I'll like to make this code more shareable, but it's not an easy task, given the way this code interacts with the hardware and the SigmaStudio compiler output. Maybe some day...
 
If i get some kind of code working maybe we can put it up on github or something? Cause there is very little info on it how to get it working with an IC and even fever example schetches.
Maybe just something simple to get people started, nothing too complex.
If that is alright with you?
 

Neil Davis

Member
Paid Member
2004-12-07 3:23 am
Reston, Virginia
You can use the I2C code however you like and post it for others. That I2C module could easily be implemented as a library. However, that's only about 1% of the Arduino code in the design. This is an approximate breakdown of the code for the 2-in 6-out board:

ADAU1701_code.png


I can see how some of the code could be packaged in libraries, but there is a lot of it that is very hardware-specific and some of the code is actually created by another program that processes the SigmaStudio compiler output. Also, there are a lot of tables that define the menu structures and options, or that map filters to biquads. It's easy for me to maintain this because it is logically organized and fairly well documented, but it would require a lot of head-scratching to make all of this "shareable". I probably wouldn't even attempt to share this code unless I had someone with a lot of experience who could help.
 
Well, if i get it working due to your shared info and post it somewhere, i will still deffenetly credit you. (But due to my lack of budget, it may take a while since i will have to order some PCB's/components for that)

Yeah, thats all too much. just looking how to boot from the IC and then maybe control some parameters with an encoder and buttons. Nothing too fancy. So it wouldn't be very hardware specific and people can build up from there. Once you get the basic code and understand how it works, its easier to modify it to your own hardware and likeings.

Also i would love to help, but you seem way smarter than me so i wouldn't be of much use. Im pretty novice at programming and i have never even done a library for an arduino.

Btw,are the first three (main, code and functions) in any way shape or form shareable?