View Single Post
  #3   Spotlight this post!  
Unread 23-06-2002, 23:07
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Re: Out of RAM Space on Custom Program

Posted by Mike Gray.

Engineer on team HOT from Huron Valley Schools sponsored by GM Milford Proving Ground.

Posted on 2/11/2000 5:44 AM MST


In Reply to: Out of RAM Space on Custom Program posted by Frank Wang on 2/10/2000 10:11 PM MST:



: Is any one else experiencing lack of RAM space on their custom program? We are wondering if there is a way to optimize our code so we can declare more variables. We used most of our electronic kit parts, and we lack variable space to control two more speed controllers.

Here's a few possibilities, short of deleteing variables in the intialization routine:

1. Reuse local variables. If they don't need to be global, use them again in other routines.
2. Can some of your new variables be constants instead? Constants don't use any RAM.
3 Declare variables only as big as they truly need to be. If a variable value will never exceed 255, make
sure its declared as a byte variable. If all you need is a nibble or a bit, declare them respectively. In short, don't use a bigger bucket than you really need.
4. Use one of the other seven programs available on the SX. Pass variables from one program to another using the 'scratchpad RAM'. You will take a throughput hit, but its not that bad.


__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.