I plan to use Winbond's W78LE516 at 20MHz and to estimate whether I can use use one of RTX51 tiny task to sampling IR input which smallest sampling interval is 0.56ms. The data I have - One tick is 0.0006ms (12 machine cycles for one instruction cycle) - define Round-Robin Timeout in Hardware-Timer Ticks (TIMESHARING EQU 5) I plan to have 3 task and one UART (interrupt mode 1). Q1: Can we count UART as one task? Q2: http://www.keil.com/rtx51/specs.asp mentions that Standard Task Switch Time Depends on Stack Load, 100-700 cycles? Are they machine cycles or ticks? If it is tick, then we spend task swicthing - avergage 400 cycle or 33 ticks (about 0.02ms) per task switch. If they are ticks, then it takes average 400 ticks(about 0.24ms) for task switching. If I use Round-Robin timeout, the longest time for each task to run 4(tasks) * 5 ( ticks per task) * 33 (avg. task switch) = 0.092ms. or 4 (tasks) * 5 (ticks) * 400 (task switch) = 4.8ms. Q3: Is my estimate correct? The later one can't handle the sampling because it takes too long to run the sampling task. What exactly time to do task switching? Thank you for the help!