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.

C6747 MCASP transfering data problem

Now I'm using McASP to sending data out for a test. The sending and receiving data are both successful. The sending CLKX, FSRX are both from external. But there is a curious phenomenon that confused me for a long time. It' sending the data out, when my code is programmed as follows, Uint32 RcvData=0; while(1) { if(RcvData ==0) { MCASP0_SendStart(); // Transmit Initialization for (i=0; iXSTAT & 0x0020)); mcasp0Regs->XBUF0 = (Uint32) 0xAB987654; } mcasp0Regs->GBLCTL = 0x00; } } But when I added 2 program statements as follow, it can't sent the data out. Uint32 RcvData=0; while(1) { RcvData++; RcvData--; if(RcvData ==0) { MCASP0_SendStart(); // Transmit Initialization for (i=0; iXSTAT & 0x0020)); mcasp0Regs->XBUF0 = (Uint32) 0xAB987654; } mcasp0Regs->GBLCTL = 0x00; } } Why not the MCASP send the data out when I add "RcvData++" and "RcvData--"? Please give me some suggestion. Thanks a lot.
  • Is there any other code writing to RcvData?  Does your code ever make inside the if statement?  What does MCASP0_SentStart() do?

  • Thanks for your reply. It's just my testing code in my fisrt post. Actually, I want to operate the MCASP acting as this, " there is an external interrupt, when the code is running into the interrupt servicing, I want to open the MCASP sending, then send 10 32bits data out, and then close the MCASP sending. The interrupt is triggered once every 10ms." And it failed. So I close the interrupt, and want to firstly make it successful that "open the MCASP----send the data out-----close the MCASP" in my main code instead of in the interrupt servicing. Just as my first post said, it is successful to send the data out when there is no other statement before openning the MCASP. However, when I add the statement whatever (like detecting a low level in an input GPIO,etc ) and the operating with RcvData is just another example, it will failed. And the external FSX and CLKX is always existing. Why? How does it cause the MCASP to work incorrectly? There is no other code writing to the RcvData, it's just a testing example. MCASP0_SendStart() is just taking the MCASP's AHCLKX, ACLKX, serializers, state machines, frame sync generators out of reset. It's just the Transmit Section Initialization. Can you give me any suggestion for the problem or other testing method? Thanks a lot!
  • It sounds like there is a race condition between taking the McASP out of reset and the arrival of the external frame sync.  Based on your description of the problem, it sounds like you have barely enough time to take the McASP out of reset and load the transmit registers before the external frame sync arrives.  Adding "problem" code maybe adding enough delay to where you don't meet the real-time deadline of servicing the McASP.  Is it possible to preload the data in the McASP before the external frame sync arrives?  If not, can you use internal frame sync?

  • Thanks for your reply! I think you're right. I have used the internal frame sync instead of external frame sync, and it works well. Thanks a lot !