Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/09/10 08:33
Read: times


 
#177169 - co-operative scheduler
I have been using the "Time Triggered Prioritised Cooperative Scheduler" from 8052.com, which suits the 8051 well.
Now I have come across a problem in that the idea of a co-operative system needs all tasks to complete before the scheduler runs again. This inevitably wastes processing time.
I have been using a sparetime routine that runs at the end of the despatcher. This works well for eg., RS232.
It only needs to check that the remaining time is sufficient to send a character. This speeded up the comms tremendously.
Additionally, now display is a problem in this application. Display is important, but the machine control is more important. Display takes a lot of time.
I suggest to use a background routine for display running in register set 3. At startup, go to this routine and set the PSW to register set 3.
The compiler (I use uc51 from Wickenhaueser) will not use register set 3.
Push the necessary A, B, PSW, DPTR on entry to the scheduler. Set psw to register set 0.
Then at the end of the scheduler, do not simply reti. Instead, set dptr to the despatcher, push dpl,dph, then reti.
This will cause the despatcher to run, servicing the tasks.
At the end of the despatcher, pop dph, dpl, PSW, B, A.
You are seamlessly back to the background task, which can run endlessly or go to sleep as required.
At no time is any processing time wasted, and the additional cost is a few bytes on the stack.
Please comment
Johan Smit

List of 23 messages in thread
TopicAuthorDate
co-operative scheduler            01/01/70 00:00      
   RE: This inevitably wastes processing time.            01/01/70 00:00      
      re - Separate display processor            01/01/70 00:00      
         I see (I think)            01/01/70 00:00      
            re - Separate display processor            01/01/70 00:00      
   Separate display processor?            01/01/70 00:00      
      re - Separate display processor            01/01/70 00:00      
   how can processing "waste processing time"            01/01/70 00:00      
      Answered here?            01/01/70 00:00      
      All multi-tasking with real-time requiremens suffer waste            01/01/70 00:00      
         re - Separate display processor            01/01/70 00:00      
            Parasitic newspapers?            01/01/70 00:00      
   I do not know your "Time Triggered Prioritised Cooperative S            01/01/70 00:00      
      re - Separate display processor            01/01/70 00:00      
         what does a time interval have to do with it?            01/01/70 00:00      
         TTPCS            01/01/70 00:00      
            re- TTPCS            01/01/70 00:00      
   No need for these canned "schedulers"            01/01/70 00:00      
      re - real time system            01/01/70 00:00      
         no, it does not            01/01/70 00:00      
            re- Scheduler            01/01/70 00:00      
      Timeslice timewaste            01/01/70 00:00      
         re - real time system            01/01/70 00:00      

Back to Subject List