Shop OBEX P1 Docs P2 Docs Learn Events
Program Memory — Parallax Forums

Program Memory

ArchiverArchiver Posts: 46,084
edited 2003-08-05 17:54 in General Discussion
I have a few questions regarding the EPROM space that a program
occupies.

* Do REM stattements occupy EPROM space?
* Do variable and subroutine labels occupu more EPROM space if
they are long?


Regards,

Dwain

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-01-01 10:18
    At 10:06 AM 1/1/03 +0000, dwainsworld2000 <dwainsworld@e...> wrote:
    >I have a few questions regarding the EPROM space that a program
    >occupies.
    >
    >* Do REM stattements occupy EPROM space?
    >* Do variable and subroutine labels occupu more EPROM space if
    > they are long?
    >
    >
    >Regards,
    >
    >Dwain
    Hi Dwain -

    Neither REM statements nor LABELS consume EPROM space in the STAMP memory.
    It is therefor appropriate to comment your programs freely, and use
    meaningful names for better documentation and easier program readability.

    Regards,

    Bruce Bates


    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the Subject and
    >Body of the message will be ignored.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2003-01-01 17:25
    Like Bruce said, remarks and labels do not consume memory, they only exist
    in your source code. They are tools to make it easier to document your code
    and to mark or jump to other code pieces without knowing where they actually
    reside in memory.

    If you can come back to a program you wrote 6 months or a year ago and
    easily figure out what it does, your documentation is good.

    Original Message

    > >I have a few questions regarding the EPROM space that a program
    > >occupies.
    > >
    > >* Do REM stattements occupy EPROM space?
    > >* Do variable and subroutine labels occupu more EPROM space if
    > > they are long?

    > Neither REM statements nor LABELS consume EPROM space in the STAMP memory.
    > It is therefor appropriate to comment your programs freely, and use
    > meaningful names for better documentation and easier program readability.
  • ArchiverArchiver Posts: 46,084
    edited 2003-01-01 17:49
    In a message dated 1/1/2003 9:28:23 AM Pacific Standard Time,
    daweasel@s... writes:

    > If you can come back to a program you wrote 6 months or a year ago and
    > easily figure out what it does, your documentation is good.
    >

    How true!!!!!!!!

    When I write even the smallest programs I often thought I don't need to
    document it. My reasoning was, heck, I am the guy who designed the hardware
    and writing the software. Don't need no stinkin documentation!!

    How wrong I was!!!!!!!!! I now thoroughly document all programs. It is time
    well spent!!!!!!!


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-08-05 03:46
    Can anyone please tell me if it's possible to add more program space to a BS2?
    I've filled it up and have shortened my program as much as possible. I know
    nothing about the matter, as I'm a complete newbie.

    Many thanks, John


    Do you Yahoo!?
    SBC Yahoo! DSL - Now only $29.95 per month!

    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-08-05 04:29
    Hey John,
    Go to using a bs2e, which will give you 8 x the program space, its really
    quite easy, and the module goes straight into the same ic socket as the bs2,
    same pinout etc.
    Cheers.
    Chris


    Original Message
    From: "John Baker" <johnbaker_erie_pa@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Tuesday, August 05, 2003 10:46 AM
    Subject: [noparse][[/noparse]basicstamps] Program memory


    >
    > Can anyone please tell me if it's possible to add more program space to a
    BS2? I've filled it up and have shortened my program as much as possible. I
    know nothing about the matter, as I'm a complete newbie.
    >
    > Many thanks, John
    >
    >
    >
    > Do you Yahoo!?
    > SBC Yahoo! DSL - Now only $29.95 per month!
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-08-05 05:41
    Dear Chris,

    Thanks for the reply.I have a BS2e and SX, Parallax says they have 2x16K. My
    memory map still shows that the program space is %99 full. How do I go about
    using the extra memory?

    Cheers for more help!



    Chris Anderson <fuel@b...> wrote:
    Hey John,
    Go to using a bs2e, which will give you 8 x the program space, its really
    quite easy, and the module goes straight into the same ic socket as the bs2,
    same pinout etc.
    Cheers.
    Chris


    Original Message
    From: "John Baker"
    To:
    Sent: Tuesday, August 05, 2003 10:46 AM
    Subject: [noparse][[/noparse]basicstamps] Program memory


    >
    > Can anyone please tell me if it's possible to add more program space to a
    BS2? I've filled it up and have shortened my program as much as possible. I
    know nothing about the matter, as I'm a complete newbie.
    >
    > Many thanks, John
    >
    >
    >
    > Do you Yahoo!?
    > SBC Yahoo! DSL - Now only $29.95 per month!
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and Body of
    the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/




    Do you Yahoo!?
    SBC Yahoo! DSL - Now only $29.95 per month!

    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-08-05 12:22
    John...
    have a look at the "run" command.

    With the sx and e, you have 8 slots of program space, where the bs2 has one.

    If you check the memory map with the e or sx, you will see that there are 8
    memory maps there, not just one.

    The 8 slots in an e or sx are 0,1,2,3,4,5,6,7

    Say you have some code which does different things depending on the state of
    pin 5, and if pin 5 is high you want to run the program in slot 1....

    'In slot 0
    if in5 = 0 then stayinslot0
    run 1 'makes the program go to slot 1, and run the program in
    there.
    stayinslot0:
    'code here for slot 0 (perhaps your bs2 code)

    You can pass a variable between slots by using the 'put' and 'get' commands
    like this...

    'in slot 0....
    put 0, 27 'puts the value 27 into RAM location 0
    run1 'sends the program off to run the code in slot 1.

    'in slot 1...
    myVar var byte 'declare a byte variable
    get 0, myVar 'get the value in location '0' in RAM, put it into
    myVar
    debug dec myVar 'will show "27" in the debug screen

    You need to declare variables etc at the beginning of each slot, but you
    only need to declare 'dirs' (inputs / outputs) in slot 0.

    There are 63 (0-62) usable bytes of ram with e and sx, BUT, you should have
    a good read of the help manual because you need to set up a $stamp directive
    at the start of each page (slot) of program. You need to do this for the
    whole 8 pages, even if you are only using 1 or 2 slots etc. Once you get the
    hang of it, you will be able to do heaps more with the stamp.

    The 8 slots open up enormous possibilities, and give a huge amount of
    program space. Best thing ever happened was Parallax releasing the bs2e / sx
    / p.

    In my application, the stamp starts by jumping to slot 7 and loading all
    user changeable system settings from Eeprom, and puts them all into ram.
    Then it goes to slot 0 and waits for some user input. Depending on the user
    input, it then runs other slots, with ibutton comms in 1 slot, extra memory
    access (external Eeprom) in one slot, time date setting and display to lcd
    in one slot, keypad input in one slot. I have all 8 slots at least 80% full
    of code, and it is very simple to jump / pass values between them.

    Cheers,
    Chris


    Original Message
    From: "John Baker" <johnbaker_erie_pa@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Tuesday, August 05, 2003 12:41 PM
    Subject: Re: [noparse][[/noparse]basicstamps] Program memory


    > Dear Chris,
    >
    > Thanks for the reply.I have a BS2e and SX, Parallax says they have 2x16K.
    My memory map still shows that the program space is %99 full. How do I go
    about using the extra memory?
    >
    > Cheers for more help!
    >
    >
    >
    > Chris Anderson <fuel@b...> wrote:
    > Hey John,
    > Go to using a bs2e, which will give you 8 x the program space, its really
    > quite easy, and the module goes straight into the same ic socket as the
    bs2,
    > same pinout etc.
    > Cheers.
    > Chris
    >
    >
    >
    Original Message
    > From: "John Baker"
    > To:
    > Sent: Tuesday, August 05, 2003 10:46 AM
    > Subject: [noparse][[/noparse]basicstamps] Program memory
    >
    >
    > >
    > > Can anyone please tell me if it's possible to add more program space to
    a
    > BS2? I've filled it up and have shortened my program as much as possible.
    I
    > know nothing about the matter, as I'm a complete newbie.
    > >
    > > Many thanks, John
    > >
    > >
    > >
    > > Do you Yahoo!?
    > > SBC Yahoo! DSL - Now only $29.95 per month!
    > >
    > > [noparse][[/noparse]Non-text portions of this message have been removed]
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the Subject and
    > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
    >
    >
    > Do you Yahoo!?
    > SBC Yahoo! DSL - Now only $29.95 per month!
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-08-05 14:32
    I wrote an article for Nuts & Volts magazine that goes into the
    specifics of multi-bank programming and a method of moving data
    parameters between program slots. GOTO www.parallax.com and navigate
    the menu like this:

    Parallax >> Downloads >> Nuts & Volts Columms

    Click on Volume 3 and download column #87: Multi-Bank Programming.

    -- Jon Williams
    -- Parallax



    Original Message
    From: John Baker [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=FXcdY3mb8MXLu3imchcuRw55mYmaCKO3-l0jmo6Q81C36-KoaiaHCfvzBbAiVI3aSYD3nqxKMi3APjVBq7Wudyogt3w]johnbaker_erie_pa@y...[/url
    Sent: Monday, August 04, 2003 11:42 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] Program memory


    Dear Chris,

    Thanks for the reply.I have a BS2e and SX, Parallax says they have
    2x16K. My memory map still shows that the program space is %99 full. How
    do I go about using the extra memory?

    Cheers for more help!



    Chris Anderson <fuel@b...> wrote:
    Hey John,
    Go to using a bs2e, which will give you 8 x the program space, its
    really quite easy, and the module goes straight into the same ic socket
    as the bs2, same pinout etc. Cheers. Chris


    Original Message
    From: "John Baker"
    To:
    Sent: Tuesday, August 05, 2003 10:46 AM
    Subject: [noparse][[/noparse]basicstamps] Program memory


    >
    > Can anyone please tell me if it's possible to add more program space
    > to a
    BS2? I've filled it up and have shortened my program as much as
    possible. I know nothing about the matter, as I'm a complete newbie.
    >
    > Many thanks, John
    >
    >
    >
    > Do you Yahoo!?
    > SBC Yahoo! DSL - Now only $29.95 per month!
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject
    > and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/




    Do you Yahoo!?
    SBC Yahoo! DSL - Now only $29.95 per month!

    [noparse][[/noparse]Non-text portions of this message have been removed]


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2003-08-05 17:54
    Thanks Jon and Chris! Chris, your explanation helped immensly. I am now using my
    SX for my robot and have lots of space to spare. The Nuts and Volts article
    helped me understand it more too.

    Cheers to everyone!


    Do you Yahoo!?
    SBC Yahoo! DSL - Now only $29.95 per month!

    [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.