Shop OBEX P1 Docs P2 Docs Learn Events
EEPROM Full... What can I do? — Parallax Forums

EEPROM Full... What can I do?

koolitudekoolitude Posts: 37
edited 2007-03-31 14:37 in BASIC Stamp
I'm using a BS2 for my application.· but it seems that my project requires more memory than my BS2 actually can provide...

What can I do? Thanks.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-03-31 03:34
    It may just be that some cleaning up needs to be done. You may be able to compact the program down. Are you using a lot of DEBUG or SERIN/SEROUT statements? These consume a lot of memory. Do you have routines that exist more than once in the code? If so these can be put into subroutines and reused. There may be a lot of options. Can you post your code?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • koolitudekoolitude Posts: 37
    edited 2007-03-31 03:57
    Thanks for your advices...
    Below please find the code I'm using... this one is already 'downsized' a bit... so it does not use up all the memory... however, I'm planning to add some more code into it...
    btw, let me tell you what I'm trying to do... I'm indeed modifying the Wheel_Motion.bs2 (the program found in the Digital Encoders kit)... I added some codes for reading a compass and performing directional adjustment according to the compass reading.·
    What I would like to add is some more codes to perform tilt·compensation for my compass.· I'm worrying if there will be enough memory for my project... cuz the current program has used up quite a lot of memory already.
    Thank you very much for your suggestions.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-31 04:08
    You've got a good sized program already. If you try to add much more, you probably will run out of memory. The BS2 is somewhat limited (to 2K) in memory capacity. Often you can save small amounts of memory by tightening up your existing code. Eventually you have to go to a bigger processor. The BS2p/pe/px for example, have I2C support built-in which can save some. All of the Stamps other than the BS2 have multiple program slots. It's like having several different programs that can sort of "overlay" each other. You can't just write bigger programs, but one program can transfer control to another and the different programs can share variables.
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-03-31 14:37
    I did a test and if you REM out all your debug statements you get 1/2 your program memory back.

    Also try using aliases to preserve your registers (scratch memory) space:

    Example:
    cat···· VAR···· Byte··················· ' Create a byte-sized variable
    tabby·· VAR···· cat···················· ' Create alias for cat


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR
Sign In or Register to comment.