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

LPC2378 serial interrupt problem

LPC2378 serial interrupt problem
following code is working fine in interrupt for UART0

        InitUART0();
        U0IER   =0x04;
        while (1)
        {
                U0IER   =0x0F;
                if(buff1[0]=='c')
                {

                        TransmitChar0('I');TransmitChar0('N');TransmitChar0('D');
                        TransmitChar0('I');TransmitChar0('A');
                        clear_Rxbuffer();
                }

                else  if(buff1[0]=='d')
                {
                        TransmitChar0('W');TransmitChar0('E');TransmitChar0('L');
                        clear_Rxbuffer();
                }

                U0IER   =0x00;
       }


also UART1 in interrupt working individually fine in code
I want to use UART1 and UART2 both simultaniously but only one uart communicatio so far done
please suggest how to use both interrupt simulataniously

Thanks in advance
Kishor P.

  • What are you doing assigning values to U0IER in the loop? What is that? Bad coding practice, and probably stunningly incorrect as well...

  • If you are trying to disable interrupts, do it will the VIC. But there is no reason to do so, really!

  • Sorry, but your code does not make sense at all.

    You post a piece of code, claiming to be part of an interrupt service routine - you write "is working fine in interrupt"

    But a UART ISR should init contain any call to any function InitUART0().

    And a UART ISR should not perform multiple calls to any TransmitChar0() unless the UART is using a transmit FIFO, and there is a check before each call if the FIFO has room for more characters.

    So obviously, your code is not part of an ISR.

    So why then complain about problems with serial interrupts, when you have not posted the code that initializes the interrupt. And no code posted showing what you do in the ISR.

    The big question here - why do you not use standard serial interrupt code already available as samples on the Keil site, potentially adjusted for your specific requirements?