AnsweredAssumed Answered

ADSP21489 DPI Interrupt

Question asked by MarcZ on Apr 10, 2013
Latest reply on Apr 18, 2013 by MarcZ

Hi,

 

I configured an interrupt with DPI based on a PWM created first of 100kHz.

It is working but the thing I am notifying is that it is taking a lot of time before clearing the interrupt (~1µs in the InterruptHandler).

Moreover, I have an offset of 500ns between the falling edge of the PWM and the interrupt!

Here is what I did :

 

void Init_Interrupt(void)

{

     adi_int_InstallHandler(/*DPII*/ ADI_CID_P14I , (ADI_INT_HANDLER_PTR)InterruptHandler, 0, true);

 

     SRU (DPI_PB07_O, DPI_PB08_I);          // route DPI P7 (PWM) to DPI P8 (Interrupt)

     SRU (HIGH, DPI_PBEN08_I);                     // Input

 

     SRU (DPI_PB08_O, MISCB1_I);

 

     // interrupts latch on the falling edge

     *pDPI_IRPTL_FE |= EXT_MISC_1_INT;

 

     *pDPI_IRPTL |= EXT_MISC_1_INT;

 

     sysreg_bit_set(sysreg_IMASK, DPII);   //Enable DPI Interrupt

     sysreg_bit_set(sysreg_MODE1, IRPTEN); //Enable Interrupt

 

     adi_int_EnableInt(/*DPII*/ ADI_CID_P14I , true);

 

     SRU2(LOW,DAI_PB16_I);          // Test Point DAI16

     SRU2(HIGH,DAI_PBEN16_I);

}

 

void InterruptHandler(void)

{

     int temp;

 

     SRU(HIGH,DAI_PB16_I); // Set the DAI P16

     temp = *pDPI_IRPTL;

}

 

void main(void)

{

     Init_PLL();

 

     Init_PWM();

     Init_Interrupt();

 

     while (1)

     {

          SRU(LOW,DAI_PB16_I); // Set the DAI P16

          }

 

}

 

Please let me know if I missed something or how could I optimize this?

 

Thank you,

Marc

Outcomes