Arduino controlled Dual Mono AK4490 DAC (Part 1)

For the better part of a year I’ve been busy developing what one would call a “respectable” DAC from scratch. It has been a team effort, with different people becoming more involved with specific aspects of the project, but pretty much everyone involved ended up learning a lot about DACs. Right now, the project is for the most part finished, in that it is fully functional with a USB input and a pair of single ended outputs (or balanced, if you use a passive transformer-based stage). It is controlled by an Arduino-compatible micro-controller, running my aKduino v2 code (more on that in a future post).

I will do a series of posts detailing the design and build process, with each post covering a specific PCB. When the series is complete, the contents of all of the posts will be concatenated into a project page.

So, without further ado, this is the schematic of the main DAC board:

(Right click, Save Image As.. to download it in full resolution)

This is the 4-layer PCB:

This is the parts placement diagram:

And this is the BoM (v1.9) in xls format: Dual AK4490 DAC (main board BoM) (113 downloads)

Design considerations

The design goal was to do a dual mono design so as to maximize SNR and channel separation. A 4-layer PCB design was chosen so as to have a very solid, low impedance ground plane as well as proper power and signal planes. The I2S, audio signals and power after the local LDO regulators are routed on the top layer, the 2 middle layers are ground and power planes, and the bottom layer serves to route I2C signals and some power lines.

Power

All of the local power supplies are implemented using the currently top-of-the-line LT3042 LDOs. The VDDL & VDDR (analog power supplies) are set to 7.2V so as to maximize SNR and dynamic range. There is provision for providing separate pre-reg power supplies for the L and R channels (headers AVDDL and AVDDR) but I don’t consider that to be critical to SQ since there are local LDOs and the power draw is very very small. In my implementation I’m using a common pre-reg for both the AVDDL & AVDDR. The AVDDs and DVDDs are also supplied by LT3042 LDOs set to output 3.3V. The Si570 has its own dedicated 3.3V supply implemented with an LT3042 and features extra filtering.

Overall, the power requirements of the board are:
1) AVDDL: 8-10V DC at 40mA max
2) AVDDR: 8-10V DC at 40mA max
3) DVDD: 4-6V DC at 200mA max

Clocking & input signals

It was decided that the MCLK would be provided by a programmable low jitter oscillator, namely the Si570. This way we could select different MCLK frequencies at will, supporting different sampling rate families and different USB to I2S boards.

Speaking of USB to I2S boards, the DAC board has a very specific requirement: The USB board must be able to receive MCLK externally. In other words, the DAC board and USB board must be clocked from the same oscillator. This is due to the AK4490’s design. Unlike the ESS designs which by default run asynchronously, it needs to be on the same clock domain as its I2S sources.

So, the DAC board needs to output MCLK back to the USB board. There exist a number of USB boards that support that. The most popular ones are the Amanero Combo384 and JLsounds’ I2SoverUSB.

Since I had decided to do reclocking using flip-flops as close to the AK4490s as possible, and the flip-flops are clocked by the MCLK, its frequency needs to be sufficiently high in order to reclock signals corresponding to high sample rates. This translates to 49.152 MHz for sampling rates of 384KHz. If you’re content with going only up to 192KHz, you can use a MCLK of “just” 24.576 MHz. Of course you will also need the corresponding MCLKs of 45.1584 and 22.5792 MHz for the 44.1K families of SRs.

If you decide that you don’t want to do reclocking on the DAC board, you can just not solder on the flip-flops and just connect the proper pads together with some wire so as to bypass them. That way you can run with 22.5792 & 24.576 MHz clocks with SRs up to 384KHz (and probably beyond..).

If you decide that you would also prefer to not use the Si570 and just clock the DAC board directly from your USB to I2S board (or other suitable I2S source) you can also do that. You just don’t solder-on the Si570 and make a couple of changes to the Arduino code (to be implemented..).

But I urge you to try the Si570 & reclocking way first..

Construction hints

Start by first soldering on the power supply components (LDOs, resistors, caps, etc.) and testing that everything works the way that it should.

The LT3042s are pretty tiny and its easy to make a mistake while soldering them. I’ve found that the easiest method is by using a hot air rework station. First I use a regular soldering iron to tin the thermal pad and the pads with a small amount of solder. Then I apply a good amount of high quality solder paste, put the LDO on top of the pads and heat the area of the board until the solder melts. I set my hot air station to a relatively low temp of ~280 degrees C and the process takes less than a minute (per LDO). But you could also solder them with a soldering iron. To solder the heatpad, warm up the pad from the underside of the board and add solder.

