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

LPC1788 M3 cortex ARM 7 interrupt routine

hi all
iam using LPC1788 M3 cortex ARM 7 controller
iam trying to execute the timer and serial interrupt program.
in both the cases iam unable to return from the interrupt handler routine.

iam also working on LPC2378 ARM 7 controller where i have executed both the programs mentioned above. there iam using VICVECTADDR=0 to return from interrupt to main.
what is the case in LPC1788?
please help.
Thanks in advance

Parents
  • main()
    { // UART TX AND RX LINE SELECTION LPC_GPIO0->P0_0=0X1; LPC_GPIO->P0_1=0X1;

    // UART INIT

    LPC_UART0->LCR=0X80; // DLAB=1 LPC_UART0->DLL=78;//9600 BAUDRATE LPC_UART0->LCR=0X03;// 8BIT DATA LPC_UART0->IER = 0x01; // interrupt enable

    NVIC_ENABLE(UART0_IRQn);

    if(ch==0x24) { serial_send("AMS"); }

    }

    void serial_send(char *ch)
    { while(*ch!='\0')
    { while(!(LPC_UART0->LSR & 0x20));
    LPC_UART0->THR = *ch;
    ch++;
    } }

    void UART0_Handler(void)
    { ch=LPC_UART0->RBR;
    }

    this is my code its not working.........
    here i am trying to execute interrupt..
    when i type $ through keyboard then only it should send string AMS......
    but its not coming out from interrupt handler....

    when i put the same code which i have written in main i.e if(ch==0x24) in isr then it works fine.....

    i dont want to place the code in isr.... i will just monitor ch value from isr if ch equals to dollar then it should come to main and execute the rest of program.....

Reply
  • main()
    { // UART TX AND RX LINE SELECTION LPC_GPIO0->P0_0=0X1; LPC_GPIO->P0_1=0X1;

    // UART INIT

    LPC_UART0->LCR=0X80; // DLAB=1 LPC_UART0->DLL=78;//9600 BAUDRATE LPC_UART0->LCR=0X03;// 8BIT DATA LPC_UART0->IER = 0x01; // interrupt enable

    NVIC_ENABLE(UART0_IRQn);

    if(ch==0x24) { serial_send("AMS"); }

    }

    void serial_send(char *ch)
    { while(*ch!='\0')
    { while(!(LPC_UART0->LSR & 0x20));
    LPC_UART0->THR = *ch;
    ch++;
    } }

    void UART0_Handler(void)
    { ch=LPC_UART0->RBR;
    }

    this is my code its not working.........
    here i am trying to execute interrupt..
    when i type $ through keyboard then only it should send string AMS......
    but its not coming out from interrupt handler....

    when i put the same code which i have written in main i.e if(ch==0x24) in isr then it works fine.....

    i dont want to place the code in isr.... i will just monitor ch value from isr if ch equals to dollar then it should come to main and execute the rest of program.....

Children
No data