This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMDSSK3358: MCASP Transmit Clock Generation

Part Number: TMDSSK3358
Other Parts Discussed in Thread: AM3358, AMIC110, TLV320AIC3106

There is a very detailed diagram (Figure 22-17) of the Transmit Clock Generator in Section 22.3.5.1 of the AM335X and AMIC110 Sitara Processors Reference Manual (SPRUH73P). We have .wav files that have been recorded at an 8kHz sample rate, with 32 bits per frame (16 bit for the left channel and 16 bits for the right channel) (voice only).  The TMDSSK3358 Evaluation board comes populated with the TI TLV320AIC3106 audio codec and it is connected to the AM3358 via the MCASP1 digital audio interface. The .wav files recorded with these settings play fine with this setup.

From Figure 22-17, it indicates that the transmit bit clock, ACLKX, can be either externally sourced from the ACLKX pin or internally generated within the AM3358 via either feeding an external AHCLKX to the CLKXDIV (divides by 1 to 32 in integer values) or by using the AUXCLK (which in the case of the TMDSSK3358 Evaluation Board is 24MHz (please correct me if I am wrong on this frequency as it is crucial for the rest of the explanation) and dividing the AUXCLK by the HCLKXCTL divider (divides by 1 to 4096 in integer values).

My question is: If the TMDSSK3358 Evaluation Board is using the internal AUXCLK of 24MHZ to generate the Transmit Bit clock (ACLKX and XCLK)., the bit clock for a sound file sampled at 8kHz with 2 channels of 16 bit date would have to be 8kHz * 16 * 2 = 256kHz.  There is no integer division ratio to divide 24MHz by to get to a bit clock of 256kHz. the division ratio is 24MHz/256kHz = 93.75.  How is the correct bit clock (ACLKX and XCLK) of 256kHz generated for the audio file that we are playing.

I'm asking this because understanding how this is accomplished is crucial as we are using the Octavo OSD3358-SM RED EVM, which contains the TI AM3358 Processor with the same TI TLV320AIC3106 audio codec interfaced via MCASP that is used on the TMDSSK3358 Evaluation Board with an external AHCLKX_IN of 24.576MHZ which would require that the CLKXDIV divider be able to divide by 96 to generate a 256kHz bit clock (its maximum division is 32) that the 8kHz sampled audio would require.

I appreciate any information on how the clocks are generated for this scenario.

Thank you.

Stephen Gilbert

Staff Engineer

NORTHROP GRUMMAN

Mission Systems

  • Hi Stephen,

    I assume you are using AM335x TI PSDK Linux.

    TMDSSK3358 is using AM335x McASP1 module as slave, AIC3106 codec as master. Thus AIC3106 is generating bit clock (ACLKX) and sample rate (FSX). Check TMDSSK3358 user guide, section 3.10 Audio CodecIt is explained that AIC3106 gets its master clock (24MHz) from AM335x clkout1 pin.

    See also TMDSSK3358 linux kernel DTS file

    linux-kernel/arch/arm/boot/dts/am335x-evmsk.dts

    sound {
            compatible = "simple-audio-card";
            simple-audio-card,name = "AM335x-EVMSK";
            simple-audio-card,widgets =
                "Headphone", "Headphone Jack";
            simple-audio-card,routing =
                "Headphone Jack",    "HPLOUT",
                "Headphone Jack",    "HPROUT";
            simple-audio-card,format = "dsp_b";
            simple-audio-card,bitclock-master = <&sound_master>;
            simple-audio-card,frame-master = <&sound_master>;
            simple-audio-card,bitclock-inversion;

            simple-audio-card,cpu {
                sound-dai = <&mcasp1>;
            };

            sound_master: simple-audio-card,codec {
                sound-dai = <&tlv320aic3106>;
                system-clock-frequency = <24000000>;
            };
        };

     

    Regards,
    Pavel

  • Pavel,

    Thank you for the prompt reply.

    I understand now that the AM335x generates the McASP1 master clock and passes it to the TLV320AIC3106 CLKDIV_CLKIN MUX, which then uses this clock to generate the audio WCLK and BLCK for the McASP1 module.

    Do you have uncompiled (readable) Linux code which shows an example of how the TLV320AIC3106 is interfaced to the AM335X on the TMDSSK3358 that you can share with me?

    Any help would be greatly appreciated.

    Thank you.

    Stephen

  • Stephen,

    Stephen Gilbert52 said:
    I understand now that the AM335x generates the McASP1 master clock

    AM335x generates AIC3106 master clock (MCLK).

    Stephen Gilbert52 said:
    Do you have uncompiled (readable) Linux code which shows an example of how the TLV320AIC3106 is interfaced to the AM335X on the TMDSSK3358 that you can share with me?

    You can refer to below files for reference:

    linux-kernel/arch/arm/boot/dts/am33xx.dtsi

    linux-kernel/arch/arm/boot/dts/am335x-evmsk.dts

    linux-kernel/sound/soc/davinci/davinci-mcasp.c

    linux-kernel/sound/soc/codecs/tlv320aic3x.c

    You can also explore below user guides:

    Regards,
    Pavel