Post Go back to editing

PCG CLK when working for SPORT TDM mode

Category: Hardware
Product Number: ADSP-21593

Hello,

My 21593 is using a 25MHZ crystal, and now I want to config my SPORT 0 working at TDM16 with 32bit, The clock should be 24.576MHz and FS should be 48KHz. However when I config the PCG I meet some problem, it seems the CLK can't be divide to 24.576MHz. and using "adi_sport_ConfigClock" function meet the same problem. What can I do to config my TDM clock?

Thanks

  • Hi,

    We would suggest you refer the below FAQ link:
    ez.analog.com/.../adsp-sc594-spdif-example

    In this example we are providing the 24.576Mhz input to the PCG from the DAI pin externally. This will be done by the SRU ("SRU(DAI1_PB03_O,PCG0_EXTCLKA_I);").
    Note: There is a typo in the Readme block diagram. DAI103 actually takes 24.576 MHz not 25.476MHz
     
    PCG configuration part is helpful to understand about input clock selection . So, You can take this as reference, and you can modify as to TDM mode. Hope this will clarify.

    You can also refer to the "SPORT_TDM_Mode" examples from ADSP-21593 BSP.

    Download the BSP of ADSP-21593 using below link:
    download.analog.com/.../ADI_EV-SC59x_EZ-KIT-Rel2.0.0.exe

    After installation, you can navigate the example from the below mentioned installation path.
    path: \Analog Devices\EV-SC59x_EZ-KIT-Rel2.0.0\EV-SC59x_EZ-KIT\Examples\drivers\sport

    For details on how to program clock divisor for PCG using PCG_CTLxx registers, please refer to the Hardware Reference Manual below:
    www.analog.com/.../adsp-2159x-sc591-592-594-hrm.pdf

    Also, please refer the below ezone thread, which might be helpful to you.
    ez.analog.com/.../in-adsp-21593-if-i-want-to-set-sport0a-as-i2s-rx-and-the-bit-clk-and-fs-clk-are-externally-provided-do-i-need-to-config-the-sport-clock-and-framesync

    Regards,
    Ranjitha R

  • Hello Ranj,

    So for the 24.576MHz it can only be provided by external and input from DAI right? there is now way for ADSP itself to produce a 24.576MHz with a 25MHz crystal. is my understand correct?

    Thanks,

    Siyu

  • Hi,

    Yes, your understanding is correct.

    Please let us know if you need any further assistance.

    Regards,
    Ranjitha R

  • Hi Ranji,

    I see the documents and demo code and I use a SRU function connect the dai0_P15 to PCG clk in

    SRU(DAI1_PB15_O,PCG0_EXTCLKA_I); ,and I config the PCG as :
    void PCG_init(void)
    {
        ADI_PCG_CLK_INFO gClkInfoA =
        {
            ADI_PCG_CLK_EXT,              /* Clock Source */
            1u,                             /* Clock Divisor */
            false                           /* External Trigger */
        };

        ADI_PCG_FS_INFO gFsInfoA =
        {
            ADI_PCG_CLK_EXT,                /* Clock Source */
            512u,                            /* Frame Sync Divisor */
            256u,                           /* Pulse Width */
            4u,                             /* Phase */
            false,                           /* External Trigger */
            ADI_PCG_FSBYPASS_MODE_NORMAL     /* Bypass Mode */
        };

        adi_pcg_Init(ADI_PCG_DEV_A,&gClkInfoA,&gFsInfoA);


    }
    However when I measure the output of SPORT0A the clk is HIGH and framesync is LOW, is the way I use PCG error or some other reason?
    Thanks,
    Siyu
  • Hi,

    Since you are configuring clock and Frame sync selected from the external PCG. You need to configure Frame sync external source as "ADI_PCG_FS_EXT" instead of "ADI_PCG_CLK_EXT" under PCG FS configuration.

    Please find the below code snippet.

    ADI_PCG_FS_INFO gFsInfoA =

        {
            ADI_PCG_FS_EXT,                /* Clock Source */
            512u,                            /* Frame Sync Divisor */
            256u,                           /* Pulse Width */
            4u,                             /* Phase */
            false,                           /* External Trigger */
            ADI_PCG_FSBYPASS_MODE_NORMAL     /* Bypass Mode */
        };
    Regards,
    Ranjitha R
  • Thanks Ranji, I found that if change external CLK to DAI0PB07 it can work now. Thanks a lot for your help. it has been solved now.