Shop OBEX P1 Docs P2 Docs Learn Events
How can I increase propeller memory? — Parallax Forums

How can I increase propeller memory?

NikosGNikosG Posts: 705
edited 2011-07-09 07:00 in Propeller 1
Hello all,

I was working with my propeller proto board in a very cool project and I saw the following message on my monitor:
attachment.php?attachmentid=82804&d=1310167481
Obviously I became out of memory. I tried to tidy my code and I gained some space temporarily. As i tried to use a new object the problem appeared again. How can I increase my propeller memory? Can I do something with software or with the hardware?
331 x 140 - 9K

Comments

  • PublisonPublison Posts: 12,366
    edited 2011-07-08 17:00
    Have you tried BST to see if you could compress it a bit? It gets rid of unused portions of the code with the correct parameters set.

    http://www.parallax.com/tabid/828/Default.aspx
  • NikosGNikosG Posts: 705
    edited 2011-07-08 17:39
    Publison wrote: »
    Have you tried BST to see if you could compress it a bit? It gets rid of unused portions of the code with the correct parameters set.

    http://www.parallax.com/tabid/828/Default.aspx
    Unfortunately I'm not a Mac or Linux user. Can I use it in conjunction with Windows?
    BTW I've just ordered from Parallax store a micro-SD Card Adapter. I hope that it will help me.
    Thanks!
  • PublisonPublison Posts: 12,366
    edited 2011-07-08 17:47
    NikosG wrote: »
    Unfortunately I'm not a Mac or Linux user. Can I use it in conjunction with Windows?
    BTW I've just ordered from Parallax store a micro-SD Card Adapter. I hope that it will help me.
    Thanks!


    Nikos,

    I will run under Widows also.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-07-08 19:07
    Nikos,

    If your code is somewhat modular (logical sections that all don't have to run all the time), you could try using Dr_Acula's KyeDos. KyeDos will reload the Propeller memory with different code, from a SD card, depending on what is needed. It helped with a project I had that was running out of memory.

    Duane
  • Mike GreenMike Green Posts: 23,101
    edited 2011-07-08 19:20
    To more directly answer your question, you can't increase the Propeller memory. Any memory that you add to the Propeller works differently than the built-in memory. Some people have modified the Spin interpreter in ROM so that it will execute programs out of external memory, but this is slower than using the built-in memory by quite a bit. This can be sped up by using caching, but this is experimental and not for a beginner. You can use Catalina which is a C compiler for the Propeller that runs under Windows and Linux. Catalina will compile large programs (as much as several megabytes) and execute them from external memory, again with a modest speed penalty. Again, it's not something for beginners.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-07-08 21:37
    Nikos,

    Do you have large amounts of data stored in memory?

    As Mike said it's not an easy task to use external memory for program storage but data storage isn't nearly as difficult. EEPROM is probably the easiest to use external memory. There is also SRAM and flash as options for external memory (and, of course, SD cards). Oh, and Jazzed even has a board that uses SDRAM.

    Maybe you have a large array that can be moved to external memory?

    Strings are also a good candidate to store externally.

    There are also ways of reclaim RAM that held PASM code after the PASM has been copied into a cog. Although again, you can't easily use the reclaimed RAM for program code, just data.

    As Publison pointed out, BST's unused method eliminator is probably the easiest first step in free up some RAM. I use BST with Windows myself.

    You can also post your code and see if others can find a way of changing your program to use less RAM.

    Duane
  • NikosGNikosG Posts: 705
    edited 2011-07-09 02:10
    Duane and Mike,
    Thank you!
    My project is a Propeller solar tracker based on time calculation (real time and date or hypothetical time and date)
    The first module calculates the altitude and the azimuth for a given date. It creates an array with tree columns TIME, ALTITUDE and AZIMUTH. The number of rows varies and it depends from the length of the day and the frequency of the calculations. (For instance if I run the code for 16 July 2011 and take the results every 1 minute from Sun rise to sun set I have approximately 863 rows. If I take results every 1 hour I have17 rows).
    attachment.php?attachmentid=82817&d=1310202554
    [The above logical section has very complicate formulas (because of lot of trigonometry) and uses the “F32 object” (Till now I have no problem).
    The second module gives a graphic representation of the solar orbit in the TV screen.
    It has as input the ALTITUDE and AZIMUTH in a given time ant it draws the Suns position in the polar map on the TV screen.
    attachment.php?attachmentid=82842&d=1310251972
    This module can work independently from the first module for one couple of ALTITUDE and AZIMUTH. This module uses the "TV" and "Graphics" SPIN objects. The problem starts when I try to combine both modules in order to have the whole solar path.
    In addition there is and a third module (not ready yet) that takes ALTITUDE and AZIMUTH and drives two motors (servo or stepper) in order to drive a xy rotated base toward the Sun.
    Here is my XY-base using two steppers with a laser on top (I hope that Parallax will create a more beautiful XY base as a commercial product)
    attachment.php?attachmentid=82841&d=1310251972
    (Obviously I'll need more memory for this)
    I also haven't take into account the memory I need for the code that manipulates the DS1302 time circuit and for the code that manipulates the mini Keyboard or external keyboard or mouse circuit in which user will be able give data.
    As you can understand I need a lot of memory!.
    The idea of Dr_Acula's KyeDos sounds very good! where can I find more about this? I 'm waiting the SD card and some crystals from my parallax order, to put all together and try again.
    730 x 548 - 57K
    511 x 384 - 34K
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-07-09 07:00
    TV graphics is huge memory hog.

    The only way I've gottne the probelm is to use a second Propeller chip.

    I think there are ways to use external memory as a TV buffer but that method is still over my head.

    I've seen suggestions of not "double buffering" to save momory. I understand what is meant but again I don't know how to do this.

    I have used a serrial connection between two Propellers. The first Propeller does the calculations and sends the data to the second Propeller to display on a TV.

    Duane
Sign In or Register to comment.