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

RTX51 Tiny question

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!

Parents
  • Basically, you would not use Round Robin in this case, since this does not allow you to have intervals with 0.5ms. However you might simply setup the RTX timer interrupt to 0.56ms and collect the IR data in the
    HW_TIMER_CODE.

    Take a look to the TRAFFIC example which might give you a starting point (it includes handling of the serial I/O).

Reply
  • Basically, you would not use Round Robin in this case, since this does not allow you to have intervals with 0.5ms. However you might simply setup the RTX timer interrupt to 0.56ms and collect the IR data in the
    HW_TIMER_CODE.

    Take a look to the TRAFFIC example which might give you a starting point (it includes handling of the serial I/O).

Children
No data