Urgent.
Dear friends,
I am presently test running the McASP program of Starterware 1.x.x.3 on my OMAPL138 EVM. I need to change the sampling frequency to 8192 Hz from 8000Hz.
Can I get Fs= 8192 Hz instead of 8000Hz using the formula given below
fs = (PLL_IN * [pllJval.pllDval] * pllRval) /(2048 * pllPval). Where PLL_IN = 24576 kHz ..
If possible, how to calculate the values of pllJval, pllDval, pllRval, pllPval to obtain 8192Hz.
Thanks in advance.
Regards,
Mahesh
Hi Mahesh,
I was busy with some issues, so couldnt respond to this.
I suggest to configure McASP only for Receive, may be only receive EDMA paRAM set you configure, then capture the sine wave in the three RX buffers.
You can define three paramsets and statically link them.
configuration for rxBuf0:
static struct EDMA3CCPaRAMEntry const rx0Par = { (unsigned int)(OPT_FIFO_WIDTH), /* Opt field */ (unsigned int)SOC_MCASP_1_DATA_REGS, /* source address */ (unsigned short)(BYTES_PER_SAMPLE), /* aCnt */ (unsigned short)(1), /* bCnt */ (unsigned int)rxBuf0, /* dest address */ ----> for the next paramset (rx1Par), give rxBuf1, and for rx2Par, give rxBuf2. (short) (0), /* source bIdx */ (short)(BYTES_PER_SAMPLE), /* dest bIdx */ (unsigned short)(***), /* link address */ ----> here give link to the paramset of rxBuf1. for rx1Par, give link to the paramset of rx2Par. For rx2Par, give 0xFFFF; (unsigned short)(0), /* bCnt reload value */ (short)(0), /* source cIdx */ (short)(0), /* dest cIdx */ (unsigned short)1 /* cCnt */ };
If you configure properly, the sine wave will be captured in the three buffers.
BTW, if you already know the sine wave frequency, I hope you can calculate how many samples are there in the sine wave directly from the sample values.
regards
sujith.
Dear Sujit,
I have incorporated the changes that you suggested.
Also I add one extra line here in soc_omapl138.h
#define SOC_MCASP_0_DATA_REGS (0x01D02000)#define SOC_MCASP_1_DATA_REGS (0x46400000) // extra line
But I get error in the following regarding link aadress.
// configuration for rxBuf0 static struct EDMA3CCPaRAMEntry const rx0Par = { (unsigned int)(OPT_FIFO_WIDTH), /* Opt field */ (unsigned int)SOC_MCASP_1_DATA_REGS, /* source address */ (unsigned short)(BYTES_PER_SAMPLE), /* aCnt */ (unsigned short)(1), /* bCnt */ (unsigned int)rxBuf0, /* dest address */ (short) (0), /* source bIdx */ (short)(BYTES_PER_SAMPLE), /* dest bIdx */ (unsigned short)(rx1Par), /* link address */ // mere use of rx1Par gives error: expression must have arithmetic type (unsigned short)(0), /* bCnt reload value */ (short)(0), /* source cIdx */ (short)(0), /* dest cIdx */ (unsigned short)1 /* cCnt */ };
Can you tell me why such errors are coming and what to pass as link address.
The link address is NOT the address of the structure. It is the address of the param set to which the current paramset has to be linked to. Kindly refer to the function BufferRxDMAActivate() function in the McASP example application, to see how we can give link address. Here it is done run-time. But in your case, you can statically give as I had explained.
Cheers,
Sujith.
I have been trying to capture the samples as per your suggestions.
1. I am resetting the transmitter ,disabling all the transmit interrupts , and enabling the interrupts as follows,
McASPTxIntDisable(SOC_MCASP_0_CTRL_REGS, MCASP_TX_DMAERROR | MCASP_TX_CLKFAIL | MCASP_TX_SYNCERROR | MCASP_TX_UNDERRUN); /* Enable error interrupts for McASP - Receive */ McASPRxIntEnable(SOC_MCASP_0_CTRL_REGS, MCASP_RX_DMAERROR | MCASP_RX_CLKFAIL | MCASP_RX_SYNCERROR | MCASP_RX_OVERRUN); /* Reset Transmit section */ McASPTxReset(SOC_MCASP_0_CTRL_REGS);
2. I am declaring my own array of pointers to copy from rxBufPtr
static unsigned int const ch0BufPtr[NUM_BUF] = { (unsigned int) ch0Buf0, (unsigned int) ch0Buf1, (unsigned int) ch0Buf2 };
static unsigned char ch0Buf0[AUDIO_BUF_SIZE];static unsigned char ch0Buf1[AUDIO_BUF_SIZE];static unsigned char ch0Buf2[AUDIO_BUF_SIZE];
3. I declare the paRAM set as below
/* The paRAM for rxBuf0 of Receive section. */static struct EDMA3CCPaRAMEntry const rx0Par = { (unsigned int)(OPT_FIFO_WIDTH), /* Opt field */ (unsigned int)SOC_MCASP_1_DATA_REGS, /* source address */ (unsigned short)(BYTES_PER_SAMPLE), /* aCnt */ (unsigned short)(1), /* bCnt */ (unsigned int)rxBuf0, /* dest address */ (short) (0), /* source bIdx */ (short)(BYTES_PER_SAMPLE), /* dest bIdx */ (unsigned short)(40* SIZE_PARAMSET), /* link address */ (unsigned short)(0), /* bCnt reload value */ (short)(0), /* source cIdx */ (short)(0), /* dest cIdx */ (unsigned short)1 /* cCnt */ };/* The paRAM for rxBuf1 of Receive section. */static struct EDMA3CCPaRAMEntry const rx1Par = { (unsigned int)(OPT_FIFO_WIDTH), /* Opt field */ (unsigned int)SOC_MCASP_1_DATA_REGS, /* source address */ (unsigned short)(BYTES_PER_SAMPLE), /* aCnt */ (unsigned short)(1), /* bCnt */ (unsigned int)rxBuf1, /* dest address */ (short) (0), /* source bIdx */ (short)(BYTES_PER_SAMPLE), /* dest bIdx */ (unsigned short)(41* SIZE_PARAMSET), /* link address */ (unsigned short)(0), /* bCnt reload value */ (short)(0), /* source cIdx */ (short)(0), /* dest cIdx */ (unsigned short)1 /* cCnt */ };/* The paRAM for rxBuf2 of Receive section. */static struct EDMA3CCPaRAMEntry const rx2Par = { (unsigned int)(OPT_FIFO_WIDTH), /* Opt field */ (unsigned int)SOC_MCASP_1_DATA_REGS, /* source address */ (unsigned short)(BYTES_PER_SAMPLE), /* aCnt */ (unsigned short)(1), /* bCnt */ (unsigned int)rxBuf0, /* dest address */ (short) (0), /* source bIdx */ (short)(BYTES_PER_SAMPLE), /* dest bIdx */ (unsigned short)(0xFFFF), /* link address */ (unsigned short)(0), /* bCnt reload value */ (short)(0), /* source cIdx */ (short)(0), /* dest cIdx */ (unsigned short)1 /* cCnt */ };
I can see that audio transmission is off. I want to see that audio samples recieved in rxBuf0, rxBuf1, and rxBuf2 are displayed in graph. The single time Graph reports an error that it cannot compute the starting address of rxBuf0. The capture size and display sizes are 8000 samples, with 32-bit integer data type.
The graph is empty always. The Expressions window in the Debug perspective shows- initially when program is loaded- correct size of the rxBuf0 but when the program is running, it shows Type: unknown and Error: Unknown identifier rxBuf0.
Please see the file modified . I am waiting for your suggestions.
0118.modified_asp.c
Are you there?
I think you are facing problem because aCnt, bCnt are not properly programmed. The way you are linking seems to be proper. Please refer to EDMA of TRM for details on how EDMA transfers will happen.
I incorporated the changes for aCnt, bCnt as per TRM but still the problem persists.
1145.modified_mcasp.c
Since this need more closer look at the code. I suggest you to contact your local FAE.
Regards
Baskaran