Searching \ for '[SX:] Has anyone made their own multitasker for a' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/ubicom/devices.htm?key=sx
Search entire site for: 'Has anyone made their own multitasker for a'.

Exact match. Not showing close matches.
PICList Thread
'[SX:] Has anyone made their own multitasker for a '
2001\01\18@224237 by Neil Gandler

flavicon
face
I was considering making a crude multitasker for the PIC
and even the SX device. Especially with SX devices with its
blinding up-to 100MIPS speed, it would benefit from such
a multitasking scheme. The way I would do it is to create
a number or threads that execute every interrupt cycle,
which interval depends on the timer overflow. For example, an interrupt can be set to occur ever 20us. And if there are
32 threads, each thread would excute every 640us.
The program flow in each thread would procede a certain
amount of cycles, and to the discretion of the programmer,
the routine would exit and return from interrupt. Before
exiting the routine, the PC could be saved and when the
same routine runs again, the program flow could resume at the same spot. Why do all of this? It would allow me to have (in this case) 32 seperate processes that can run relatively independent of each other. In high speed devices such as the SX processor, there can be much idle time while reading and writing to an I2C eeprom, doing an A/D reading etc. This method could maximize efficiency and allow more complex operations.  I would love to hear comments and ideas from others.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\01\18@235127 by Dan Michaels

flavicon
face
Neil Gandler wrote:
>I was considering making a crude multitasker for the PIC
>and even the SX device. Especially with SX devices with its
>blinding up-to 100MIPS speed, it would benefit from such
>a multitasking scheme.

There is an old Mchp appnote describing a rudimentary
multitasker, AN585.
================


The way I would do it is to create
>a number or threads that execute every interrupt cycle,
>which interval depends on the timer overflow. For example,
>an interrupt can be set to occur ever 20us. And if there are
>32 threads, each thread would excute every 640us.


What you are describing here is the basic idea underlying
the Scenix VPs - virtual peripherals. TImer overflows every
6 usec or so, and a divider on each process counts down the
interrupts to determine when the process should run/etc.

The big problem you encounter with the scenix, IMO, is that
even with its high performance, it still bogs down when the
#processes starts to grow.

- danM

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...