AnsweredAssumed Answered

Enabling DAI pin as input and configuring interrupt on this pin

Question asked by Daniel_Sch_ISEA on Sep 16, 2014
Latest reply on Sep 2, 2016 by oldfoxsoftware



i just started a few weeks ago developing code with VisualDSP++ 5.0 for an ADSP-21469 used in a control platform. For a new functionality, i want to generate an interrupt on falling-edge on a DAI pin (DAI_P18). I read the processor hardware reference and some of the threads i could find here and i now have the following code the configure the DAI_P18 as input and generate interrupts on falling edge:


void (*pt2P0I)(int dummy) = NULL;
pt2P0I = IRQfunction;                   // Bind to Method IRQfunction()

SRU(LOW,DAI_PB18_I);                    // Pin Buffer 19 low -> DAI_p18 is input
SRU(DAI_PB18_O,MISCB0_I);               // Route Pin Buffer 19 (output) to MISCB_0
SRU(LOW,PBEN18_I);                      // Pin Buffer 19 low -> disable pin buffer

*pDAI_IRPTL_PRI = SRU_EXTMISCB0_INT;    // Bind DAI Interrupt Priority Register to EXT_MISCB_0 Interrupt (= DAI_INT_22)
*pDAI_IRPTL_FE = SRU_EXTMISCB0_INT;     // DAI Falling Edge Interrupt Latch Register
*pDAI_IRPTL_RE = 0;                     // DAI Rising Edge Interrupt Latch Register


In the function IRQfunction() i'm doing the following (besides unimportant stuff):

unsigned temp;
temp = *pDAI_IRPTL_H;                   // read the DAI High Priority Interrupt Latch Register
*pDAI_IRPTL_FE = 0;                     // clear the DAI Falling Edge Interrupt Latch Register


Because of another colleague currently working with our test-board, i couldn't yet test the above code. But being rather unsure, if this code is right, i want you to ask if i forgot something or if something is totally wrong.


Another question: is it possible to do level-activated interrupts with the DAI pins? I just found falling edge and rising edge, but at least the IRQ0/IRQ1 support level-activated interrupt, but unfortunately, they are already used.


I'm gratefully awaiting your answer