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.

Problem with McASP and higher clock frequency



Hello,

i have a problem with the McASP unit and with higher external clock frequency.

I used the McASP as transmitter with an external clock. The McASP is connected to a simple DAC. For my tests i used a function generator for the clock frequency. With 6.144MHz everything worked fine.i always got a correct output.

If i double the frequency to 12.288MHz before starting my program, it does not function. I never get an output. If i start with 6.144MHz and increase, after starting the program, the frequency to 12.288MHz everything worked fine, too. So it is a start problem of the unit. I think it is a syncronization problem of the McASP. I read chapter 2.4.1.2 and initialize the McASP exactly as written in the user guide of the McASP unit.

My output is done in the receive interrupt. The receive channel is connected through the McBSP unit. The receive interrupt is always coming, if i start with 12.288MHz. As output data i used a sinus array for independing testing the transmitter.

I examined the AXR7 data pin at 12.288MHz. No data is clocked out.

Here is my McASP initialization code:

   EVMOMAPL138_lpscTransition(PSC1, DOMAIN0, LPSC_MCASP0, PSC_ENABLE);
   EVMOMAPL138_pinmuxConfig(PINMUX_MCASP_REG_0, PINMUX_MCASP_MASK_0, PINMUX_MCASP_VAL_0);
   EVMOMAPL138_pinmuxConfig(PINMUX_MCASP_REG_2, PINMUX_MCASP_MASK_2, PINMUX_MCASP_VAL_2);
  
   MCASP->GBLCTL  = 0;

   MCASP->XMASK      = 0xFFFFFFFF;
   MCASP->XFMT       = 0x000080B8;
   MCASP->AFSXCTL    = 0x00000113;
   MCASP->ACLKXCTL   = 0x000000EF;
   MCASP->AHCLKXCTL  = 0x00000000;
   MCASP->XTDM       = 0x00000003;
   MCASP->XINTCTL    = 0x00000000;
   MCASP->XCLKCHK    = 0x00FF0008;
  
   MCASP->SRCTL7     = 0x0000000D;

   MCASP->PFUNC      = ~(0x1C000080);
   MCASP->PDIR       = 0x14000080;   

   MCASP->DITCTL     = 0x00000000;
   MCASP->DLBCTL     = 0x00000000;
   MCASP->AMUTE      = 0x00000000;

  SETBIT(MCASP->XGBLCTL, XHCLKRST);
  while (!CHKBIT(MCASP->XGBLCTL, XHCLKRST)) {}
  SETBIT(MCASP->XGBLCTL, XCLKRST);
  while (!CHKBIT(MCASP->XGBLCTL, XCLKRST)) {}
  MCASP->XSTAT = 0x0000FFFF;       
  SETBIT(MCASP->XGBLCTL, XSRCLR);
  while (!CHKBIT(MCASP->XGBLCTL, XSRCLR)) {}
  MCASP->XBUF7 = 0;   
  SETBIT(MCASP->XGBLCTL, XSMRST);
  while (!CHKBIT(MCASP->XGBLCTL, XSMRST)) {}
  SETBIT(MCASP->XGBLCTL, XFRST);
  while (!CHKBIT(MCASP->XGBLCTL, XFRST)) {}
  while(!CHKBIT(MCASP->SRCTL7, XRDY)) {} 
  MCASP->XBUF7 = 0;

Have anybody an idea what is wrong?

  • Can you provide some more information?  What device is this on?  Which pins are you using?  What do the status registers report when the McASP fails to start?

    -Tommy

  • Thanks, for your answer!

    I see with the scope, that sometimes the clock is not recognized correctly from the McASP unit. I shorten the clock line on my testboard and use a oscllator with 12.288MHz. Now it works.

     

     

  • Tommy,

    do you have an explanation why the previous solution works, if i start with 6.144MHz and increasing to 12.288MHz? Is there a higher requirement on the waveform of the clock line at the start of the McASP unit?

  • My guess is that the clock circuitry was able to lock on to the 6.144MHz and gradually correct up to 12.288MHz.  There is clock-failure detection logic that may have rejected the 12.288MHz and prevented the McASP from starting.