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
Per's comments are very correct. What you can do to calculate your timing budget is create a table that contains all the time consuming operations in your system in the form of period, duration, total cost. if you know that your system should do all its work within X[ms] (that is usually the least common multiple of all periods), then you can calculate a worst case scenario and the CPU load. this assumes of course a simple scheduling (non-preemptive).
Hi, people,
I've tried your project and It's works fine... Thanks again...
Regards, Marine bOY