Multichannel audio board clock requirements Topic is solved

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
User avatar
xlordofpainx
Experienced Member
Posts: 78
Joined: Thu Mar 08, 2018 2:44 pm

Multichannel audio board clock requirements

Post by xlordofpainx »

My question is is it possible to have the xmos xcore-200 MC audio board take 49.152Mhz to MCLK_XCORE, AUDIO_MCLK, MCLK_SPDIF? The Hardware manual of the board just states that there is a need for 24Mhz input on the M_CLK, but then on the clocking sheet there are 2 other clocks which can be used 24.576 MHz (FSEL high) or 22.5792MHz (FSEL low). 24Mhz is needed for USB applications so I have kept that, But I have replaced the circuit with a single oscillator which is providing 24 to the XMOS and 42.152 to another chip (also has one more currently unused programmable out).


View Solution
User avatar
infiniteimprobability
XCore Legend
Posts: 1124
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

49.152MHz MCLK is no problem. In fact, you can generate it from the board without any HW mods.

Change the following in customdefines.h:
from:

Code: Select all

#define MCLK_441           (512*44100)   /* 44.1, 88.2 etc */
#define MCLK_48            (512*48000)   /* 48, 96 etc */
to:

Code: Select all

#define MCLK_441           (1024*44100)   /* 44.1, 88.2 etc */
#define MCLK_48            (1024*48000)   /* 48, 96 etc */

Add the following flag to the Makefile:

Code: Select all

-DUSE_FRACTIONAL_N=1
What this does is switch over to the CS2100, configure it, and supply a 1MHz clock from an xcore port to the input of the CS2100 which then multiplies it up. Checkout audiohw.xc for the relevant setup, guarded with USE_FRACTIONAL_N conditional compilation.
User avatar
xlordofpainx
Experienced Member
Posts: 78
Joined: Thu Mar 08, 2018 2:44 pm

Post by xlordofpainx »

Great I will attempt this. Thaanks. How about when i am using this setup
Image

Do i just go with the makefile option as there is no CS2100.
User avatar
infiniteimprobability
XCore Legend
Posts: 1124
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

Ah OK - so it's just literally a change in MCLK. So all you need to change is:

1) Relevant I2C setup for your device to get the MCLK set

2) Tell the software that the MCLK is different
#define MCLK_441 (1024*44100) /* 44.1, 88.2 etc */
#define MCLK_48 (1024*48000) /* 48, 96 etc */
User avatar
xlordofpainx
Experienced Member
Posts: 78
Joined: Thu Mar 08, 2018 2:44 pm

Post by xlordofpainx »

Awesome. Amazing help again, thanks