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

I have a problem with lpc2148 uart receiver (with interrupt)for bulk of data

Hello Sir,
when I use lpc2148 UART receiver interrupt then microcontroller is receiving value
but if I receive bulk of data then data is lost and overrun occurs.
what should my interrupt routine for receiving the data correctly.

I want to receive the data which is start with '*' and end with '#'

Parents
  • then you are not handling the interrupts quickly enough!

    How much data? How fast?

    The general principle of interrupt handlers is to keep them as quick as possible - so they should contain the minimum code possible.

    Typically, a UART handler would simply take the received character, and put it into a Ring Buffer (aka "Circular Buffer", or "FIFO").

    The main loop would then deal with "draining" characters from the buffer.

    If your chip has a hardware FIFO, use that to help you.

    All this is entirely general - nothing specifically to do with Keil or lpc2148

Reply
  • then you are not handling the interrupts quickly enough!

    How much data? How fast?

    The general principle of interrupt handlers is to keep them as quick as possible - so they should contain the minimum code possible.

    Typically, a UART handler would simply take the received character, and put it into a Ring Buffer (aka "Circular Buffer", or "FIFO").

    The main loop would then deal with "draining" characters from the buffer.

    If your chip has a hardware FIFO, use that to help you.

    All this is entirely general - nothing specifically to do with Keil or lpc2148

Children