Shop OBEX P1 Docs P2 Docs Learn Events
Setting expectations while migrating your mind from SPIN/PASM to SimpleIDE C — Parallax Forums

Setting expectations while migrating your mind from SPIN/PASM to SimpleIDE C

Alex.StanfieldAlex.Stanfield Posts: 198
edited 2015-03-10 14:40 in Learn with BlocklyProp
Hi, is there a reference chart, list or material about the context and differences that could aid someone used to SPIN/PASM transition to SimpleIDE C?

The learn tutorials are Ok but I'd like the big picture, things like:


- How many cogs do I have available from the start assuming I use a debug port?
- what's the footprint for the different memory models?
- in typical uses (Serial, I2C, SD card, etc) what is the footprint?

Any pointers?

Thanks
Alex

Comments

  • edited 2015-03-10 07:41
    Hello Alex,

    I don't think we have the type of comparison document you are looking for yet, so instead of a link, here are answers.
    • The number of cogs available from the start assuming you use the debug port is the same as Spin. In Spin, the topmost method in the topmost file is the one that automatically starts executing. In C, it finds the main method and starts executing from there. In Spin, you can choose an object that does half duplex serial with the debug port for 0 additional cogs or one that does full duplex for 1 additional cog. In C, you can include a library (as in the tutorials) that does half duplex (0 additional), and you can make the code switch to a library that does full duplex (1 additional).
    • The footprint of the different memory models has not been characterized to my knowledge. The compact memory model (CMM) and large memory model (LMM) both work like Spin, with a kernel living in a cog that fetches and executes machine codes from Main RAM. Main RAM holds both program and variable memory. Cog C uses functions that translate to PASM commands so that you can write C code that fits in a cog. There's a Mixed Mode Programming Turial thread nearby with more info. Extended memory stores the program on separate media, and fetches and executes machine codes from there. We are working on an improvement to it so that it treats the peripheral memory like Spin treats a cog, so that all cogs have a shot at fetching a machine code in sequence.
    • Typical uses with the libraries in the learn.parallax.com site's Propeller C Tutorials take much larger chunks of program memory because their functions have lots of features to make the top level code easy to write for beginners. I think SD is a somewhat larger than in Spin, and I2C seemed that way too. However, there are a couple library sets developed by community members that reportedly have very small footprints and lots of features. Links below, and please keep in mind that they were developed by professionals for professionals, so each has its own learning curve that is separate from the learn tutorials.

    PropWare
    http://david.zemon.name/PropWare/index.html

    libpropeller
    https://github.com/libpropeller/libpropeller

    Andy
  • Alex.StanfieldAlex.Stanfield Posts: 198
    edited 2015-03-10 14:40
    Thanks Andy.

    For reference on another thread which derived to a similar question SRLM posted this link that I find very useful

    https://sites.google.com/site/propellergcc/documentation/faq

    Alex
Sign In or Register to comment.