Shop OBEX P1 Docs P2 Docs Learn Events
EEPROM Sapce — Parallax Forums

EEPROM Sapce

eoinsyeoinsy Posts: 8
edited 2005-01-21 12:35 in BASIC Stamp
Ive run out of code space on my BS2p,·is there is another stamp that will have about 32Kb, 8000 instructions?
Or can external EEPROM be used·to store lines of code? I'll try and tidy me·code up·but that still wont make it small enough

thanks for any help

Post Edited By Moderator (Jon Williams) : 1/20/2005 6:12:47 PM GMT

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2005-01-20 17:49
    1. No, lines of code have to be stored in the on-module EEPROM, there is no way for the run-time engine to access another EEPROM.

    2. Are you using multiple eeprom partitions yet?

    3. How do you KNOW you'll need 32 KBytes? That's a LOT of PBasic code.

    4. What are you trying to do? There's usually more than one way to do something. Some ways take WAY more code space than others.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-20 18:17
    You cannot use external EEPROM for program storage. Start by optimizing your code. One thing to look for is mutliple SERIN, SEROUT, DEBUG, and similar lines that can be built into a single statement. For example:

    SEROUT pin, baud, [noparse]/noparse][color=red]"BASIC "[/color
    SEROUT pin, baud, [noparse][[/noparse]"Stamp", CR]

    is best incorporated into a single line, and when they're very long you can use the comma as a line-continuation character:

    SEROUT pin, baud, [noparse][[/noparse]"BASIC ",
    ·················· "Stamp", CR]

    This takes less code space.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA


    Post Edited (Jon Williams) : 1/20/2005 6:22:21 PM GMT
  • achilles03achilles03 Posts: 247
    edited 2005-01-20 19:40
    Yeah, allanlane5·asked a good question.· Are you using all the slots in your BS2p?· It's got 8 slots, for a total of 16kB.· If you're maxing out your eeprom's coding memory, then I'd guess you're probably not writing code very efficiently.· I would take a look at making it more modular and avoid·code that's overly-repetative.· Look at functions like BRANCH, GOSUB, etc.

    Dave
  • eoinsyeoinsy Posts: 8
    edited 2005-01-21 12:35
    thanks for the suggestions, I'll try and squeeze it all down and let you know how it goes
Sign In or Register to comment.