| ??? 12/21/07 19:03 Read: times |
#148599 - a trick for "long ISRs" better than a RTOS Responding to: ???'s previous message |
The example here is based on
1) processigng serial input is more important than running "the main" 2) processigng the serial input characters takes (sometimes) more time than what is between two characters arriving to the UART. This actually occured. The problem was that the sender needed a response 'immediately' after the last character sent and another process made processing the input data in the main sometimes send the response too late. The solution was to set all interrupts except T0 (timer 0 was not used in this app) to high priority and move the processing of the input data to the T0 ISR. The UART ISR stuff char in the ring buffer set TF0 get out the T0 ISR while (characters in the ring buffer to fetch) { .... } get out Erik |



