Out of Ram/Program Space and Challenging Soldering...

I've been enjoying this forum for a few years, ever since I came upon the website some years back.
So my interest led me buy some of the Prop boards, which I never used since I don't know how to (not the programming but the electronic side of it) hahaha...

But ultimately my lack of electronic skills has (nearly) let me down...
I've been trying to assemble a board to my (wishful) requirements...
I've been doing some soldering work on it maybe once a month or once every few months over the last 3 years.

All the time I've wanted to create a framework onto which I can build better things hopefully.
I think I can do the programming but have now run out of program space.

What I would like to know, if anyone could point me in the right direction.. Is...
Which Editor/IDE do I use if I want to program in SPIN and use the LMM

Don't laugh but there's a pic of the (nearly complete) board I've been soldering for 3 years hahaha
Hopefully I'' have it ready for Christmas wit woooo :))

I just need to add some decoupling capacitors here and there and some link wires....

Jaan Doh


1742 x 1012 - 417K
3840 x 2592 - 2M


  • IIRC, LMM is for putting assembly instructions into the hub. I could be wrong, but I don't know of any programs that mix Spin and LMM PASM, unless it's something custom.

    I ran into a problem a few years ago where I ran out of code space on the P1. The *problem* is that the official Parallax compiler doesn't remove unused methods. What I ended up doing was using BST, a cross-platform clone (ish) of Propeller Tool. It has the ability to analyze the code to tell you variables that you may not be using, and will remove unused methods if you like. I think there are other Spin compilers that do this, too -- perhaps @Roy Eltham can assist, as he's up on those topics.

    You can get BST here: http://www.fnarfbargle.com/bst.html

  • If you're using the normal propeller tool, you're already using one of the most space-efficient compilers (due to compiling to bytecode rather than PASM).

    However, it doesn't perform even the most rudimentary optimizations. You might want to try BST, which does have a bunch. Annoyingly, it's kinda old and crusty, creator hasn't been seen in years: http://www.fnarfbargle.com/bst.html

    The other option is to manually optimize your code:
    - Get rid of code that isn't actually used.
    - Simplify your expressions (example: "a += b" is always faster and smaller than "a := a + b")
    - You probably shouldn't include objects for hardware you're not actually using in a particular application
    - SD-MMC_FATEngine is just kinda huge. Try ripping out features you don't need or try fsrw.

    Ideally, you'd tell us what you're actually trying to accomplish.
  • JonnyMac wrote: »
    IIRC, LMM is for putting assembly instructions into the hub. I could be wrong, but I don't know of any programs that mix Spin and LMM PASM, unless it's something custom.

    Yep, you're right, Jon. LMM is for PASM in hub. There was a Spinterpreter with LMM features out there at some point, IDK where that is now. Irrelevant since LMM code is huge and thus'd only make OP's RAM problem worse.

    OP might be thinking of XMM, which is the one using external memory. To my knowledge only available in two C compilers, PropGCC and Catalina. Haven't messed with either's XMM mode yet, but I hear PropGCC's may have bitrotted away. Would require rewriting in C. There's a spin2cpp tool, but it's not perfect.
  • Nice that you posted pics. Always good to see what others are doing.

    Since you're a beginner with the prop, and you're not using C, then I suspect you really are not out of memory, but rather have a whole pile of objects that you don't need, at least to start with.
    Better to start out small, and gradually expand as you prove it works.

    When you really run out of memory, post your code, and ask. There are plenty of tricks to reduce the code size by re-using as buffers, etc.
  • Peter JakackiPeter Jakacki Posts: 9,819
    edited 2020-11-20 - 22:35:47
    FIrst thing I thought was "why aren't there any local 3.3V regulators on the board?". Regulators work better when they are closer because if you remember they are sensing the output and regulating accordingly, but that's not much help when there is all kinds of resistance and inductance between it and the actual load.

    Second thing I thought was "lots of references to hardware in the [screenshot of the] code, but where's that hardware?".

    Anyway, it's nice that you posted a photo, but if there is more to see including a zip file of your code as well then we can do more than just speculate.
  • OpenSpin does unused method elimination as an option. It's a command line tool though, so not a replacement for PropTool or BST. It will generally produce the smallest total size when unused method elimination is enabled. I did comparisons against BST.

    Anyway, it's essentially unsupported now too, Parallax never integrated it, almost no one uses it, and I have zero desire and little time to put into it. Things would be a lot different right now if Parallax had followed through on integrating OpenSpin into PropTool 5+ years ago when it was ready to be integrated. Oh well...
  • JaanDoh wrote: »
    What I would like to know, if anyone could point me in the right direction.. Is...
    Which Editor/IDE do I use if I want to program in SPIN and use the LMM

    I think FlexProp produces LMM from Spin for Propeller 1.

    But as others already said, LMM makes the code bigger (and faster) and it seems that is not what you are after.

  • Hi All,

    Thank you for your input and advice.
    I'm sorry as some of you mentioned, what I meant to ask for was for an ide which I can use to program in using SPIN and with XMM (not with LMM...)

    Thanks I downloaded BST and straight away it popped out warning me about variables and methods which were not being used.
    That's well nifty!

    Thanks I'm trying to make a framework similar to the one described in the WMF Demo in documents (AN005-SimpleVGAMenus-v1.0.pdf) but more complete.

    Also your'e quite right I meant XMM and not LMM (I got the two mixed up).

    Thanks you that is how I started out, but I've reached the point where I am 100% sure the final program size will exceed 32Kb or the size of program memory available on the P1.

    @Peter Jakacki
    Oh I'm sorry, I bought a lots of bits from ebay, case, psu, sd card module, rtc module, ps2 connectors etc and they will all live the case.
    Case Photo
    I will add a 3V regulator when I get closer to completion, I have bench PSU which I will use to power it when I get closer to testing (after completing soldering lol).

    @Roy Eltham
    Thank you, I think I download OpenSpin a while back, for when I gain more experience on the P1. Its still there somewhere on my HDD.

    Yes your'e quite right, that's not what I need.
    I got it wrong in my original thread.
    I want an IDE that I can use for XMM not LMM (Apologies.

    Finally, apologies to everyone for answering you all on the same thread.
  • Surely you don't need a case and PSU that big! How about a small NUC style box and and external power pack?
    Anyway, I figure if you are trying to build some kind of PC you really need a P2.
  • @Peter Jakacki

    Oh it just looks big, they fit nicely inside.
    Yes I am building a PC of sorts but its more uP (micro)

    I bought a few of the boards, the quick start boar, the mini, and the one with the ethernet connector (spider silkscreen on back), but I've never been able to use them.
    because they need soldering. Hopefully I'll get this one ready before Christmas (fingers crossed)

    I'm kind of dying to get my hands on a P2,
    Its looks super. its just a shame my electronic skills are sub par.

    I love what your'e doing the P2D2, and cant wait to get one of those either.
    Are you shipping those now? Or are you still refining it more?

    The attached pic shows the fit of the case, its the perfect size.

    Back to my question...
    Maybe I will have learn C so I can use one of the Ide's that support XMM
    I was trying to avoid that as my memory is deteriorating too fast to learn a new language.

    I'm still holding on in case I find an IDE that supports XMM and I can program in Spin.

    1920 x 1250 - 422K
  • Back to my question...
    Maybe I will have learn C so I can use one of the Ide's that support XMM
    I was trying to avoid that as my memory is deteriorating too fast to learn a new language.
    Have a look at Catalina -- it supports the P1 and P2, and has XMM support, too. Some say that learning new things is the best way to strengthen the neural connections in our brain -- this might help you on two fronts.

    -- https://sourceforge.net/projects/catalina-c/

    From that page: Supports programs up to 32kb on any Propeller 1 platform, 512kb on any Propeller 2 platform, and up to 16Mb on Propellers with XMM RAM.
  • XMM is so slow, why bother? Now, why is soldering such a challenge? You have a hot clean slightly wetted iron and solder, apply the tip to the joints and feed a little solder onto the heated joints to be soldered. Let it flow for a second or so and it's all done!
    I will be shipping P2D2s this week and next.
  • Thanks JonnyMac,

    I've downloaded and installed, also installed Simple Ide,
    I'm just trying to get round the C now.

    Can I use Spin in either of those environments? and will it support XMM?

    I want to be able to use one of the 2 Propeller micro-controllers to do all the bit-banging between the External memory (SST26VF032 )
    I managed to port the driver to spin, I don't know if it will work yet hahaha since I haven't got the board ready yet.
    Microchip driver http://ww1.microchip.com/downloads/en/DeviceDoc/SST26VF032.txt

  • Peter, soldering is difficult because my hands shake lol

    Its a good job I don't shake from top to bottom or people may think i'm dancing hahaha
  • Can I use Spin in either of those environments? and will it support XMM?
    No. SimpleIDE and Catalina are C compilers; I don't know of any Spin tools that support XMM.
  • JRoarkJRoark Posts: 566
    edited 2020-11-23 - 22:04:03
    Firstly, I think your board is cool! Love to see what others are doing. Clearly some fun mischief happening there. I’d be interesed in seeing more pics as this evolves.

    Have you tried Eric Smith’s FlexProp compiler suite? It supports PASM, C, Spin and a wickedly wonderful version of BASIC that compiles to assembly code. You can call C/Pasm/Spin code from BASIC and vice-versa so as people create useful objects, you can quickly leverage them.

    If you’re itching to get your hands on a P2, there are lots of options. Parallax has the P2-EVAL and an accessory board set for it. Also, there is the P2 EDGE/JonnyMac that is great for breadboarding. And then there are offerings such as Peter’s line of boards and Cluso’s offerings that do amazing things for not much money. Should one of these options find its way into your xmas stocking, you’re going to fall in love with the P2.
  • Peter JakackiPeter Jakacki Posts: 9,819
    edited 2020-11-24 - 01:17:11
    btw, I would always recommend Tachyon for lots of reasons and it is very fast and compact. A high-speed 1-wire multiprocessor driver is built into Tachyon that mimics a full-duplex serial console so software can use this channel just as if it were a discrete serial port, but it also means you can console chat with any Prop in the network. high-speed serial, VGA and audio and sidcog etc are built-in as are many many devices. When I say built-in, I don't mean a repository somewhere, I mean on the Prop chip itself where you can interact with them.
    Hook-up a piezo to pin 0 for instance and to make it ring like a phone 3 times type "0 SPKR 3 RINGS"

    Other devices include: WS2812s, DHT22, 32 channel PWM, SERVOs, Infrared RX/TX, PING, I2C, EEPROM, SERIAL, SPI, DAC, WAVE etc

    Various RTCs types are supported internally, it's just a matter of saying which one and Tachyon will automatically read the RTC once at reset and every day and then maintain the time and timers in software so that there is no delay in reading the time etc.

    Even I lose track of all the stuff that is built into Tachyon, and even after the FAT32 virtual memory layers etc there is still plenty of room left.
    If you wanted to read a long from offset $1000 in an open file you would just say "$1000 SD@" where $1000 is placed on the stack and then SD@ will use that address and fetch a long from the open file and leave the result on the stack. To dump and view the first 256 bytes of the file "0 256 SD DUMP" and so on.

    Whenever you want to save what you've been testing into EEPROM just type BACKUP and any autoruns you specify will also execute during boot.

    Tachyon has all these features and more because I use it in commercial products that need to run 24/7 in industrial environments, not just a bench demo.

    Now when you progress to the P2 then Tachyon is there too, but more so as TAQOZ.

  • JonnyMac wrote: »
    Can I use Spin in either of those environments? and will it support XMM?
    No. SimpleIDE and Catalina are C compilers; I don't know of any Spin tools that support XMM.

    I find it interesting that nobody apparently looked into building or modifying any Spin tools to support XMM. I guess the Parallax community using Spin was pretty much able to do everything required within the 32KB HubRam limit. I wonder what the XMM speed penalty would have been given that Spin itself is a tokenized interpreter language? Perhaps Spin running on XMM with caching enabled might have had just a minimal impact on overall execution speed?

    Fortunately, two C compilers do support XMM. PropGCC isn't supported anymore, but Catalina is, so Catalina was my choice.

    When you factor in all the tradeoffs required when adding external XMM memory, I think Rayman's "Rampage" configuration using two SPI SRAM chips is the best choice considering pin usage (8 data pins, one Clock, and one Enable), driver complexity, and execution speed. The XMM kernel will require one dedicated cog, while caching (which I found to be a "must have") will require an additional cog.

    Yes, running XMM, even with caching, is slower than using LMM running out of HubRam. How well you can tolerate this really depends upon what application you want it to do. I use XMM to display various GPS and status Menus at a 1Hz update via the Serial Console Link (i.e. pins 30 and 31), and it works fine.

    But I'm also using the Catalina Multi-Memory feature as well which has separate CMM programs running within HubRam that perform the heavy lifting of interfacing with the GPS receiver, sending commands to it, parsing output messages, and providing the results to the XMM program for display and output. So for what I have it doing, XMM works perfectly fine.

    That being said, it's likely that I will migrate to the P2 platform once the new hardware configurations are widely available and the software tools have matured. For example, I will require a 4-Port Serial Driver on the P2, like presently available on the P1, before I can seriously look at switching over.

    In the meantime, I can continue to tweak my P1 code...

Sign In or Register to comment.