Higher Priority on UART1

How can I increase the interrupt priority of UART1 of the LPC2364?
Due to heavy load on timer interrupts, I'm missing receiving characters every 5 - 10 seconds.

The initialization of UART1 is as follow:

void enableUART1(void)
{
  VICVectAddr7  = (unsigned long) UART1_IRQHandler; // Set Interrupt Vector
  VICVectCntl7  = 17; //15;                         // use it for UART1 Interrupt
  VICIntEnable |= (1<<7);                           // Enable UART1 Interrupt
}

      // Enable RS485  P2.7 Initialisiert auf Out high
      PINSEL4 = PINSEL4|P2_00TXD1|P2_01RXD1;
      U1LCR   = bits|parity|stops|_DLABON;
      U1DLL   = (U8)baud;
      U1DLM   = (U8)(baud>>8);
      U1LCR   = bits|parity|stops|_DLABOFF;
      uart[_UART1].openChar1 =uart[_UART1].openChar2 =uart[_UART1].openChar3 =uart[_UART1].openChar4 =0;
      uart[_UART1].closeChar1=uart[_UART1].closeChar2=uart[_UART1].closeChar3=uart[_UART1].closeChar4=0;
      uart[_UART1].closeTimeout=timeout;
      flushBufferUART1( );
      U1IER   =(1<<0);        // Enable Rx Interrupt
      uart[_UART1].initialized=1;

Many thanks for any input.
Peter

Parents
  • How can I increase the interrupt priority of UART1 of the LPC2364?

    Are you sure that this will solve your problem ? Instead of missing UART events, your system might start missing (or reacting too late to) timer events.

    Have you looked into other ways to solve the problem ? According to the datasheet, the UART on your device has 16 byte transmit and receive FIFOs. If you use them, and your timer interrupts still need more time than the UART needs to receive 16 bytes (for usual baudrates, that's a small eternity for a uC), then are you sure you followed the KISS (Keep ISRs short and simple) strategy for your timer ISRs ?

    And if the FIFO is not large enough, there is still the possibility of using DMA to handle the UART transfers, which will basically give you a buffer size equal to any RAM you can spare.

Reply
  • How can I increase the interrupt priority of UART1 of the LPC2364?

    Are you sure that this will solve your problem ? Instead of missing UART events, your system might start missing (or reacting too late to) timer events.

    Have you looked into other ways to solve the problem ? According to the datasheet, the UART on your device has 16 byte transmit and receive FIFOs. If you use them, and your timer interrupts still need more time than the UART needs to receive 16 bytes (for usual baudrates, that's a small eternity for a uC), then are you sure you followed the KISS (Keep ISRs short and simple) strategy for your timer ISRs ?

    And if the FIFO is not large enough, there is still the possibility of using DMA to handle the UART transfers, which will basically give you a buffer size equal to any RAM you can spare.

Children
More questions in this forum