AnsweredAssumed Answered

ADuC7060 interrupt problem

Question asked by bills on Feb 15, 2012
Latest reply on Feb 21, 2012 by bills

The main issue that I am trying to debug is that I cannot get interrupt handlers to work. I have been able to successfully use code with the blocking statement:

while(IRQSTA==0);

However, the interrupt handler seems to never get called. I have looked at several of the examples which use interrupts and none seem to work on my eval board.

 

The interrupt handler for the UART-IRQ example looks like:

 

void IRQ_Handler(void) __irq

{

    unsigned long IRQSTATUS = 0;

    unsigned char ucCOMIID0 = 0;

 

    IRQSTATUS = IRQSTA;       // Read off IRQSTA register

    ucCOMIID0 = COMIID0;   // Read the UART IRQ ID register

    if ((IRQSTATUS & BIT11) == BIT11)    //UART interrupt source

    {

        if ((ucCOMIID0 & 0x2) == 0x2)      // Transmit buffer empty

        {

           ucTxBufferEmpty = 1;

        }

        if ((ucCOMIID0 & 0x1) == 0x1)      // Receive buffer Full     

        {

            ucRxChar = COMRX;              // read COMRX register

            bSendResultToUART = 1;          // Set flag to return a string to the PC

        }

    }

 

In this example the IC is supposed to send "Waiting for byte from PC" when it starts. Instead the IC sends "W" and then gets stuck in the while(ucTxBufferEmpty==0) loop, unless I use while(IRQSTA==0), bypassing the handler.

 

The irq_arm.c file also has an IRQ_Handler() function that has been commented out. Un-commenting this block only causes the program not to complile.

Outcomes