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.

C6726B McASP format

Hi all,

I'm having trouble configuring the McASP-format.

I wish to use 24-bits, MSB-first, left-aligned format in 32-bits slots on both the receive and transmit ports. On the DSP-side I want the samples represented as signed integers (for later conversion and processing in floating point).

When directly forwarding received data to the transmit port everything appears fine but when converting to floating point (double precision) and back the sound gets distorted.

Please review my McASP-configuration (below).

Best Regards,

 Tobias

  MCASP0_RMASK      = 0x00FFFFFF; // Pad the 8 MSBs.

  MCASP0_RFMT       = 0

                    | (0 << 16)   // 0-bit delay.

                    | (1 << 15)   // MSB first.

                    | (2 << 13)   // Pad with..

                    | (23 << 8)   // ..bit 23 (MSB, sign extend).

                    | (0xF << 4)  // Slot size is 32 bits.

                    | (0 << 3)    // Reads on dMAX port.

                    | (2 << 0);   // Rotate right by 8 bits.


  MCASP0_XMASK      = 0x00FFFFFF; // Use lower 24 bits.

  MCASP0_XFMT       = 0

                    | (0 << 16)   // 0-bit delay.

                    | (1 << 15)   // MSB first.

                    | (0 << 13)   // Pad with 0.

                    | (0xF << 4)  // Slot size is 32 bits.

                    | (0 << 3)    // Writes on dMAX port.

                    | (6 << 0);   // Rotate right by 24 bits.

  • tsz,

    From your description, I suspect there is nothing immediately wrong with your McASP configuration.

    With it running in the test mode where you forward received data to the transmit port, try capturing a buffer of a few hundred received samples. Look at the data and see if it is behaving the way you expect, with 24 lsb data bits and 8 sign-extended bits on the left. Then try a test where you divide the received data by 2 (>>1) and send that to the transmit side and then see if it comes out a bit softer. This will let you be confident that the McASP is working right.

    Do a little processing in fixed point, just to make completely sure, then take a look at how you are converting between the McASP's data and floating point. That is probably where your problem is, although I am making a lot of assumptions, of course. You can do the same type of test where you capture a few hundred fixed-point samples from the receive port, then run them through the conversion to floating point and see if the values stay the same as the fixed-point representation was.

    Regards,
    RandyP

  • Thanks for your answer Randy!

    It appears that the problem was that I used a simple cast for the double-to-integer conversion (resulting in the DPTRUNK instruction). When using the DPINT intrinsic the problem vanished. Rather strange since the doubles in this case should have integer values.

    Best Regards,

     Tobias