• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » C5000 Ultra Low Power DSP » C5000 Ultra Low Power DSP Forum » I2S Transmit interrupt not generated
Share
C5000 Ultra Low Power DSP
  • Forum
  • Announcements
Options
  • Subscribe via RSS
Top 6 Wiki Links
  • C5000 Main Wiki
  • C5000 Software
  • C5515 Boot-Image Programmer
  • CSL (including CSL 3.00)
  • C5000 Connected Audio Framework
  • Porting C5000 Teaching ROM to C5535 eZdsp
  • Forums

    I2S Transmit interrupt not generated

    This question is answered
    Simon Attard
    Posted by Simon Attard
    on Mar 15 2012 18:06 PM
    Intellectual755 points

    Hi friends,

    I am using a C5515 device and a AIC3254 audio codec. I am trying to connect the codec to the DSP using I2S.

    I want this configuration:

    AIC as a master, DSP as a slave.

    16bit words

    48ksamples per second

    write data to the codec and output it to the head phones.

    The AIC is connected using I2S 1.

     

    Below please find a sample from the code I am using.

    I am having two problems:

    1) The transmit interrupt is never received, so the code stops in the while((Xmit & I2S1_IR) == 0);

    2) I hear a lot of noise, and not the sound that I send to the codec.

     

    Any help please? I suspect I have some wrong PLL or clock settings, but am not sure. I have tried several types of settings, but after three days trying, I decided to see if I could get an opinion from you guys :)

     

    Thanks a lot!

    Simon

     

     

     

     

    void main( void )
    {
       aic3254_initialise();
      
       test();
    }


    Int16 aic3254_initialise( )
    {
     SYS_EXBUSSEL &= ~0x7000;  
        SYS_EXBUSSEL |=  0x1000;         // Configure Parallel Port
     
        /* Configure Serial Port */
     SYS_EXBUSSEL &= ~0x0C00;   
     SYS_EXBUSSEL |=  0x0400;         // Serial Port mode 1 (I2S1 and GP[11:10])
     
     EVM5515_GPIO_init();
     EVM5515_GPIO_setDirection(GPIO10, GPIO_IN);
     EVM5515_GPIO_setDirection(GPIO11, GPIO_IN);
     EVM5515_GPIO_setDirection(GPIO4,  GPIO_OUT);
     EVM5515_GPIO_setOutput( GPIO4, 1 );    // Take AIC3254 out from reset
     EVM5515_wait( 100 );         // Wait
     EVM5515_I2C_init( );                      // Initialize I2C
     
     
     /* Configure AIC3204 */
        AIC3204_rset(  0, 0x00 );           // Select page 0
        AIC3204_rset(  1, 0x01 );           // Reset codec
        AIC3204_rset(  0, 0x01 );           // Point to page 1
        AIC3204_rset(  1, 0x80 );           // Disable crude AVDD generation from DVDD
        AIC3204_rset(  2, 0x00 );          // Enable Analog Blocks
     
        // PLL and Clocks config and Power Up 
        AIC3204_rset(  0, 0x00 );           // Select page 0
        AIC3204_rset( 27, 0x0D );           // BCLK and WCLK is set as i/p to AIC3204(Slave)
        AIC3204_rset(  4, 0x03 );           // BCLK and WCLK are outputs
        AIC3204_rset(  6, 0x08 );           // PLL setting: J
        AIC3204_rset(  7, 0x07 );             // PLL setting: HI_BYTE(D)
        AIC3204_rset(  8, 0x80 );             // PLL setting: LO_BYTE(D)
        AIC3204_rset( 30, 0x91 );
     
        // For 48 KHz sampling
        AIC3204_rset(  5, 0x92 );           // PLL setting: Power up PLL, P=1 and R=2
        AIC3204_rset( 13, 0x00 );           // Hi_Byte(DOSR) for DOSR = 128 decimal or 0x0080 DAC oversamppling
        AIC3204_rset( 14, 0x80 );           // Lo_Byte(DOSR) for DOSR = 128 decimal or 0x0080
        AIC3204_rset( 20, 0x80 );           // AOSR for AOSR = 128 decimal or 0x0080 for decimation filters 1 to 6
        AIC3204_rset( 11, 0x88 );           // Power up NDAC and set NDAC value to 8
        AIC3204_rset( 12, 0x82 );           // Power up MDAC and set MDAC value to 2
        AIC3204_rset( 18, 0x88 );           // Power up NADC and set NADC value to 8
        AIC3204_rset( 19, 0x82 );           // Power up MADC and set MADC value to 2
     
        // DAC ROUTING and Power Up
        AIC3204_rset(  0, 0x01 );           // Select page 1
        AIC3204_rset( 12, 0x08 );           // LDAC AFIR routed to HPL
        AIC3204_rset( 13, 0x08 );           // RDAC AFIR routed to HPR
        AIC3204_rset(  0, 0x00 );           // Select page 0
        AIC3204_rset( 64, 0x02 );           // Left vol=right vol
        AIC3204_rset( 65, 0x00 );           // Left DAC gain to 0dB VOL; Right tracks Left
        AIC3204_rset( 63, 0xd4 );           // Power up left,right data paths and set channel
        AIC3204_rset(  0, 0x01 );           // Select page 1
        AIC3204_rset( 16, 0x06 );           // Unmute HPL , 6dB gain
        AIC3204_rset( 17, 0x06 );           // Unmute HPR , 6dB gain
        AIC3204_rset(  9, 0x30 );           // Power up HPL,HPR
        AIC3204_rset(  0, 0x00 );           // Select page 0
        EVM5515_wait( 500 );                // Wait
     
        // ADC ROUTING and Power Up
        AIC3204_rset(  0, 0x01 );           // Select page 1
        AIC3204_rset( 52, 0x0C );           // STEREO 1 Jack
                 // IN2_L to LADC_P through 40 kohm
        AIC3204_rset( 55, 0x0C );           // IN2_R to RADC_P through 40 kohmm
        AIC3204_rset( 54, 0x03 );          // CM_1 (common mode) to LADC_M through 40 kohm
        AIC3204_rset( 57, 0xC0 );           // CM_1 (common mode) to RADC_M through 40 kohm
        AIC3204_rset( 59, 0x00 );           // MIC_PGA_L unmute
        AIC3204_rset( 60, 0x00 );           // MIC_PGA_R unmute
        AIC3204_rset(  0, 0x00 );           // Select page 0
        AIC3204_rset( 81, 0xc0 );           // Powerup Left and Right ADC
        AIC3204_rset( 82, 0x00 );           // Unmute Left and Right ADC
       
        AIC3204_rset( 0,  0x00 );   
        EVM5515_wait( 200 );  // Wait
       
     /* I2S settings */
        I2S1_SRGR = 0x0015;
        I2S1_ICMR = 0x003F;           // Enable interrupts
        I2S1_CR   = 0x8010;           // 16-bit word, Slave, enable I2C

    }

     

    Int16 test( )
    {
     for ( i = 0 ; i < 5 ; i++ )
        {
            for ( j = 0 ; j < 1000 ; j++ )
            {
                for ( sample = 0 ; sample < 48 ; sample++ )
                {
                 data3 = I2S1_W0_MSW_R;
                   data1 = I2S1_W0_LSW_R;
                   data4 = I2S1_W1_MSW_R;
                   data2 = I2S1_W1_LSW_R;
                  
                 while((Rcv & I2S1_IR) == 0);  // Wait for interrupt
                 
                    I2S1_W0_MSW_W = (sinetable[sample]) ;
                    I2S1_W0_LSW_W = 0;
                    I2S1_W1_MSW_W = (sinetable[sample]) ;
                    I2S1_W1_LSW_W = 0;
                    while((Xmit & I2S1_IR) == 0);  // Wait for interrupt
                   
                }
            }
        }
    }


     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Hyun Kim
      Posted by Hyun Kim
      on Mar 16 2012 12:28 PM
      Genius12785 points

      Hi,

      1. What hardware platform are you using?

      2. You did not include interrupt enable code.

      3. Where is interrupt handling code?

      Regards,

      Hyun

      ---------------------------------------------------------------------------------------------------------

      Please click the Verify Answer button on this post if it answers your question.

      Check out these great resources

      http://processors.wiki.ti.com/index.php/Category:C5000
      --------------------------------------------------------------------------------------------------------- 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Simon Attard
      Posted by Simon Attard
      on Mar 16 2012 12:59 PM
      Intellectual755 points

      Hi Hyun,

      Thanks for your reply.

      I am using the TMS320C5515EVM and the Digital Stethoscope Front End, both from TI.

      I did not use an Interrupt Service Routine. I check the interrupt flag in the while loop:

      while((0x20 & I2S1_IR) == 0);

      The code gets stuck in this line.

      What could be the problem?

      Thanks once again.

       

      Simon

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Simon Attard
      Posted by Simon Attard
      on Mar 19 2012 03:01 AM
      Intellectual755 points

      Hi Hyun,

      Attached please find the project (CCS v4) that I am using.

      6545.aic3204_Modified.zip

      4744.evm5515.zip

      Note that I am using the AIC3204 test code that was supplied with the TMS320C5515EVM. What I did was that I changed the code to use I2S1 instead of I2S2 and I also modified the GPIO ports (in aic3204_test.c) so that to switch off the AIC3204 on the EVM and switch on the AIC3254 on the Analogue Front End board.

      As explained earlier, the code stops on the while ((Xmit & I2S1_IR) == 0); loop.

      Regards,

       

      Simon

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Simon Attard
      Posted by Simon Attard
      on Mar 21 2012 13:42 PM
      Intellectual755 points

      Still not able to solve this problem. Any help is more than welcome!

      Thanks!

      Simon

      C5515 AIC3254
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Simon Attard
      Posted by Simon Attard
      on Apr 02 2012 14:51 PM
      Verified Answer
      Verified by Simon Attard
      Intellectual755 points

      Hi all,

      This is for the benefit of other people who might experience the same problem. I have spent a whole two weeks trying to figure out what was wrong, and the solution was very simple.

      I had a MMC card inserted into connector J15. As soon as I took it out, everything started to work!

       

      Simon

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use