After the power section, you should solder on the AK4490s and other low profile components. I do that with a low power (18W) soldering iron with a fine tip.

Next up is the Si570 programmable oscillator. I start by putting a little solder on one of the pads:

Then I add soldering paste and I place the Si570 on top of the pads. I use the fine tipped soldering iron to melt the solder on the tinned pad, effectively soldering the Si570 on the board. I then proceed to solder the rest of the pads by applying heat with the soldering iron to the side of the pads of the Si570 and adding solder.

You should finish up by soldering the electrolytic capacitors and other higher profile parts.
Beware that the spacing around the electrolytics is very tight. You should take that into account when selecting parts. The parts in the BoM are sure to fit in the available space.

That’s it for Part 1. Stay tuned for Part 2: The Controller.

TFT HiFiDUINO Pro update..

I finally managed to find the time to actually integrate my upgraded Buffalo III board into my Buffalo DAC.

In the process I discovered and took care of a number of bugs in my TFT HiFiDUINO Pro code.

The most serious bug was one that failed to properly initialize a new (blank) 24LC256 EEPROM chip. That effectively caused the code to crash.

Here is the change log:

v1.08 15/10/2017:

  • Fixed EEPROM init bug
  • Fixed DPLL settings bug & default DPLL settings for USB 2
  • Added alternative way of controlling Solid State Sidecar (via Pin A1)
  • Changed input names & icons to match my Buffalo III
  • Other minor bug fixes
  • Inverted power-on signal to make fully compatible with “TFT HiFiDuino” code
  • Inverted rotation of encoder to make fully compatible with “TFT HiFiDuino” code

v1.06 23/07/2017:

  • Initial release.

The new version of the code can be found at the project’s page.

Winter 2017-2018 teaser :-)

So many projects, so little time.. Here’s a teaser on what’s to come:

PGA2311-based preamp, with multiple inputs board, controlled by a custom Arduino, with an OLED screen.

Salas DCG3 preamp, powered by custom Salas Shunt Reg 1.2R.

MPD TFT display for Rasberry Pi, controlled by an STM32.

Ian’s Multichannel FIFO.

Allo.com’s DigiOne RPi HAT.

Dual Mono AK4490 DAC with on-board Si570 programmable oscillator and reclocking, Single ended Class A discreet output stage, Arduino controlled with STM32 controller and 3.5″ TFT screen.

Arduino controlled AK4118 based s/pdif receiver, with AK4137 SRC.

TFT HiFiDUINO Pro page is up..

Over 6.500 lines of code, completely re-written from scratch, it supports the ES9038Pro and ES9028Pro DAC chips.

Now supports both 3.2″ (legacy) and SainSmart 4.3″ TFTs.

Get all the juicy details: http://www.dimdim.gr/arduino/tft-hifiduino-pro-project/

ArDAM Lite custom PCBs for diyaudio.com

This post serves mainly as a placeholder for the build guide that I wrote for the PCBs, since it seems that some people had problems with the download link that I provided.

The build guide can be downloaded by clicking here: ArDAM Lite Build Guide (918 downloads)

I do have a few left over PCBs, if you’re interested contact me for more info.

ES9028Pro power wows

Following-up on my previous post, I soldered a Crystek 100MHz clock and had a new set of Trident replacement boards made for my upgraded Buffalo III.

The new boards are direct replacements for the Tridents, supplying 2 x 3.3V for AVCC_L & AVCC_R, 3.3V for the oscillator, 3.3V for the AVDD and 1.2V for DVDD.

Upon powering up the board with the new clock and power supplies, I noticed a problem. Whenever I tried to play material with sampling rate over 44.1KHz, the sound became garbled.

In my test rig I had also used the same power supplies with no problem, so I guessed that the problem had to be the new oscillator. But the new oscillator appeared to be working just fine.

To further complicate things, when I turned off oversampling and the DPLL filter the sound improved (but still sounded bad because I was doing no oversampling).

After some probing and prodding, I realized that my 1.2V supply was sagging below 0.9V when the sampling rates went above 44.1KHz. That should not be happening, since I had set the current limit on my LT3042 regulators to about 125mA with the data sheet specifying the 9028’s 1.2V supply current consumption to 82mA. But it appeared that my 9028 was pulling in a lot more current.

So I disabled current limiting and tried it again. This time everything was working just fine, with no sagging, but my LT was getting hot. Real hot. Like 80 degrees C hot when playing 352.8KHz material. So I did a couple of things. First I desoldered the 1.2V power supply and inserted my DMM in series in order to measure the actual current draw. I got these results:

