Go to Post We are customers to FIRST. In that comes expectations. I don't want to hear another, "You should be grateful for everything FIRST does" nonsense when FIRST royally screws up. - MikeDubreuil [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 25-01-2007, 11:40
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: setjmp/longjmp

Quote:
You don't need any special features in the CPU to do it.
Ummm, actually you do. You really need to have access to the call (program address) stack. Many of the smaller implementations of the PIC architecture don't have program access to the call stack.

There are several commericially available RTOS packages available (PICOS, FreeRTOS, Salvo, Pumpkin, ...) for the PIC that support multi-tasks and some type of round-robin or priority task scheduling. The practical maximum for many of these implementations are 8-12 tasks. The context save area for the task needs to be about 100 bytes for call stack and hardware registers (like PROD, TAB*, FSR, ...) and data sections (.tmpdata, MATH_DATA). In addition, at least a small argument stack is required, so another chunk of memory - say a small 32 byte stack, plus local variable storage. This already puts a task memory structure up over 1/2 of a ram bank in size. This is easy to do, yes, but the costs in terms of chewing up the limited resources on-chip are fairly high.
  #2   Spotlight this post!  
Unread 25-01-2007, 12:28
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: setjmp/longjmp

Quote:
Originally Posted by dcbrown View Post
Ummm, actually you do. You really need to have access to the call (program address) stack. Many of the smaller implementations of the PIC architecture don't have program access to the call stack.
Ah, my operating systems course fails me again . Who would've known that learning things on a poorly-simulated CPU rather than on hardware would have given me misconceptions?

Thanks for the info, makes me want to go back to my hardware classes again.

Edit: Just read the wikipedia article. Embedded CPUs are crazy.

Last edited by Bongle : 25-01-2007 at 12:36.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:12.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi