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.

McASPTxFmtSet in StarterWare/L138



Hi

I noticed that in the McASP driver, the XFMT is set like this. My question is, what is the purpose of (wordSize >> 2)? If the wordSize is 32, the RBUSEL bit in XFMT is set. Is this a bug?

McASPTxFmtSet(baseAddr, (MCASP_TX_PAD_WITH_0 | MCASP_TX_BITSTREAM_MSB_FIRST                              | MCASP_TX_SYNC_DELAY_1BIT | (wordSize >> 2)                              | ((slotSize/2 -1) << MCASP_XFMT_XSSZ_SHIFT)                              | txMode));

Thanks

  • Hi Liz,

    You are right. This is a bug. Please find the fix below. The fix will be available with the next release. For now you can modify your McASPTxFmtI2SSet and McASPRxFmtI2SSet as below.

    void McASPTxFmtI2SSet(unsigned int baseAddr, unsigned int wordSize,
                          unsigned int slotSize, unsigned int txMode)
    {
        /* Set the mask assuming integer format */
        McASPTxFmtMaskSet(baseAddr, (1 << wordSize) - 1);

        /* Set the transmit format unit for I2S */
        McASPTxFmtSet(baseAddr, (MCASP_TX_PAD_WITH_0 | MCASP_TX_BITSTREAM_MSB_FIRST
                                 | MCASP_TX_SYNC_DELAY_1BIT
                                 | ((wordSize >> 2) & MCASP_XFMT_XROT)
                                 | ((slotSize/2 -1) << MCASP_XFMT_XSSZ_SHIFT)
                                 | txMode));
    }

    (similar changes apply to Rx function as well)

    Regards,

    Sujith.