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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/07/08 23:24
Read: times


 
#157312 - small multitasker
Responding to: ???'s previous message
I wrote a small multitasking exec in C for 8051 and it handles timing including longer times pretty well I think. I have two time delay functions in units of either 10ms or seconds and the exec lets the task sleep while others do their thing until the time expires. Tasks can signal other tasks too.

I don't copy much of the stack (I think just return address) to achieve context switching so it can't slow it down much, though I haven't worked it out. I allocate task data as global data so the compiler doesn't try to overlay it.

I mostly run things with a few (<5 so far) simple tasks, in under 2kb including scheduler. It could do more but I wanted to get it running in a really small memory and was ok in 128 bytes of RAM.

I had thought of posting a copy somewhere here but I'm sure others could do better and it would need a bit of tidying anyway.



List of 27 messages in thread
TopicAuthorDate
Non Blocking timer            01/01/70 00:00      
   Use a hardware timer            01/01/70 00:00      
      Thanks - But.....            01/01/70 00:00      
         State machines            01/01/70 00:00      
            THANKS - That's a great idea            01/01/70 00:00      
               if you have a lot to delay by various delays            01/01/70 00:00      
                  I Like that Idea as well            01/01/70 00:00      
                  A Linked List might be better here            01/01/70 00:00      
                     the correct use takes care of this            01/01/70 00:00      
                        Not necessarily            01/01/70 00:00      
   Cooperative or preemptive multitasking            01/01/70 00:00      
      Super-loop contra cooperative multitasking            01/01/70 00:00      
         Multasking can work on the 8051 ... sometimes            01/01/70 00:00      
            Not just stack            01/01/70 00:00      
               I agree            01/01/70 00:00      
                  Choose your battles carefully            01/01/70 00:00      
               I agree, too            01/01/70 00:00      
                  and            01/01/70 00:00      
                     Never underestimate the usefulnes of interrupts            01/01/70 00:00      
                        a flavor            01/01/70 00:00      
                           prioritizing in super-loop            01/01/70 00:00      
                              the fact is ..            01/01/70 00:00      
                  C works well            01/01/70 00:00      
                  Circular argument?            01/01/70 00:00      
                     Re: Circular Argument            01/01/70 00:00      
                        going round in circles            01/01/70 00:00      
            small multitasker            01/01/70 00:00      

Back to Subject List