Page 2 of 2

Re: mic_array board and adc out time usage

Posted: Sat Dec 18, 2021 6:42 pm
by aclassifier
I queried at Stack Exchange, Electrical Engineering. Don't know if it has a higher success rate then this forum. Here it is:I have an XMOS 7-mic board using the CS43L21 for ADC output. I get it working at 48 kHz, but not at 8 kHz, following the example of XMOS AN00219

I have tried to alter some parameters, but with the sheer possibilities and a round trip on my old 2010 Mac Mini (for xTIMEcomposer 14.4.1 only) of at least 3 minutes, I'm already exhausted. Should I also present it here?

Code: Select all

// By the way, the 

#define MASTER_TO_PDM_CLOCK_DIVIDER 4
#define MASTER_CLOCK_FREQUENCY      24576000
#define PDM_CLOCK_FREQUENCY         (MASTER_CLOCK_FREQUENCY/(2*MASTER_TO_PDM_CLOCK_DIVIDER))
#define OUTPUT_SAMPLE_RATE          (PDM_CLOCK_FREQUENCY/(32*DECIMATION_FACTOR))
//
i2s_config.mclk_bclk_ratio = (MASTER_CLOCK_FREQUENCY/OUTPUT_SAMPLE_RATE)/64;

// is reduced to (not that it matters):

i2s_config.mclk_bclk_ratio = DECIMATION_FACTOR * MASTER_TO_PDM_CLOCK_DIVIDER; // 8 for 48 kHz (works), 48 for 8 kHz (silent)

Re: mic_array board and adc out time usage

Posted: Sat Dec 18, 2021 8:26 pm
by CousinItt
I don't know if the i2s_master will work correctly if the mclk-bclk ratio is not a power of 2, or if it's greater than 32. You might want to try a different ratio to check.

Re: mic_array board and adc out time usage

Posted: Sat Dec 18, 2021 8:39 pm
by aclassifier
Ok, that's a thought. I tested 8, 16, 24, 36, 48, 60, 72, 96 - but only 8 worked (48 kHz)

Re: mic_array board and adc out time usage

Posted: Tue Dec 28, 2021 8:44 pm
by aclassifier
Sigh.. Sorry for the misleading heading here, the three letters danced in my brain! ADC -> DAC all over the place