Searching \ for ' Stack. [PIC]:' 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/microchip/devices.htm?key=pic
Search entire site for: 'Stack. [PIC]:'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] Stack. [PIC]:'
2000\07\07@081924 by Andy Howard

picon face
> From: "Jonathan Philpott" <spam_OUTj_philpottTakeThisOuTspamYAHOO.COM>

> One night, while i was in a state of total boredom, i
> started to think about writing a PicOS, this is, of
> course, madness, and i have started my medication.
> I gave up after 5 minutes of code due to one big
> problem: the stack.
> i was using the clock interupt to control task
> switching, and to switch tasks correctly, id have to
> get the return address from the stack when the
> interupt happened, store it away somewhere, and switch
> to another task (perhaps using a previously stored
> return address). But, from reading the 16c84 Microchip
> datasheet, i am told the stack pointer cannot be
> written or read to....

The trick is to make your own stack in software, take an area of memory and
use it just as if it were the normal stack. This kind of thing was commonly
needed with the 16c5x devices where the stack was pathetically small.
AN527 covers it briefly. With the FSR and couple of macros you can have any
size
stack you need and can manipulate it in all kinds of curious ways.

Also, if you haven't already looked, you might find something in the
Microchip AN585 about an
RTOS for PICs.


> is there a way around this? or should i go back to
> writing my name on the padded walls with a pencil in
> my teeth?


Ah, they let you have pencils do they? We're only allowed crayons in here
since that unfortunate incident last year...



Hope some of this helps.

Andy.








.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2000\07\07@095457 by Scott Dattalo

face
flavicon
face
I've seen several RTOS suggestions over the years posted to the piclist. Not
having access to the stack has resorted in some creative implementations. The
technique I've settled on is a state-machine type, non-preemptive task
switcher. The states are the address entry points for the various tasks. When
you wish to do a 'task switch', stuff the new state/address into the program
counter. If you want to see an example of this technique, then take a look at my
single-cycle resolution all software pwm routine:

http://www.dattalo.com/technical/software/pic/pwm256.txt


Scott

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2000\07\07@103704 by jamesnewton

face picon face
Or look at
http://www.piclist.com/../microchip/swstmt
aka
http://www.piclist.com/techref/default.asp?url=microchip/swstmt

---
James Newton (PICList Admin #3)
.....jamesnewtonKILLspamspam@spam@piclist.com 1-619-652-0593
PIC/PICList FAQ: http://www.piclist.com or .org

{Original Message removed}

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