Page 1 of 1

PIC18F has software addressable stack

PostPosted: Fri Jul 19, 2002 4:10 am
by aek
Hi.

Yes, it has a software-addressable stack, at least in theory.

Our rule-of-thumb is that with less than 2k RAM total, there's little point in trying to make an RTOS preemptive, because the RAM for the various stack frames (a minimum of 32 words per task (for return addresses) * number of tasks) will quickly exhaust the available RAM.

In reality, you'll need a lot more than 32 words/task because parameters, auto variables and perhaps also return values will be on the stack ...

To say nothing of the substantial performance hit you'll take when doing software stack operations. And the interrupt latency, etc.

There have been attempts to do preemptive RTOSes on the PIC18, and they do not appear to have met with much success ...

Salvo offers the advantages of an RTOS yet still runs in <2KB RAM parts. Heck, it runs in <256 bytes RAM parts. Our users don't seem to inconvenienced by the restriction that context switches must be at the task level.

So, a preemptive RTOS for "RAM-challenged" MCUs is currently not part of the Salvo plan.

Regards,

------------------


Re: PIC18F has software addressable stack

PostPosted: Fri Jul 19, 2002 11:29 am
by mflores
...so,

1) ¿ would it be better improve Salvo core to take advantage of this new feature ?. This way would it be possible to have a preentive-cooperative RTOS for PIC. ¿Wouldn't it?

2) or actually, ¿ does Salvo yet take advantage of this ?

Regards,
MFlores


Re: PIC18F has software addressable stack

PostPosted: Sat Jul 20, 2002 1:57 am
by mflores
Ok, I understand that in general PIC's, even the PIC18, are less powerful than other micros.

From your answer I extract that Salvo shows more powerful with other micros. Or even with more potent micros, ¿ Does Salvo use the same techniques ?

Regards,


Re: PIC18F has software addressable stack

PostPosted: Sat Jul 20, 2002 9:14 am
by aek
Hello.

I'm not sure I understand your question. Salvo is designed for single-chip embedded micros with less than 2KB RAM.

It can be ported to nearly any microcontroller or microcprocessor, but if you have, say, 32KB RAM and 32KB ROM, you might as well use a more conventional RTOS since you have much more available memory.

But in single-chip micros, this is not usually the case. Look at the TI MSP430 for instance -- 64K address range, of which roughly 2K is RAM and 62K is ROM. No room for a conventional RTOS in there, but Salvo fits very nicely.

In-house, we test and develop it on x86 as well as our normal supported targets. Currently, Salvo "looks the same" on every platform it's been ported to -- same features, etc. From the PIC12 PICmicros to the x86 PCs.

------------------

[This message has been edited by aek (edited July 20, 2002).]


Re: PIC18F has software addressable stack

PostPosted: Sun Jul 21, 2002 3:54 am
by mflores
Hello,

Thank you for your help. I have no more doubts. Probably when trying more complex things I have more. We'll keep in contact.

Best Regards,