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.

C6455 - McBsp clock rate configuration



Hello,

I am unable to configure the C6455 McBSP0 internal clock for 100 MHz operation.   However, 67 MHz operation works properly.   Specifically, when configured for 67 MHz operation, the CLKX signal is measured with an 0-scope to be 67 MHz.  When configured for 100 MHz, the CLKX frequency measures ~ 50MHz, apparently off by a factor of 2.

I have been unable to make progress on this issue and would appreciate any advice offered

.

The relevant PLL configuration is as follows:

  • CLKIN1 = 40 MHz, PREDIV=0, PLLM=29 (dec)

For a 67 MHz test, MCBSP0 is configured as follows:

  • SRGR: CLKGDV = 2
  • SRGR: CLKSM = 1

In this case the McBSP clock frequency is measured as ~67 MHz as predicted (40*30/6/3)

For 100 MHz operation, MCBSP0 is configured as:

  • SRGR: CLKGDV = 1
  • SRGR: CLKSM = 1

I would expect for this configuration to observe a CLKX frequency of (40*30/6/2)=100 MHz.

 

CSL is used for McBSP configuration.  A relevant code segment is as follows:

CSL_McbspClkSetup mcbspClock = {
    CSL_MCBSP_FSCLKMODE_INTERNAL,    /* XMT Frame-sync */
    CSL_MCBSP_FSCLKMODE_EXTERNAL,    /* RCV Frame-sync */
    CSL_MCBSP_TXRXCLKMODE_INTERNAL,  /* XMT clock */
    CSL_MCBSP_TXRXCLKMODE_EXTERNAL,  /* RCV clock */
    CSL_MCBSP_FSPOL_ACTIVE_HIGH,     /* XMT Frame-sync active high */
    CSL_MCBSP_FSPOL_ACTIVE_HIGH,     /* RCV Frame-sync active high */
    CSL_MCBSP_CLKPOL_TX_FALLING_EDGE, /* XMT clock rising edge */
    CSL_MCBSP_CLKPOL_RX_FALLING_EDGE,/* RCV clock falling edge */
    0,                               /* Frame-sync pulse width = 1 bit */
    0x20,                            /* Frame-sync pulse period  */
    //0x1,                             /*clk divide by 2  100 MHz*/
    0x2,                             /*clk divide by 3 67 MHz */
    CSL_MCBSP_SRGCLK_CLKCPU,
    CSL_MCBSP_CLKPOL_TX_RISING_EDGE ,/* CLKS pin signal rising edge */
    CSL_MCBSP_TXFSMODE_DXRCOPY,
    CSL_MCBSP_CLKGSYNCMODE_OFF   /* GSYNC = 0 means no clock synchronisation */
};

thanks in advance,
Paul

 

  • Note that 100MHz is right at the max frequency for this McBSP.
    Are you using McBSP0 or McBSP1? 
    When CLKGDV is 2 and your scope shows 67MHz frequency = 15ns period, does it also show that clk PWH is 10ns, and clk PWL is 5ns, as mentioned in spru580g page 19?
    When CLKGDV is 1 and your scope shows 50MHz frequency = 20ns period, what are the PWH and PWL? 
    Does CLKX change when you change the input CLKR frequency?  (this would be a sign of wrong clock source setting somewhere)
    Can you run the CPU slower, and see if CLKGDV=1 works correctly at a lower frequency? (this would be a sign of slipping max frequency divider somewhere)
    You might check if the CSL is setting the CLKGDV field in the SRGR register correctly, by reading back these locations, and checking the bottom 8 bits:
    If they are not the same as you set them, it is a sign of something unexpected in the CSL.
    028C 0014 SRGR0 McBSP0 Sample Rate Generator register
    0290 0014 SRGR1 McBSP1 sample rate generator register
     
  • Thanks for the prompt response.  This issue was observed on McBSP0; we have not looked at McBSP1.  Could you elaborate on the question "Does CLKX change when you change the input CLKR frequency?"  CLKR would be the clock associated with DR/FSR back to the DSP from (in our application) the FPGA.  In our application CLKX is derived from the CPU clock and we loop CLKX back in the FPGA to drive CLKR.

    We had previously (but only briefly) the items you described above and nothing was immediately apparent.  Unfortunately I am unable to work this issue for three weeks.  However, on return I will re-examine these properties and post a detailed response with the findings.

    Thanks again.

  • You are welcome.  I don't often check the forums, but I was looking for something else and saw an opportunity to contribute to one of my specialties (c64x + mcbsp)

     > Could you elaborate on the question "Does CLKX change when you change the input CLKR frequency?" 

    Its just a test for the hypothesis that the clk source muxing is set incorrectly, probably not worth testing if you don't have an easy way to do it.  You might think about what would theoretically happen (or try it as an experiment) if the C6455 were set to use CLKR as source for CLKX, while your FPGA was set to use CLKX as source for CLKR, as kind of a ring oscillator.   It seems like it would either not-toggle, or toggle at a vdd-controlled free-speed in ring-oscillator mode,  or toggle slower than spec due to some internal clock domain crossing somewhere. 

    My other leading hypothesises are 1) CLKGDV not set correctly somehow,   2) CLK divider is not able to run at its max rated speed, 

    Each hypothesis has a test to support or de-support it.

    T 1)  read back raw SRGR register to check CLKGDV setting

    T 2) run PLL and chip slower (half speed?) and show that CLKGDV=1 is operating correctly at /2 mode there, then increase chip clock speed without changing McBSP settings to see if it fails.

    Sometimes the detailed data (like pulse widths) from one test prompts ideas for another Hypothesis.