This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Writing ISR in arm9

Hello
what is the structure for writing specific ISR for different on chip peripherals?

Parents
  • Hello This is my code.
    the interrupt handler for UART is not working.

    #include "LPC318x.h"

    void uart3_int (void) __irq
    { PIO_OUTP_SET = 0x7EFFFFFFF;
    PIO_OUTP_CLR = 0x7EFFFFFFF;
    }

    int main (void)
    { unsigned char i;
    interrupt_init();
    SYSCLK_CTRL = 0x00000140;
    HCLKPLL_CTRL = 0x00014024;
    UARTCLK_CTRL = 0x0F;
    //U3RBR = 0x00;
    U3IER = 0x07;
    U3LCR = 0x03;
    U3FCR = 0x00;
    U3CLK = 0x0000020E;
    UART_CLKMODE = 0x00000550;
    U3THR = 0x00;
    /*U3DLM = 26;
    U3DLL = 27;
    U3LCR = 0x03;*/

    while(1)
    { PIO_OUTP_SET = 0x7EFFFFFF;
    PIO_OUTP_CLR = 0x7EFFFFFF;
    U3THR = 0x55;
    for(i=0;i<20;i++);
    } }

Reply
  • Hello This is my code.
    the interrupt handler for UART is not working.

    #include "LPC318x.h"

    void uart3_int (void) __irq
    { PIO_OUTP_SET = 0x7EFFFFFFF;
    PIO_OUTP_CLR = 0x7EFFFFFFF;
    }

    int main (void)
    { unsigned char i;
    interrupt_init();
    SYSCLK_CTRL = 0x00000140;
    HCLKPLL_CTRL = 0x00014024;
    UARTCLK_CTRL = 0x0F;
    //U3RBR = 0x00;
    U3IER = 0x07;
    U3LCR = 0x03;
    U3FCR = 0x00;
    U3CLK = 0x0000020E;
    UART_CLKMODE = 0x00000550;
    U3THR = 0x00;
    /*U3DLM = 26;
    U3DLL = 27;
    U3LCR = 0x03;*/

    while(1)
    { PIO_OUTP_SET = 0x7EFFFFFF;
    PIO_OUTP_CLR = 0x7EFFFFFF;
    U3THR = 0x55;
    for(i=0;i<20;i++);
    } }

Children
  • That is not an UART interrupt handler. It does not ask the UART for any pending events. It does not feed more characters to send. It does not pick up any received characters. It does not clear any overrun errors. It does not acknowledge that the interrupt has beeen handled.

    You really must be able to find sample code for an interrupt handler for your processor.

  • When i feed U3THR the CPU transmits the data over transmit. After transmitting the interrupt flag settled to one. When this is settled to one i want to blink LEDs.
    Thats the requirement for which i have written this code.

  • Your sample code for that incredible machine of yours will show you how. Jack Sprat wrote not long ago: "I have also noticed that you are not averse to using language that would be considered blasphemy by at least one of the major global religions". So you see Jack, I CAN glorify a processor core without the sin of blasphemy after all :-)
    but I admit having to bite my tongue!