Shop OBEX P1 Docs P2 Docs Learn Events
Propeller memory problem — Parallax Forums

Propeller memory problem

MicrocontrolledMicrocontrolled Posts: 2,461
edited 2009-03-07 17:58 in Propeller 1
I am writing a large propeller program that involves a screen, keyboard, and mouse. It uses several propeller objects: TV, Graphics, Keyboard, and Mouse. I am doing it on a Hydra board so it is a modified keyboard and mouse object but they are about the same in memory. The whole thing was going smothly. The memory map said that I had only used 1/3 of the memory I was almost done. However, I drew a pixel sprite for the pointer and added the mouse object and when I pulled up the memory map it said "Memory exeads by 213 Longs". It says this even though just a few lines of code before it sayed that there was over 2,000 longs free! Can someone tell me what I am doing wrong???

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thank you for reading!·

···

Comments

  • mctriviamctrivia Posts: 3,772
    edited 2009-03-02 19:31
    how big is the mouse object?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Need to make your prop design easier or secure? Get a PropMod has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.
  • jazzedjazzed Posts: 11,803
    edited 2009-03-02 19:58
    Sometimes an object included at different levels will get counted more than once. Don't know why it happens, but I've seen it several times. One fix (since you are only using the dat it seems) is to include the object at the top level and pass it· the data array· by address to other objects that need it using a method.

    Of course your situation could be totally different .... Showing us at least the structure of your code (with a _README_.txt as produced with the File->archive tool for example) might help in understanding your issue.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --Steve

    Post Edited (jazzed) : 3/2/2009 8:10:20 PM GMT
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2009-03-02 20:35
    I think the graphics program reserves the top space for buffering by "_stack ="

    So even though it shows that space is left, the program has reserved it for other purposes.
  • cessnapilotcessnapilot Posts: 182
    edited 2009-03-07 07:29
    microcontroled1204: In a Propeller Flight Simulator project I have to use a separate Propeller for TV display. I attached· a· preliminary (and the latest) version of the code of the display unit. In the source code I somewhat decricpted the memory usage of the TV driver. This might help. See the last (and decommented) variable array. That is a tool to find out available memory.

    Regards
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-03-07 12:41
    Thank you, cessnapilot, I hope it will work. And to mctrivia, the mouse object is 195 LONGs and I still have 2,1** left. In fact I recently tryed to just remove the mouse object and keep the bitmap and it worked fine. (the bitmap dosn't take up any space)I think the mouse object is getting downloaded more then once.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thank you for reading!·

    ···
  • RaymanRayman Posts: 14,826
    edited 2009-03-07 14:53
    I think Erik is right... If you're using the double buffering, like in Graphics_Demo, there's very little room left for actual code as most of memory is reserved by the _stack statement for the video buffers...
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-03-07 16:58
    I AM using the double buffered graphics griver and I copyed and pasted the begining right out of the demo. I coulden't figure out what could be using the free space but I did just recently notice that free/STACK. Is it possible to remove the double buffering without affecting the flickering of the image?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thank you for reading!·

    ···
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2009-03-07 17:01
    Not really. If you notice, the graphics routines clear the buffer and redraw each screen. When it is fully updated, it copies the buffer to the screen buffer. The only way to significantly reduce memory use is to lower the resolution.
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-03-07 17:58
    Are you using PropTool 1.2 There is a bug with small programs in PropTool 1.1 that sounds like this.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps:· SixBladeProp, TriBladeProp
    · Prop Tools under Development or Completed (Index)
    · Emulators (Micros eg Altair, and Terminals eg VT100) - index
    · Search the Propeller forums (via Google)

    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Sign In or Register to comment.