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.

AM2754-Q1: How do I switch the clock source for an MCASP instance in my application?

Part Number: AM2754-Q1


Hi,

I want to develop a feature in my application that requires switching the clock source of the MCASP instance while my application is running, switching between an external reference clock and an internal clock. How can I implement this function?

image.png

I found something useful in drivers. Maybe I can modify gMcaspAttrs[instance].hwCfg and reopen mcasp instances to fulfill my needs?

/**
 *  \brief Hardware setup data clock structure
 */
typedef struct
{
    uint32_t aClk;
    /**< Clock details ACLK(R/X)CTL */
    uint32_t hiClk;
    /**< High clock details AHCLK(R/X)CTL */
    uint32_t clkChk;
    /**< Configures RX/TX CLK fail detect */
    uint8_t isHClkExt;
    /**< Flag for if HCLK is from external source */
    uint32_t hClkExt;
    /**< External HCLK (TX/RX) source */
} MCASP_ClockConfig;

 

 

  • Hi Jet, 

    In AM275, there is a dedicated glitchfree mux for switching between internal and external clocks. 

    I am attaching an example for a minimal clock-switch demo - mcasp_clock_switch_am275.zip

    You can check the 14.2.1.1.1.2.229.1 MAIN_CTRL_MMR_CFG0_MCASP1_CLKSEL and 14.2.1.1.1.2.245.1 MAIN_CTRL_MMR_CFG0_MCASP1_GF_CLK_SEL Register sections of AM275 TRM to get more info on this. 

    Please let me know, if you need anything else on this. 

    Regards,
    Ritapravo