AnsweredAssumed Answered

SPORT Interrupting Continuously

Question asked by wrswrsnz on Feb 25, 2013
Latest reply on Sep 27, 2013 by MaheshN

Hi,

 

I'm fairly new to the ADSP-21469 and at the begining of a new project to create a FIR based active crossover.

I'm having trouble with the SPORT interrupts.

 

So far I have a Timer Interrupt working fine generating timing ticks on Timer0 + generating a 40kHz PWM output to control a VCXO via LPF on Timer1.

 

Then I've set SPORT0 up as an I²S receiver using non-DMA interrupts to process the receive buffer. If I have no clock signals going to the SPORT there is no interrupt - expected behaviour. If the clock signal is enabled I get continuous interrupts at approx 625kHz with and input sample rate of 48kHz. If I stop the input clock the interrupts continue at 625kHz. I am monitoring a narrow pulse on DPI_PB01 with a scope.

If I change the interrupt(SIG_SP0,SPORT0_ISR) to interrupts(SIG_SP0,SPORT0_ISR) the rate goes up to 1.6MHz...

 

I've looked through the questions and answers here and think I've done everything correctly based on what others have had success with but cannot find why the interrupt runs continuously. I'm reading the *pDAI_IRPTL_H value which is supposed to clear the interrupt source but have noticed in the code examples that came with VisualDSP this is not used in the ISR.

 

I suspect I have something set up incorrectly in the settings of VisualDSP or maybe something missed in the code. Any suggestions where to start please?

 

void    main()

{

    init_PLL();

    init_DAI();

    init_SRU();

    init_SPORT();

         

    interrupt(SIG_SP0,SPORT0_ISR);

    interrupt(SIG_P2,TIMER0_ISR);

       

    // Now everything that happens is interrupt driven so we can sit in an endless loop...

       for (;;)

      {

        asm("idle;");     

      }

}

 

void init_SPORT(void)

{

    *pSPMCTL0     = 0;

    *pSPCTL0     = 0;

       

 

    // *** SPORT0 ***************************************************************

    // MODE = INPUT

    // Set up External I²S Input to SPORT0 Input

    // Output from SPORT0 goes to the core - in Core Transfer Mode (non DMA)

    *pSPCTL0 = (SPEN_A|                      /* Enable Channel A */

                        SLEN24|                       /* 32-bit word length */

                        OPMODE|                    /* Enable I2S Mode*/

                        L_FIRST);                     /* I2S sends left channel first */       

    *pDIV0         = 0;                               //externally generating clock and frame sync  

    // *** SPORT0 ***************************************************************

}

 

void SPORT0_ISR(int sig_int)

{

    int temp;

    temp = *pDAI_IRPTL_H;

    SRU(HIGH, DPI_PB01_I);

    SRU(LOW, DPI_PB01_I);

    asm("nop;");

    asm("nop;");

    asm("nop;");

    asm("nop;");

    asm("nop;");

    asm("nop;");

    asm("nop;");

    asm("nop;");

    asm("nop;");

    asm("nop;");

}

Outcomes