Hello,
I'm working with the OMAP-L137 Processor/TMS 320C6747 Starter Kit for some simple control operations.
As I'm not very familiar with DSP I worked through the manuals of AIC3106 (slas509e.pdf) and McASP (sprufm1.pdf) to understand the example codes used for the AIC Test (i.e. aic3106_tone_headphone).
But a few questions remain when I look at the read/write part of the code:
In the headphone out example:
/* Play Tone */
for ( sec = 0 ; sec < 5 ; sec++ ){
for ( msec = 0 ; msec < 1000 ; msec++ ){
for ( sample = 0 ; sample < 48 ; sample++ ){
/* Send a sample to the left channel */
while ( ! ( MCASP1_SRCTL5 & 0x10 ) );
MCASP1_XBUF5_32BIT = (sinetable[sample] << 15);
/* Send a sample to the right channel */
while ( ! ( MCASP1_SRCTL5 & 0x10 ) );
MCASP1_XBUF5_32BIT = (sinetable[sample] << 15);
}}}
question 1: what does the while loop?
question 2: why is the output data (here the sine wave) << 15 ? why is this not needed in the following example,
the line in loopback example:
/* Read then write the left sample */
while ( ! ( MCASP1_SRCTL0 & 0x20 ) );
sample_data = MCASP1_RBUF0_32BIT;
while ( ! ( MCASP1_SRCTL5 & 0x10 ) );
MCASP1_XBUF5_32BIT = sample_data;
/* Read then write the left sample */
while ( ! ( MCASP1_SRCTL0 & 0x20 ) );
sample_data = MCASP1_RBUF0_32BIT;
while ( ! ( MCASP1_SRCTL5 & 0x10 ) );
MCASP1_XBUF5_32BIT = sample_data;
question 3: I guess the second part must be /* Read then write the right sample */. Is this correct?
I would appreciate it if someone could shortly answer these questions or give me an hint to appropriate literature.
Thanks
Tobias