44.1KHz -> 140mA
DSD64 -> 147mA
DSD128 -> 157mA
352.8KHz -> 200mA

So up to 200mA! No wonder my LT3042 was having a hard time.. I was working it very close to its thermal limits.

I decided to mount it vertically and to add a heat sink to the back of the PCB.

With this arrangement I was getting about 62 degrees C with 44.1KHz material and up to about 75 degrees with 352.8KHz. This is tolerable for 44.1KHz playback but not cool (pun intended 😛 ) for high sampling rates. Since 200mA is pretty much the LT3042’s upper current limit, I’ll have to design a new power supply, either with two paralleled LTs or some other LDO. The bigger problem is the heat dissipation. I will have to make the PCB as big as possible in order to have a lot of room for heat sinking.

But why does this chip’s actual power consumption differ so much from the published specs? As always, the devil is in the details. The stated 82mA is for a sampling rate of 48KHz and a clock frequency of 40MHz. I’m using a 100MHz oscillator so power consumption ought to go up, but I never expected it to increase so much. I wonder what will happen if I input a 768KHz signal.

Yes, I put an ES9028Pro on my Buffalo III

A few years back I was hit by Murphy and I was hit hard.

It was the time when you had to be very patient and even somewhat lucky if you wanted to buy a Buffalo DAC. You had to wait for the boards to go on sale and then be quicker than the other (equally “DAC hungry”) DIYers for the privilege of owning one.

I had just gone through all of that trouble and had managed to acquire a brand new Buffalo III board. I remember it like it was yesterday, even though it’s already been more than 5 years. I had it connected to my bench top power supply and was just doing a dry-run, I hadn’t even built the IVY-III yet, looking to see that everything was working as it should, when all of a sudden the lights on the Tridents all went very bright for half a second and then the magic smoke escaped. My power supply’s regulator IC had chosen the worst possible time to kick the bucket. Cost of repairing the power supply: ~1€. Cost of getting a new B3: ~400€ plus another 2 months of waiting.

An autopsy of the damaged board confirmed my suspicions: Almost every active component on the board was gone. Besides the Tridents and the AVCC module, the ES9018S and the Crystek clock were toast. The only components that survived were the ones behind the 3.3V regulator, which proved to be resilient enough to withstand the ~35 volts that were fed to it. So the cost of repair would be prohibitive, especially considering that I couldn’t find anyone that would sell a single ES9018S chip. So the bad board went into a cardboard box and lay there for close to 5 years.

Fast forward to 2016. ESS announces the successors to the ES9018S, the ES9028Pro & ES9038Pro chips.

These chips have a brand new digital core, much improved from the ES9018. There are new digital filters, a new DPLL system, new THD compensation features, a new gain compensation function, etc.
The ES9028Pro is supposed to be an ES9018S with an updated digital core, while the ES9038Pro is supposed to be an ES9028Pro with 4 times the output stages, resulting in an extreme output current capability. This very high current would be the reason why its DNR and THD+N performance would be off-the-charts. But it also meant that all of the existing I/V stages that were designed for the ES9018 would not work for the ES9038Pro. As of this writing, neither Twisted Pear Audio or Acko have on offering proper I/V analog stages.

I made this little table to give you a better idea of the differences between the old and new chips:

ES9018S vs. ES9028Pro vs. ES9038Pro
Feature ES9018S ES9028Pro ES9038Pro
Package 64-LQFP 64-LQFP 64-LQFP
DNR (dB) 8-ch current mode 129 129 132
DNR (dB) 8-ch voltage mode 120 no data no data
DNR (dB) stereo 133 133 137
DNR (dB) mono 135 135 140
THD (dB) current mode -120 -120 -122
THD (dB) voltage mode -108 no data no data
Differential voltage out (AVCC = 3.3V) 3.05V p-p 3.05V p-p 3.05V p-p
Differential current out (AVCC = 3.3V) 3.903mA p-p ~3.8mA p-p ~15.1mA p-p
Max PCM (w/oversampling) 500KHz 768KHz 768KHz
Max PCM (bypassing OSF) 1.536MHz 1.536MHz 1.536MHz
Max DSD (native) DSD128 DSD1024 DSD1024
DoP decoding N Y Y
Max DSD (DoP) N/A DSD256 DSD256
Digital filters (PCM) 2 7 7
Gain Calibration N Y Y
Programmable THD compensation N Y Y
Master or Slave mode support N Y Y
S/PDIF inputs 8 13* 13*
Power management N Y Y
Power consumption 100mW 500mW 500mW
1.2V (VDD) power consumption 37mA 82mA 128mA**
AVCC power consumption 25mA 47mA 90mA

