Shop OBEX P1 Docs P2 Docs Learn Events
ram? — Parallax Forums

ram?

Johnny-5Johnny-5 Posts: 34
edited 2006-12-01 18:37 in BASIC Stamp
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?

Comments

  • Fe2o3FishFe2o3Fish Posts: 170
    edited 2006-12-01 07:23
    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-5Johnny-5 Posts: 34
    edited 2006-12-01 18:22
    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.
  • boeboyboeboy Posts: 301
    edited 2006-12-01 18:25
    You need the BS2e, BS2sx, BS2p, BS2pe, or BS2px they have 8 slots for programs
  • Mike GreenMike Green Posts: 23,101
    edited 2006-12-01 18:35
    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.
  • dandreaedandreae Posts: 1,375
    edited 2006-12-01 18:37
    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·
Sign In or Register to comment.