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.

CSL 1.30 how to init I2S for DMA use?

Guru 15580 points

I am trying to use the CSL to initialize the I2S0 peripheral for DMA usage. However, the CSL appears to always initialize two interrupts (tx & rx). However, the I2S User Guide states:

Hence, it is recommended to disable CPU data-transfer interrupts in the I2SINTMASK register when using the DMA for data transfers.

How do I use the CSL to initialize the I2S peripheral for DMA usage?

  • I am also looking for an explanation for this process (ping pong mode specifically)!

    Thanks,
    Nate 

  • Hello,

    Could someone from TI respond to this question please?
    I am unable to configure I2S using the CSL in any way that results in the Interrupt Mask Register having a value of 0x0000. In the Technical Reference for the C5535, it is stated that:


    the transmit and receive interrupts should be enabled in the I2SINTMASK register if CPU transfers are desired; if DMA is used to transfer data these interrupts
    should be disabled.

     Therefore, the I2SINTMASK register should read 0x0000 for usage with the DMA. However I cannot, using the CSL, make the contents of the I2SINTMASK register 0x0000. Seeing as how the DMA is critical for most DSP applications, this important question should be answered.

    Thank you,

    Nathan 

     

  • Nathan,

    It is in the file csl_i2s.c. In the CSL_Status subroutine I2S_setup which checks for mono/stereo to set I2SINTMASK. I changed it to the following and ran it with CSL_I2S_DMAExample (example2) and it runs fine. I am using CSL version 2.50. Latest version is CSL3.03. You can check out this forum posting:

    http://e2e.ti.com/support/dsp/c5000/f/109/t/262217.aspx

      /* Channel type is Mono/Stereo, Set the dependant bit*/
      if(hI2s->chType == I2S_CHAN_MONO)
      {
       CSL_FINST(regs->I2SSCTRL, I2S_I2SSCTRL_FRMT, SET);
       /* Left transmit & recv channel disable */
       CSL_FINST(regs->I2SINTMASK, I2S_I2SINTMASK_XMITST, DISABLE);
       CSL_FINST(regs->I2SINTMASK, I2S_I2SINTMASK_XMITMON, ENABLE);
       CSL_FINST(regs->I2SINTMASK, I2S_I2SINTMASK_RCVST, DISABLE);
       CSL_FINST(regs->I2SINTMASK, I2S_I2SINTMASK_RCVMON, ENABLE);
      }
      else
      {
       CSL_FINST(regs->I2SSCTRL, I2S_I2SSCTRL_FRMT, CLEAR);
       /* Right transmit & recv channel disable */
       CSL_FINST(regs->I2SINTMASK, I2S_I2SINTMASK_XMITST, DISABLE); // steve ENABLE);
       CSL_FINST(regs->I2SINTMASK, I2S_I2SINTMASK_XMITMON, DISABLE);
       CSL_FINST(regs->I2SINTMASK, I2S_I2SINTMASK_RCVST, DISABLE); // steve ENABLE);
       CSL_FINST(regs->I2SINTMASK, I2S_I2SINTMASK_RCVMON, DISABLE);
      }

    This is the I2S0 peripheral IO register display with a breakpoint set right after I2S_setup is executued in the main program. 0x2814 I2SINTMASK is all zeros.

    0x00002800 0x0A92 0x0000 0x0000 0x0000
    0x00002804 0x0011 0x0000 0x0000 0x0000
    0x00002808 0x0000 0x0000 0x0000 0x0000
    0x0000280C 0x0000 0x0000 0x0000 0x0000
    0x00002810 0x0000 0x0000 0x0000 0x0000
    0x00002814 0x0000 0x0000 0x0000 0x0000

    And this is the main program printf display:

    CSL I2S DMA MODE TEST!

    I2S Module Instance opened successfully
    I2S Module Configured successfully
    I2S Reset Successful
    I2S Close Successful
    I2S Read & Write Buffers Match!!!

    CSL I2S DMA MODE TEST PASSED!

     Hope this help.

    Regards.

     

     

  • Thanks for the reply Steve,

    Correct me if I am misunderstanding, but it looks like you had to go into the CSL and edit a source file in order to have I2SINTMASK be set to 0x0000 (while using I2S in stereo mode). I was trying to use the CSL as it is and have I2SINTMASK be set to 0x0000, while still using the I2S in stereo mode. Based on your answer, I see that this is not possible. It seems my options are edit CSL source files, which I thought the user should not have to do, or bypass the CSL and use register level programming. 
    I have opted to use register level programming, but it seems as if this is a feature that should be added, because it seems logical that in the future people will expect to program with the CSL to use I2S in stereo mode, with the DMA (meaning I2SINTMASK must be 0x0000), and as it stands (unless I am misunderstanding) this is not possible unless CSL source files are edited to make this happen. 

    Again, thanks for the response,

    Nathan 

    P.S. Thanks for the link to the updated CSL.  

  • Nathan,

    Note taken. I have submitted a bug ticket to CSL for future revision update.

    Regards.

  • Steve Tsang said:

     I have submitted a bug ticket to CSL for future revision update.

    Excellent! (myself and future C5000 users) thank you so much!

    - Nate