View previous topic :: View next topic |
Author |
Message |
PAVLOS
Joined: 14 Apr 2008 Posts: 1
|
Preemptive multitasking |
Posted: Tue Apr 15, 2008 12:57 am |
|
|
Hello people
I try to write a Preemptive multitasking rtos for the PIC18f252 using PCWH ver 4.0013.
I 'd like to get information if possible, about the location where the compiler
stores information about the functions like local variables, return address, start address. |
|
![](templates/subSilver/images/spacer.gif) |
Matro Guest
|
|
Posted: Tue Apr 15, 2008 1:32 am |
|
|
All variables are in RAM, return addresses are in the stack and start address is always 0x0000.
All these information are in the datasheet of the chip.
Matro. |
|
![](templates/subSilver/images/spacer.gif) |
RLScott
Joined: 10 Jul 2007 Posts: 465
|
Re: Preemptive multitasking |
Posted: Tue Apr 15, 2008 6:16 am |
|
|
PAVLOS wrote: | Hello people
I try to write a Preemptive multitasking rtos for the PIC18f252 using PCWH ver 4.0013.
I 'd like to get information if possible, about the location where the compiler
stores information about the functions like local variables, return address, start address. |
Are you interested in the local variables of library functions so that you can make those functions re-entrant for your RTOS? I don't think the location of those local variables are easy to get. And even if you did get them, what are you going to do with them? Are you going to copy all the possible local variables for library functions to a save area for each task every time there is a task switch? That would add a lot of time to the context switch.
Robert Scott
Real-Time Specialties |
|
![](templates/subSilver/images/spacer.gif) |
bwhiten
Joined: 26 Nov 2003 Posts: 151 Location: Grayson, GA
|
4.0013, thumbs down |
Posted: Tue Apr 15, 2008 7:45 am |
|
|
I doubt very seriously you'll have any luck using a revision that early and that old. There are 58 releases since that one and some bugs still remain.
Maybe I'm too pessimistic in my old age
Edit: Also shows how small the world has become. From the Netherlands to Georgia, USA in the same minute ![Smile](images/smiles/icon_smile.gif)
Last edited by bwhiten on Tue Apr 15, 2008 8:39 am; edited 1 time in total |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Tue Apr 15, 2008 7:45 am |
|
|
Quote: | using PCWH ver 4.0013 | That's an old and very unstable version. Use the old v3.249 or upgrade to at least v4.030 and save everybody a lot of time.
Edit: Two people posting the same comment simultaneously. That's multitasking. ![Cool](images/smiles/icon_cool.gif) |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Tue Apr 15, 2008 8:15 am |
|
|
Just wondering: Why do you want to write your own RTOS? You are aware that many RTOS-variants for the PIC are available on the internet and even CCS includes a free RTOS module with the compiler. |
|
![](templates/subSilver/images/spacer.gif) |
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
Posted: Tue Apr 15, 2008 9:29 pm |
|
|
AFAIK, most RTOSes for PICs have cooperative multitasking. Preemptive multitasking OS needs considerably more RAM. _________________ Read the label, before opening a can of worms. |
|
![](templates/subSilver/images/spacer.gif) |
Ken Johnson
Joined: 23 Mar 2006 Posts: 197 Location: Lewisburg, WV
|
|
Posted: Wed Apr 16, 2008 6:39 am |
|
|
Just a comment (opinion):
PICs (prior to the later 16-bit devices) just don't have the hardware to support true multi-tasking.
I'm a very strong proponent of a simple, interrupt-driven, priority-based, pre-emptive multi-tasking executive for embedded systems, and use such in all but the simplest projects.
But, for PIC projects, I stick with the CCS single-compilation unit (which I really hate), and single-threaded execution.
Look at this in the Code Library:
http://www.ccsinfo.com/forum/viewtopic.php?t=32199
Maybe it'll be helpful.
Ken |
|
![](templates/subSilver/images/spacer.gif) |
|