[sdiy] Digital Audio CODEC config help

Mike Bryant mbryant at futurehorizons.com
Tue Aug 16 22:54:01 CEST 2022


Yes Mode 8 should be fine for you.  I always use I2S and Mode 4 with the STM version of the SAI interface, but LJ should be ok

-----Original Message-----
From: Synth-diy [mailto:synth-diy-bounces at synth-diy.org] On Behalf Of Richie Burnett
Sent: 16 August 2022 21:42
To: synth-diy mailing list
Subject: [sdiy] Digital Audio CODEC config help

Hi guys and girls,

I'm after a bit of help with configuring an audio CODEC for a DIY project...

In the true spirit of surviving the chip shortage I've carefully de-soldered three AK4556 3V 192kHz 24-bit audio CODEC chips from an obsolete DSP board. 
And I now want to put one of them to use for experimenting with digital audio in and out of a Kinetis KL26 (Cortex M0+ based) micro development board.  The micro has a Serial Audio Interface peripheral and I've configured it to give me 24-bit stereo audio in and out in left-justified format at 96kHz.  All the timings looks good when waveforms are checked with a scope, and looks exactly like other times I've done this sort of thing with SHARC, dsPIC, etc.

MCLK = 24.576 MHz
BCLK = 6.144 MHz
WCLK = 96 kHz

The problem I am having is figuring out how to configure the CODEC chip. 
(Datasheet link below...)

https://upverter.com/datasheet/ae3c782f80d262f78bae1b98785ec24c3267bc44.pdf

Under the "features" section on the first page of the datasheet it says that it can do a sampling rate of 54kHz to 108kHz in "Double Speed" mode with the MCLK being 256xFs.  This sounds perfect for my intended 96kHz sample rate and the math fits.  However, looking at Table 3 on page 15 it seems unclear to me which "Mode" I want.  I've narrowed it down a bit because the CODEC will be a slave.  And further narrowed it down to modes 8-11 because I want left-justified data in and out.  And we can assume that I want the ADC dc-blocking HPF filter on, so that brings the choice down to Mode 8 or Mode 9.  This is where I get stuck.  Both seem to offer 256Fs as a MCLK multiplier, but the 256Fs option in Mode 8 is marked "Double speed" and the 256Fs option for Mode 9 is marked "Normal Speed".  I guess from this that I need Mode 9 because the info on the first page said 54-108kHz is supported in Double Speed?

Maybe I'm being dumb and just getting confused.  I've done this sort of thing before for other CODECs (Cirrus Crystal) and the datasheets normally had included a table of example clock rates and sample rates, and explicitly said what configuration is required for typical audio sample rates with different MCLK frequencies.  The AKM datasheet just seems to present the data differently.

Any guidance would be much appreciated!  I haven't tried implementing any combinations yet, because I would ideally like to know that I've chosen the config right, so that if it doesn't work or I get mangled audio I can assume it's a signal integrity issue and go about shortening flying leads, termination, etc. ;-)

Thanks,

-Richie,


_______________________________________________
Synth-diy mailing list
Synth-diy at synth-diy.org
http://synth-diy.org/mailman/listinfo/synth-diy
Selling or trading? Use marketplace at synth-diy.org




More information about the Synth-diy mailing list