Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: Multitasking

2005-04-09 by arhodes19044

YEah, something like that was my idea, but I definietly do not have 
the skills (yet) do do it.

I had though about having a high speed timer to update counters.  
When some counter reaches a certain # then something is called and

As long as they are done quickly, then it is good.

Really, my application is fairly linear.  About every second a 
display needs updating with a few calculations.  Data entry happens 
on another display/keypad.  Whenever certain external hardware 
triggers (about 1Hz to 130hz), a counter is incremented, or(less 
freqently) a few integer and float calculations are done based on 
that counter and some vars are updated for display.

I will be using the external hardware to trigger interrupts which 
will do their brief processing and return.

Pretty simple.  So Simple that a BasicX-24 can do it, at least at 
the lower frequency range.  I think it will do it at the highest 
frequency range too.

-Tony

--- In AVR-Chat@yahoogroups.com, "Larry Barello" <yahoo@b...> wrote:
> I wrote a small RTOS that is available at www.yahoogroups.com/avrx 
and on my
> website (but really out of date) www.barello.net/avrx that works 
with GCC.
> It is written in assembly and very small, but somewhat difficult 
to get up
> and running.
> 
> Most (but not all) of my current projects use a foreground loop 
with Finite
> State Machine (FSM) tasks and a high speed timer interrupt that 
increments
> counters or runs additional FSM that need precise periodic 
execution (e.g.
> motor or sensor control/input tasks, filtering, etc)  That 
structure is
> pretty simple and works well for just about everything.  The top 
level
> foreground loop typically runs 100k/sec or more when nothing is 
happening,
> although it can be blocked by whatever time it takes to run the 
interrupt
> stuff.  Oh, yeah, re-enable interrupts in the timer routine so you 
can run
> fast & slow stuff nested (make sure you can't re-enter the fastest 
stuff or
> you will be in trouble!).
> 
> Cheers!
> 
> 
> -----Original Message-----
> From: arhodes19044 [mailto:spamiam@c...]
> Sent: Friday, April 08, 2005 7:03 PM
> To: AVR-Chat@yahoogroups.com
> Subject: [AVR-Chat] Multitasking
> 
> 
> 
> 
> 
> Are there any C templates to perform multitasking?
> 
> Or do I have to use a timer interrupt to try to do some basic time-
> slice activity?
> 
> Actually, I can have timer interrupts to perform certain 
functions, so
> true multitasking is not really necessary.  I was just interested 
if
> such exists.  For stuff like spawn() to run concurrently.
> 
> -Tony
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Yahoo! Groups Links

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.