Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

PC Based Computer music servers, crossovers, and equalization

ES9028Q2M controller design
ES9028Q2M controller design
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 25th May 2018, 01:25 AM   #1
gandolf is offline gandolf  United States
diyAudio Member
 
Join Date: Apr 2017
Default ES9028Q2M controller design

As we all know the ESS DACs are protected by NDA so that the open source driver is not an option as it requires publishing the internal register definition. People use a dedicated microcontroller (MCU) as a middle-man to control the DAC to work it around. In this way, an open source driver for the MCU can be published and the real ESS DAC register definition can be hidden in the MCU firmware.
I was trying to DIY such an MCU for the last few days and would like to share what I have achieved.

I choose AVR ATXmega64A4U as the MCU as it is cheap, reliable and easy to use. TQFP44 with 0.8mm pitch is also easy to solder. The MCU has two I2C module, the idea is to configure one of them as the I2C slave to receive commands from RPi and configure the second one as the I2C master to overlay the command to the DAC. This way I can write an open source driver for the MCU (with a list of fake register definition) and use the MCU as the I2C command translator. In my test, I use a 16-bit register address and randomly map all the ES9028Q2M register address to a 16-bit address and it works quite well.

The PCB design can be found here:

GitHub - VinnyLorrin/ES9028-controller-PCB

The layout is quite simple. SDA/SCL from RPi connects to the I2C slave module, SDA/SCL from the master module connects to the DAC. Plus two PDI wires for programming and VDD/VSS.

The firmware source code can be found here:

GitHub - VinnyLorrin/ES9028Q2M-controller

It is developed based on the TWI example from ATMEL. The readme file contains more info. Note that the ES9028Q2M register definition is deleted from the source file but I have uploaded a pre-compiled binary file that contains the register definition and ready to work.

The Linux driver source code can be found here:

GitHub - VinnyLorrin/ES9028-controller-Linux-Driver

The ALSA driver is divided into three parts: a platform driver that is provided by the Raspbian system; a codec driver that controls the DAC and a machine driver bind the platform driver and codec driver together. To reuse the driver code, you only need to modify the codec driver (*-codec.c) to fit your need. Just be careful to all the id strings that the machine driver is looking for to match the platform and codec driver.

The codec driver architecture is also straightforward. ALSA has a batch of pre-defined call back function that will be called when a certain event is triggered. For example, during the boot, the initialization callback function will be called. If a user clicks play bottom anther callback function will be called. The codec driver needs to implement these functions and register them to the ALSA so that when an event happens, the right function can be called that sets the DAC registers to the right values.

I tried to comment the code as clearly as I can. Hopefully, it can provide some help.
  Reply With Quote
Old 25th May 2018, 05:02 AM   #2
DRONE7 is offline DRONE7  New Zealand
diyAudio Member
 
Join Date: Aug 2008
looking to try this soon !

Was most impressed by your previous ES9028 driver

Will this be of use for other than ES9028Q2m ?
maybe ES9038Q2m or ES9018K2m ?
  Reply With Quote
Old 25th May 2018, 09:23 AM   #3
janos_904 is offline janos_904  Hungary
diyAudio Member
 
Join Date: Mar 2009
Interested :-)
  Reply With Quote
Old 25th May 2018, 03:03 PM   #4
gandolf is offline gandolf  United States
diyAudio Member
 
Join Date: Apr 2017
Quote:
Originally Posted by DRONE7 View Post
looking to try this soon !

Was most impressed by your previous ES9028 driver

Will this be of use for other than ES9028Q2m ?
maybe ES9038Q2m or ES9018K2m ?
This one will be a little bit harder to set up for trying. You need to build the controller PCB, buy and solder the parts, buy a programmer to flash the MCU.

The controller is just a I2C command translator, it should be able to work with other DAC, maybe with a little change in firmware and/or Linux driver. It is also possible to make the firmware compatible with multiple DACs in one setup but that will increase the size of the firmware. The free IAR license has a 8KB size limitation, unfortunately.
  Reply With Quote
Old 28th May 2018, 01:16 PM   #5
iancanada is offline iancanada  Canada
diyAudio Member
 
iancanada's Avatar
 
Join Date: Dec 2009
Location: Toronto
ES9028Q2M controller design
Thanks gandolf for your effort. Looks promising.

Where is your "hifibunny-codec.h" in your GitHub?

Regards,
Ian
  Reply With Quote
Old 29th May 2018, 12:13 AM   #6
gandolf is offline gandolf  United States
diyAudio Member
 
Join Date: Apr 2017
Quote:
Originally Posted by iancanada View Post
Thanks gandolf for your effort. Looks promising.

Where is your "hifibunny-codec.h" in your GitHub?

Regards,
Ian
The .h file was used to define register address, now I include them directly into the .c file.
  Reply With Quote

Reply


ES9028Q2M controller designHide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ES9018K2M, ES9028Q2M, 9038Q2M DSD/I2S DAC HATs for Raspberry Pi iancanada PC Based 587 8th July 2018 10:23 PM
ES9028Q2M driver for Raspbian based distro gandolf PC Based 77 16th March 2018 07:19 AM
I/V stage for ES9028Q2M gandolf Digital Line Level 25 9th February 2018 06:04 AM
ES9028Q2M balanced output evert1 Digital Line Level 0 26th December 2017 01:30 PM
FS CE Design ES9018 controller unpopulated pcbs schultzsch Swap Meet 11 18th December 2016 05:58 PM


New To Site? Need Help?

All times are GMT. The time now is 03:10 AM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 15.00%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Copyright ©1999-2018 diyAudio
Wiki