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

Time Slicing with RxTiny

I am using RxTiny with the intention of running "parallel" multiple tasks. The problem is the next task does not run unless the current task halts (by using os calls like OS_DELAY() or OS_WAIT()). Seemed like the timeout does not occurred to allow next task to run.

I am debugging using the uVision Debugger. Could this have some effect? I am not using Timer0 which the documentation said was used by RxTiny for time ticks.

I looked at the RxTiny examples. Did not see anything that was different than what I am doing. Thanks for your help.

  • RTX Tiny is not preemptive (IE. it will not stop a task in mid operation). The task must stop itself then another task will be started if ready. See:

    http://www.keil.com/c166/tr166.htm

    You might be able to force a task to stop by calling the os from a timer interrupt running at a fixed rate but that might not work.

    Best
    Scott

  • Do you have Conf_tny.a66 configured for Round Robin Time Slice? If not, the only wait a task can be suspended is via an os_wait of one type or another.

  • Hi Al,

    I had included conf_tny.a66 in my project. It had "TIMESHARING EQU 5" which enabled Round Robin timeout to 5 clk ticks.

    Previous reply to my post said "RxTiny is not pre-emptive (IE will not stop task in mid operation)" and that "the task must stop itself".

    This contradicts time slcing that RxTiny is suppose to support. Do you have any input to this? Thanks for your help.

  • Hi Scott,

    Thanks for your reply. Pg 242 of the 166/167 Assembler and Utilities manual described RxTiny task switching and timeout. Preemptive is descrived on pg 244 that an RxTiny task needs a timeout first before it can switch, instead of switching at any time when a higher priority task arrived. The RxTiny documentation does not say anything about stopping a task to start another task.

    Confg_tny.a66 has a TIMESHARING variable which dictates the timeout periods.

    Comments? Thanks for your help.

  • The task does not have to stop itself. RTX Tiny will perform task switching at timeouts.
    Are interrupts enabled? If you are using debugger, you can try to find out what goes wrong. Set a breakpoint at Timer0 interrupt vector to see if the T0 ISR gets control. There is also 'Kernel Aware Debugging' feature in the uVision2 debugger, look at the task list to make sure they are in the running state.

    - mike