out of memory on prop question?
vettezr1
Posts: 77
Hi guys I have a problem I need to understand .. First I should state I have a few prop boards ,, Dr-Acula's, and other boards that have quite a bit of sram on them my problem is I wrote a program in spin for the prop but on a standard prop board like the proto board or demo board or Hydra I only have the ram/rom that comes with them my question is on the other boards I think I can only use the extra ram when running CPM is there anyway to just add a simple sram to a very basic prop board where my large program can just use the extra ram running spin?
I just need an extra 16K is this something that can be done???
Thanks guys
I just need an extra 16K is this something that can be done???
Thanks guys
Comments
There are all sorts of ways to attach external RAM to a Prop, but they all use lots of I/O pins (parallel SRAM) or are very slow (serial SRAM) and, in any event, these solutions provide memory that's not the same as that on the Prop chip. Several people have written programs like CP/M emulators or other CPM emulators that can use this external RAM with a speed penalty. There are also compilers like Catalina (C) that can use this external RAM, but as a separate memory. It's possible to attach serial SRAM to a Demo Board or a Hydra with the limited I/O pin availability and Bill Henning has been working on a virtual memory system that copies in code and data from the serial SRAM as needed and runs nearly as fast as something that uses just the internal Prop RAM, but it's not ready for casual use. Read some of the thread on the ZOG interpreter and Bill Henning's virtual memory code for ideas.
There are all sorts of ways to save on memory. Often recoding part of your program and changing how the logic works can save a lot. Other times, people put a lot of strings in a program and each copy of the same string takes a separate piece of memory.
I might have an answer sometime in the near future, but it depends a lot on your progtam and language.... that is if you are able to run in assembler.
I am working on a system (mostly running... some tweaks still required) whereby cogs can load and swap any number of sections of program (to the cog size limit at any one time) at runtime from hub, and execute them at full speed. It would be a minor extension to permit that load too happen from an external SD card, albeit loading from hub would be quite a bit faster.
In essence the program sections are re-locatable when pulled into the cog ram. If you are operating in Spin, then my approach would not work for you. And also if for some reason all your program needed to be resident inside the processer all of the time it also would not be suitable.
So my approach is very dependent on you program's needs, but it just might work.
Cheers,
Peter (pjv)
That is why I am using CP/M. Not because I like old operating systems, but rather, because when I start writing a program and it very quickly grows to 1000 lines, I don't want to have to worry about running out of memory. Indeed, I don't even want to think about memory when I am coding.
No one has written "big spin". Yet.
But there are other options. Use C and I think you can use the extra sram with Catalina. I believe one of the Basic programs might be able to as well.
CP/M can do a lot of things - on-board text editing, xmodem for wired (and wireless) file transfers. Multiple languages, including Pascal (which looks very similar to Spin).
As an aside, someone over on the N8VEM forum has just posted some code for Space Invaders that is written in C with inline Z80 assembly. I'm waiting on more details, but with MPM you could have 8 programs running in parallel with 48k of memory for each program. Code fragment below.
Big Spin is possible, but without compiler support, it's unbearable - been there, done that.
we may have to convince Brad or mpark to "enhance" their compilers to support some external RAM and then rewrite the interpreter to use it. Maybe a LMM interpreter could be faster than the built-in (avoiding all the this-code-is-not-executed)
Spin is a good native language for Propeller. Huge 32MB+ programs can be run on Propeller with C and external memory. I have 32MB SDRAM working with ZOG and will finish porting Catalina and continue other projects when I'm finished with the I2C keyboard/mouse interface.
Mike I should have mentioned I do need most of my I/O guys I have no doubt my code is bloated I am very in-experienced at programing so I wrote the whole thing in Spin I am not even calling OBJ's with the exception of PST most of my code is all dira outa and freq stuff I was quite suprised by the out of memory error but my code is over 20 pages I am not sure I would have to worry about speed Mike (serial Ram) but I am not sure how to use them
my program is just one big giant I/O I also read input switches then based on that output to a servo or transistor
Thanks guy if anyone can show me how to use a serial ram I would be very thankfull
I suspect that it'll be a better use of your time and effort to trim down your program. You probably have a lot of duplicate code where most of a routine is identical to other routines ... a great candidate for subroutines.
John Abshier