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?