Config=LogicPC Exprimenter kit with OMAP-L138 SOM. Running DSPBIOS 5.x
I have implemented an EDMA3 ping pong transfer from McASP to/from the C6748 in which I have an algorithm processing the audio data. The algorithm exists in a TSK that is held off by two SEM_pend's. These SEMs are posted by Tcc interrupts that fire after 256 bytes (128 left + 128 right) are transferred to & from the McASP. Here is a code snippet of the TSK.
===========================================
void procBuffTsk(void)
{
int16_t pingPong = PONG; while (1) { SEM_pend(&rcvBuffReady, SYS_FOREVER); SEM_pend(&xmtBuffReady, SYS_FOREVER); STS_delta(&STS_sample_period, CLK_gethtime()); STS_set(&STS_benchmark, CLK_gethtime()); (i=0; i<x; i++)
{ memcpy(gBufferXmt[pingPong], gBufferRcv[pingPong], BUFFSIZE*sizeof(int16_t)); //test algorithm } STS_delta(&STS_benchmark, CLK_gethtime()); } ============================================ I have placed an STS_delta at the beginning of the TSK in an attempt to measure the time between DMA transfers. However, the number of CPU cycles appears to be approximately half of what I would expect. Here are my calculations and measurements. 48,000 samples per second 256 samples per DMA transfer (128 left +128 right) = 5.334mSec per DMA transfer If CPU clock=300MHz, then gethtime() should return 5.334mS/(1/300e6) = 1,600,000 clock cycles. However, my STS(sample_period, gethtime()) is returning ~800,000 clock cycles, or approximately half of what I am expecting. Can anyone spot my error? I would appreciate someone doing a sanity check on my assumtions and math. Thx MikeH (sorry for the mangled formatting of the post. the forum editor is giving me fits....:(