Hi I'm using OMAP L137 EVM
actually now I'm using the example code to program this board. To read ADC and write the DAC, I use this coding:
while (1)
{
/* Start by sending a dummy write */
while( ! ( mcasp->regs->SRCTL5 & 0x10 ) ); // Check for Tx ready
mcasp->regs->XBUF5 = 0;
/* Play Tone */
for ( msec = 0 ; msec < 1000 ; msec++ )
{
for ( sample = 0 ; sample < 48 ; sample++ )
{
/* Read then write the left sample */
while ( ! ( MCASP1_SRCTL0 & 0x20 ) );
sample_data = MCASP1_RBUF0_32BIT;
x0 = sample_data;
while ( ! ( MCASP1_SRCTL5 & 0x10 ) );
MCASP1_XBUF5_32BIT = sample_data;
}
}
}
I can get the DAC result if I use this code. I can see the signal using oscilloscope if I use that coding.
My question is if I try to eliminate the "for" looping, I can't get the signal of DAC, here is the coding:
while (1)
{
/* Start by sending a dummy write */
while( ! ( mcasp->regs->SRCTL5 & 0x10 ) ); // Check for Tx ready
mcasp->regs->XBUF5 = 0;
/* Play Tone */
/* Read then write the left sample */
while ( ! ( MCASP1_SRCTL0 & 0x20 ) );
sample_data = MCASP1_RBUF0_32BIT;
x0 = sample_data;
while ( ! ( MCASP1_SRCTL5 & 0x10 ) );
MCASP1_XBUF5_32BIT = sample_data;
}
If I use that code, I can't get the signal from DAC, Can comeone help me to find out the mistake
sorry for my bad english