PDA

View Full Version : ram?



Johnny-5
12-01-2006, 02:44 PM
what is scratch-pad ram? does the BS load the program from eprom to ram when running (like pc's) or is it ran directly from the eprom? The variables are stored in the regular ram right?

Fe2o3Fish
12-01-2006, 03:23 PM
Johnny-5 said...
what is scratch-pad ram?

The BS2e, BS2sx, BS2p, BS2pe, and BS2px have scratch-pad RAM which
can be accessed only with the GET and PUT instructions. This memory
is accessible from programs running in any of the available program slots.
It's a great way to pass data between these program slots.


Johnny-5 said...
does the BS load the program from eprom to ram when
running (like pc's) or is it ran directly from the eprom?

Basic programs are tokenized by the Basic Stamp Editor before they are
downloaded into the stamp. A small program permanently embedded into
the stamp's processor interprets the tokens the BS Editor created. Since
the process of fetching a token takes little time as compared to the time
to evaluate and process the token, each token is taken from EEPROM as
needed.


Johnny-5 said...
The variables are stored in the regular ram right?

Correct!

In the Basic Stamp Help file there is a page entitled "Memory Organization and
Variables". A great place to start reading! Have fun!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rusty-
--
Rusty Haddock = KD4WLZ = rusty@fe2o3.lonestar.org
**Out yonder in the Van Alstyne (TX) Metropolitan Area**
Microsoft is to software what McDonalds is to gourmet cooking

Johnny-5
12-02-2006, 02:22 AM
Ok, that brings me to another Q. How do you load multipal programs onto a stamp? i have searched the help files and found nothing. is the BS2 capable of multipal programs? I am using parallax's stamp editor.

boeboy
12-02-2006, 02:25 AM
You need the BS2e, BS2sx, BS2p, BS2pe, or BS2px they have 8 slots for programs

Mike Green
12-02-2006, 02:35 AM
To clarify a little, in the BS2 models that have multiple slots, slot 0 is the one that gets control when the Stamp is reset. The program in slot 0 can transfer control to any of the other slots, but it's a jump rather than a subroutine call and each slot's program always starts from the beginning. You can share variables if you're careful and you can pass additional data using the scratchpad RAM and GET/PUT. If you want to share variables, you must declare the same size variables in each program in the same order (the names don't have to be the same). They're only initialized to zero when the Stamp is reset.

For the BS2pe, there are an additional 8 slots, but they can only be used for data storage (with READ/WRITE) and not for programs.

dandreae
12-02-2006, 02:37 AM
Johnny-5 said...
Ok, that brings me to another Q. How do you load multipal programs onto a stamp? i have searched the help files and found nothing. is the BS2 capable of multipal programs? I am using parallax's stamp editor.
If you look on page 68 and 69 of the BASIC Stamp manual it will show you how to use the multiple memory slots.· The "RUN" command will also provide you with some helpful information regarding the use of multiple slots.

Dave

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae

Parallax Tech Support·