* up to 13
** most likely an error in the datasheet

This info comes from the official brochures that are available on-line, with some additional info from the NDA-protected “full” datasheets. ESS, if you are reading this (and you probably are), there really is no point in trying to keep these datasheets secret. If someone like me (with my non-existant connections) can find them, so can your competitors. Plus I can’t really say that I found any content in your datasheets that would warrant such extreme measures. But I digress.

So, upon inspection of the datasheets the first thing one notices is that both new chips are pin to pin compatible with the ES9018S. That was just too convenient for me and my bad Buffalo board. Good job ESS, I really appreciated that. 🙂 🙂

On the software side, things were very different to the ES9018S. The number of registers had more than doubled (48 registers in the ES9018 versus 115 in the ES9028/38) plus their arrangement was totally different, so I would need to do a total rewrite of the code to support it. Good. More fun to be had. 😀

So now a lightbulb had lit up in my head. I didn’t have much to lose – I already had the board, I could hook up temporary power supplies and a temporary clock so all I had to buy was the actual chip. Considering that I would like to be able to use my existing analog stage, I chose to go with the ES9028Pro. I got on Ebay and ordered a couple (a friend had also decided to bite the proverbial bullet and do the same “mod” to his Buffalo).

Next up was power requirements. The required voltages are the same but the required current has doubled or even tripled, depending on which chip we are talking about. That could be a problem for the AVCC module and Tridents of the Buffalo 3. I needed to do some reading-up on the AVCC & Trident modules. It turns out that the Trident modules are capable of supplying up to 100mA of power (with the proper CCS resistors) so in theory they could be made to work. But my (burnt) Tridents were v1.1, meaning that they were not exactly famous for their robust-ness. Asking them to work near their thermal limits would be looking for trouble. Plus, while researching the Tridents I learned of their latest version, the Trident SR. These now use ultra low noise LDOs (ADM715x) and are rumoured to sound even better than their older shunt types. These days my ultra low noise LDO of choice is the LT3042 so I drew up a set of PCBs that would be a drop-in replacement for the Tridents & AVCC and made an order to a well-known Far East board house.

While waiting for the chips to arrive I had put together some Arduino code that would initialize the chip and provide some basic functionality. It was nothing special – serial port only – but it would get the job done.

After a few days the ES9028Pro chips came and there was no way I was going to wait another month for the new Tridents.

Off came the damaged components..

..to be replaced by fresh capacitors and the brand new ES9028Pro.

For the time being I chose to not solder on a new Crystek since I could not be 100% sure that the board would work.

Instead, I soldered on a two pin header to which I connected an Si570 programmable oscillator that I had lying around.

Power was to be delivered by the on-board die-hard 3.3V LDO with a little help from a small PCB holding a LT3042 taking care of the 1.2V.

I hooked everything up, connected my Arduino, powered the thing on and loaded an I2C scanner on my Arduino. I did a scan and found a single I2C address. That was not good. I should have found two (one for the on board port expander and one for the ES9028). I double checked my connections, my power, made sure that my Si570 was outputting a proper clock, but still nothing. It was time to go back to the datasheet.

My eye fell on the section pertaining to the Reset pin. It stated that it was an active-low pin and that a system reset could be performed either by pulling the pin low or by a software command. The Buffalo III design called for this pin to be pulled low by default so I hadn’t paid any real attention to it. It turned out that I should have. I soldered a 2 pin header and put a jumper on it. The board immediately came alive and was detected by my I2C scanner. 😀 So, the Reset pin should be pulled up.

With that out of the way, I connected my test I2S source (a Chinese clone of an Amanero – not as good as an original Amanero but OK for testing and pretty expendable). The DAC locked with no problem into all sampling rates up to 352K and DSD128 (I didn’t bother to try to go higher) and started playing music!

Now I’m waiting for the new replacement Tridents & AVCC module PCBs to arrive so that I can do a proper test vs. my Buffalo III.

I also need to do a version of my TFT HiFiDuino code for the 9028/9038. Stay tuned.

New page: S/PDIF receiver with the WM8805

It took me a little longer than usual (the board had been sitting around in my workshop for almost a year and a half), but it’s finally up. A page for a very good quality and very versatile Arduino controlled s/pdif receiver.

Check it out here: http://www.dimdim.gr/diyaudio/spdif-receiver-with-the-wm8805/