I zip my program into zip file, I can send data with EDMA manually as you said. I also can do the data receive without EDMA.
This is my program, thank you very much!
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.
I am using McASP to finish data transfer between two DSPs. In the program, I want to receive data from EDMA. However I have only one DSP, so I configure the McASP using internal Frame Syn and Internal Clk to Check my program. I only want to check how to receive the data because I can finish the procedure of sending data.
My McASP and EDMA configurations are in the Program "myMcASP_EDMA.rar". In the Program, I want to receive data each second, but I must initial MCASP configuration again and again. I can not explain why, or else there is bug in the program?
My company-supplied computer does not have support for the rar file format.
Which device are you using? Which version of CCS and CodeGen tools and CSL or PSP?
Did you start from a working example program supplied by TI or a third party?
It should not be the case that the McASP needs to be re-configured after every sample or frame, whatever the interrupt is triggered by. Depending on the function you are calling to do this reconfiguration, you may be reconfiguring the EDMA or other components, too. Perhaps one of these is what is setup incorrectly.
Please confirm that you have studied the McASP User's Guide for your device, and any documentation for the example you started from or for the function(s) you are using for this test.
Thank you for the answer first. I use the CCS3.3 for the program.
I use mcasp for the data transmitting between two DSPs. But now I have only one DSP of C6747. I want to check whether mcasp can be used for the data transmit first.
My mcasp is connected with AIC3106. I use EDMA to finish the data transmit. For the mcasp_1 receive channel use the DMA channel 2, I use the shadow range 1, so I set the PaRAM2 as follows:
EDMA_DRAE1 = 0x0000000C;
EDMA_SD1_ECR = 0x0000000C;
EDMA_SD1_EESR = 0x0000000C;
EDMA_SD1_ICR = 0x0000000C;
EDMA_DMAQNUM0 = 0x00000000;
EDMA_PARAM_REC2_OPT = 0x00102000;
EDMA_PARAM_REC2_SRC = 0x01D06000;
EDMA_PARAM_REC2_ABCNT = 0x00010001;
EDMA_PARAM_REC2_DST = (Uint32)glMcASPBuffer;
EDMA_PARAM_REC2_BIDX = 0x00010000;
EDMA_PARAM_REC2_LINKBLD = 0x0000FFFF;
EDMA_PARAM_REC2_CIDX = 0x00000000;
EDMA_PARAM_REC2_CCNT = 0x00000001;
EDMA_SD1_SECR = 0x0000000C;
EDMA_SD1_IECR = 0x0000000C;
EDMA_SD1_IESR = 0x0000000C;
EDMA_SD1_IEVAL = 0x00000001;
EDMA_TCCFG = 0x00000212;
glMcASPBuffer is the buffer where I save the data.
I initialize the mcasp as follows:
MCASP1_GBLCTL = 0;
MCASP_RFIFOCTL = 0x0101;
MCASP_RFIFOCTL |= MCASP_RENA_ON;
while ((MCASP_RFIFOCTL & MCASP_RENA_ON) != MCASP_RENA_ON);
MCASP_WFIFOCTL = 0x0101;
MCASP_WFIFOCTL |= MCASP_WENA_ON;
while ((MCASP_WFIFOCTL & MCASP_WENA_ON) != MCASP_WENA_ON);
MCASP1_RMASK = 0xFFFFFFFF;
MCASP1_RFMT = 0x00018070;
MCASP1_AFSRCTL = 0x00000102;
MCASP1_ACLKRCTL = 0x000000AF;
MCASP1_AHCLKRCTL = 0x00008000;
MCASP1_RTDM = 0x00000003;
MCASP1_RINTCTL = 0x00000000;
MCASP1_REVTCTL = 0x00000000;
MCASP1_SRCTL0 = 0x000E; // MCASP1.AXR1[0] <-- DOUT
MCASP1_XMASK = 0xFFFFFFFF;
MCASP1_XFMT = 0x00018070;
MCASP1_AFSXCTL = 0x00000102;
MCASP1_ACLKXCTL = 0x000000AF;
MCASP1_AHCLKXCTL = 0x00008000;
MCASP1_XTDM = 0x00000003;
MCASP1_XINTCTL = 0x00000000;
MCASP1_XEVTCTL = 0x00000000;
MCASP1_SRCTL5 = 0x000D; // MCASP1.AXR1[5] --> DIN
MCASP1_PFUNC = 0; // All MCASPs
MCASP1_PDIR = 0x1C000020; // All inputs except AXR1[5], ACLKX1, AFSX1
MCASP1_XGBLCTL = 0; // Reset TX
MCASP1_SRCTL5 = 0x000D; // MCASP1.AXR1[5] --> DIN
MCASP1_PDIR = 0x1C000020; // All inputs except AXR1[5], ACLKX1, AFSX1
MCASP1_XGBLCTL |= GBLCTL_XHCLKRST_ON; // HS Clk
while ( ( MCASP1_XGBLCTL & GBLCTL_XHCLKRST_ON ) != GBLCTL_XHCLKRST_ON );
MCASP1_XGBLCTL |= GBLCTL_XCLKRST_ON; // Clk
while ( ( MCASP1_XGBLCTL & GBLCTL_XCLKRST_ON ) != GBLCTL_XCLKRST_ON );
MCASP1_XSTAT = 0x0000FFFF; // Clear all
MCASP1_XGBLCTL |= GBLCTL_XSRCLR_ON; // Serialize
while ( ( MCASP1_XGBLCTL & GBLCTL_XSRCLR_ON ) != GBLCTL_XSRCLR_ON );
MCASP1_XBUF5_32BIT = 0;
MCASP1_XGBLCTL |= GBLCTL_XSMRST_ON; // State Machine
while ( ( MCASP1_XGBLCTL & GBLCTL_XSMRST_ON ) != GBLCTL_XSMRST_ON );
MCASP1_XGBLCTL |= GBLCTL_XFRST_ON; // Frame Sync
while ( ( MCASP1_XGBLCTL & GBLCTL_XFRST_ON ) != GBLCTL_XFRST_ON );
while( ! ( MCASP1_SRCTL5 & 0x10 ) ); // Check for Tx ready
MCASP1_RGBLCTL |= GBLCTL_RHCLKRST_ON; // HS Clk
while ( ( MCASP1_RGBLCTL & GBLCTL_RHCLKRST_ON ) != GBLCTL_RHCLKRST_ON );
MCASP1_RGBLCTL |= GBLCTL_RCLKRST_ON; // Clk
while ( ( MCASP1_RGBLCTL & GBLCTL_RCLKRST_ON ) != GBLCTL_RCLKRST_ON );
MCASP1_RSTAT = 0x0000FFFF; // Clear all
MCASP1_RGBLCTL |= GBLCTL_RSRCLR_ON; // Serialize
while ( ( MCASP1_RGBLCTL & GBLCTL_RSRCLR_ON ) != GBLCTL_RSRCLR_ON );
MCASP1_RBUF0_32BIT = 0;
MCASP1_RGBLCTL |= GBLCTL_RSMRST_ON; // State Machine
while ( ( MCASP1_RGBLCTL & GBLCTL_RSMRST_ON ) != GBLCTL_RSMRST_ON );
MCASP1_RGBLCTL |= GBLCTL_RFRST_ON; // Frame Sync
while ( ( MCASP1_RGBLCTL & GBLCTL_RFRST_ON ) != GBLCTL_RFRST_ON );
My EDMA HWI function is:
void myISR()
{
Uint32 countCOM = EDMA_SD1_IPR;
if ( countCOM&0x08 )
{
EDMA_SD1_SECR = 0x00000008;
EDMA_SD1_ICR = 0x00000008;
}
if ( countCOM&0x04 )
{
EDMA_SD1_SECR = 0x00000004;
EDMA_SD1_ICR = 0x00000004;
}
}
Because I have only one DSP, I can only use internal clk, frame syn. The frame syn means the data is coming. So I want to receive the data every one second. I set up the PRD in the BIOS. In the PRD function, I reconfigure the PaRAM2 as follows:
EDMA_PARAM_REC2_OPT = 0x00102000;
EDMA_PARAM_REC2_SRC = 0x01D06000;
EDMA_PARAM_REC2_ABCNT = 0x00010001;
EDMA_PARAM_REC2_DST = (Uint32)glMcASPBuffer;
EDMA_PARAM_REC2_BIDX = 0x00010000;
EDMA_PARAM_REC2_LINKBLD = 0x0000FFFF;
EDMA_PARAM_REC2_CIDX = 0x00000000;
EDMA_PARAM_REC2_CCNT = 0x00000001;
But I found that I must excute these code as follows , or I can not enter the HWI function.
MCASP1_RGBLCTL = 0;
MCASP_RFIFOCTL = 0x0101;
MCASP_RFIFOCTL |= MCASP_RENA_ON;
while ((MCASP_RFIFOCTL & MCASP_RENA_ON) != MCASP_RENA_ON);
MCASP1_RGBLCTL |= GBLCTL_RSRCLR_ON; // Serialize
while ( ( MCASP1_RGBLCTL & GBLCTL_RSRCLR_ON ) != GBLCTL_RSRCLR_ON );
MCASP1_RGBLCTL |= GBLCTL_RSMRST_ON; // State Machine
while ( ( MCASP1_RGBLCTL & GBLCTL_RSMRST_ON ) != GBLCTL_RSMRST_ON );
MCASP1_RGBLCTL |= GBLCTL_RFRST_ON; // Frame Sync
while ( ( MCASP1_RGBLCTL & GBLCTL_RFRST_ON ) != GBLCTL_RFRST_ON );
I do not know why I must Initial the mcasp configration, I can not explain it.
Thank you very much if you can give me the answer.
Several questions arise in my mind:
You are trying to receive 1 byte, once per second? This would seem to be more difficult that receiving a continuous stream of data. but this is how you have setup your PARAM.
Your McASP is connected to an AIC3106, but you intend to use the McASP for inter-DSP communication. This does not sound consistent. Why is there an AIC3106 involved?
You keep talking of using the McASP for data transmit, but the EDMA PARAM setup is for data receive. Are you transmitting the data manually?
Why are you using low-level register code to do all of the peripheral activity? This requires you to be an expert on the peripherals to avoid making any small mistakes or omissions. Please look to the Processor Support Package (PSP) for the C6747. There you will find drivers and example programs to help you get started. It is hard to debug your low-level code visually, there are too many possibilities to know what may be left out or to reverse-engineer hex values in register settings. All of this work has already been done in the PSP examples and drivers.
If you are just trying to see data movement, start without using the EDMA. Just use the DSP to poll and read/write McASP registers for the data transfers. This relieves you of the problems with interrupts and EDMA registers, until after you have the McASP data transmission and reception working to your satisfaction.
Hi, RandyP, with you questions, my answer is as follows.
I try to receive 1 byte because I just want to finish a test, I can change it into any number.
McASP is connected to an AIC3106, because this is my source right now. The board I have now is for another usage. I have to prove mcasp canbe used for data transmit until I have a board with to DSPs.
I have already realized sending data out with EDMA&McASP manually, but I meet problems for the data receive.
I use low-level register code to rescue the resource of the DSP, for the data transmit is only a small part of the whole program. I have read the PSP already until I begin my own code. I know it is hard to debug my low-level code visually, so would you mind give me your e-mail or any method I can send the whole program to you?
And I can finish the data transimit without EDMA now, I just want to use EDMA to rescue resouce.
Thank you very much and waiting for next your letter.
baby mercy said:I have already realized sending data out with EDMA&McASP manually
Does this mean that your transmit (sending data) works by configuring McASP and EDMA, then manually triggering EDMA to send 1 data frame? Then you can 1 second later trigger the EDMA manually again and send 1 more data frame?
baby mercy said:it is hard to debug my low-level code visually
You can zip your source file(s) and attach that zip file to your next reply. It will still be mostly a visual debug and the code will still be low-level, so this will not be likely to help much.
baby mercy said:And I can finish the data transmit without EDMA now, I just want to use EDMA to rescue resource.
This is absolutely the right final result, to use the EDMA to avoid using too much DSP CPU resource.
Have you been able to do the data receive without EDMA? This is the operation that you have been describing as not working with EDMA. If you can get it to work without EDMA, then you will be much closer to having it working with EDMA because we can make smaller steps to get from a working system to another working system.
It is excellent that you have solved your problem. I am sorry not to have been more help.
When you have a chance, please post a description of the solution so that other members of the E2E Community will benefit from your success.
Hi baby mercy
I am experiencing the same problems. Could you post your solution code PLEASE?
Regards
Ian