Shop OBEX P1 Docs P2 Docs Learn Events
Increase RAM Available — Parallax Forums

Increase RAM Available

dermotdermot Posts: 26
edited 2012-06-03 14:25 in Propeller 1
Hi,

I am currently using a Microchip 24LC512 EEPROM in my project. However I have only 354longs free stack space and the program is only about 85% complete. I am going to run out of RAM space. Is it possible to increase the RAM space without having to split the program and use an SD loader. Can I change EEPROM to an equilavant with larger storage or add an additional EEPROM.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-06-03 05:59
    You cannot increase the amount of RAM available. You can change the EEPROM to a 24LC1025 which has 128K bytes. You can add additional EEPROM up to a maximum of 512K and you can add additional I2C busses on other I/O pins, each with up to 512K of EEPROM.

    There are all kinds of tradeoffs you can make between speed and space. If you have lots of speed to spare, you could rewrite your program in C and use either Catalina or the GCC C compiler to compile it in XMM mode which uses external SRAM to hold the program and can use a cache in hub memory to speed up access. There are also techniques to split up a program so that assembly I/O drivers and their initialization are in one module with another module containing the rest of the program. This allows the program to re-use the memory occupied by the I/O drivers once they're loaded into their cogs' memory. Often large programs can be made smaller by rewriting them with careful attention to memory use.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-06-03 06:27
    There are lots of space saving tricks one could do on the Prop.

    If you are launching PASM code into its own cog, you reuse the RAM for a buffer or some other array.

    If you're willing to post your code, I bet some of the forum members would be willing to help find ways to saving same RAM.

    Have you used BST? It eliminates unused methods from objects. I've had several programs that wouldn't fit into the Prop without using BST.
  • dermotdermot Posts: 26
    edited 2012-06-03 10:03
    If I add another EEPROM 24LC512 will this allow me to compile a larger program without having to load a section of the program from the 2nd EEPROM.

    What exactly is the BST?? I have never heard of this?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-06-03 10:47
    dermot wrote: »
    If I add another EEPROM 24LC512 will this allow me to compile a larger program without having to load a section of the program from the 2nd EEPROM.

    No. The compiled program needs to fit in the Propeller RAM which is limited to 32KBytes. You are currently using less than half of your current EEPROM chip. It the Propeller's built in RAM that limits the size of your program.
    dermot wrote: »
    What exactly is the BST?? I have never heard of this?

    Brad's Spin Tool. It should be on the Propeller's download page. It was not made by Parallax (Brad wrote it).
  • TubularTubular Posts: 4,706
    edited 2012-06-03 13:33
    Hi Dermot

    Can you tell us which objects you are using for your project? Some have "compacted" versions that are not necessarily in the obex.
  • pedwardpedward Posts: 1,642
    edited 2012-06-03 14:25
    Your EEPROM is 64K right now, which is over double your program size. You are concerned about free stack, which is RAM. If you are writing SPIN programs, you are limited to 32K of program space, without doing some very tricky overlaying.

    The PropGCC project supports what you are asking about, you can write programs that will be stored in EEPROM and loaded with on-demand paging. This is called XMMC mode in PropGCC.

    If you aren't against using C to develop your program, PropGCC is a viable choice. Download the SimpleIDE package to get started, it's available in the PropGCC forum.

    BST is an alternative SPIN development environment, google search will help. It has an optimizing compiler that can reduce code size and help your cause.
Sign In or Register to comment.