Shop OBEX P1 Docs P2 Docs Learn Events
The Toggle Tutorials — Parallax Forums

The Toggle Tutorials

mindrobotsmindrobots Posts: 6,506
edited 2011-11-20 07:34 in Propeller 1
I like the toggle examples because they are iterative implementations of basically the same program progressively increasing in complexity as they include more and more sophisticated Propeller and PropGCC functionality. I've been going through them and verbosely commenting the source as I figure out what each is doing and what feature is being exploited/showcased. An updated demos\toggle\directory is being created with my changes.

Attached is the initial draft of "The Toggle Tutorials" for critique and feedback. As I see this now, it isn't a beginner's guide to C, or a beginner's guide to the Propeller but more a transition guide to help someone with some knowledge of C and Propellers start using PROPGCC and making use of the propeller features they know and love (multiple I/O pins, multi-cogs, PASM, etc.) and also understanding how to do some things in PROPGCC (multiple COGS, LMM, XMM, threading, COGS running PASM, COGS running GAS, etc.) that they may be doing in SPIN and PASM.

At some point, I'll introduce some input processing techniques. I was hoping to end the tutorial with an I2C implementation since that's a relatively simple yet sophisticated example of choreographed PIN I/O that does something useful.

I'd like honest feedback on the value of this and where it fits in the skill/learning continuum. Its good for me because I currently know a little about a lot of the stuff going on. I'm not a Propeller master in anyone's imagination and I'm certainly not a C guru but I do have a solid background and good grasp of the hardware and software concept involved.

I did start to borrow some of the Wiki contents to fill appendices and other knowledge holes. Plus I've also gotten some great info from Steve and Eric which will be incorporated into this journal of my learning journey.
If you have time, please take a look and provide any constructive feedback also if you can give me some direction as to continue or not. It's a great learning experience but we all know how much fun writing documentation can be.

I hadn't considered it but if this is better as a series of Wiki documents under Tutorials or something, I can surely do it that way. I've never Wiki'd before but I can probably handle that aspect if required/desired.

Thanks for your time and feedback!

Comments

  • RonPRonP Posts: 384
    edited 2011-11-18 12:36
    Awesome Rick thanks much.

    Ron
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-11-18 12:40
    Thanks, Ron!

    I'll count that as a vote to move onto Tutorial #2 lmm_c_toggle.
  • jazzedjazzed Posts: 11,803
    edited 2011-11-18 14:14
    Hi Rick. Nice read so far!

    Some small details:
    1. The demos/libpropeller directory is going away, but will come back as a small library another day.
    2. Header propeller.h is now in lib/include/propeller.h, and propeller.c is no longer used.
    3. 0x0ff0000 could be expressed as (0xff << 16) - it makes it easier to read the start bit.
    It would be good to illustrate using propeller-gcc commands in addition to make commands.
    One advantage of that would be going directly from the LMM program to a COG program simply by adding -mcog.

    Looking forward to the rest.
    --Steve
  • RonPRonP Posts: 384
    edited 2011-11-18 14:42
    Rick,

    You sure filled in a lot of grey area I had about memory models. And now for my brilliant question of the day. What is the size of the kernel running in the cog and is it the same size for all memory models? I looked twice and didn't see it, though I might have missed it. Thanks Again.

    Ron
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-11-18 14:43
    Thanks, Steve!

    1 & 2 - I figured the locations of things would be changing as things evolve - I'll tag those so they can be more easily updated later.
    3 - I'm still used to my 16 bit days when 4 hex digits didn't look too bad. 8 hex digits does get a bit awkward at times if it can be shorthanded. :smile:

    I was headed toward putting the propeller-gcc command in there. I must have gotten distracted by something shiny.

    Any Wiki versus pdf thoughts? I could go either way at this point - wiki has the hyperlink advantages. PDF has better hard-copy, e-reader and offline appeal.
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-11-18 14:46
    Haha! Ron, I'm just a technical writer! :smile:
    The memory model text for the most part came from the Wiki site -> http://code.google.com/p/propgcc/w/list

    That is an interesting question. I'm in no position to answer it. I think we need to invoke the names of the Guru's and hope they can help!
  • RonPRonP Posts: 384
    edited 2011-11-18 14:51
    Rick,

    I'll go on the hunt for the info. I am sure it's somewhere.

    Ron
  • ersmithersmith Posts: 6,100
    edited 2011-11-18 15:38
    RonP wrote: »
    You sure filled in a lot of grey area I had about memory models. And now for my brilliant question of the day. What is the size of the kernel running in the cog and is it the same size for all memory models? I looked twice and didn't see it, though I might have missed it.
    It is different for different memory models, and it's in a state of flux. Right now it's about 1712 bytes for XMM and XMMC modes, and 1928 bytes for LMM mode. That includes 512 bytes of FCACHE space for XMM and 1024 bytes of FCACHE space for LMM (FCACHE is space used by the compiler to load loops and small functions into to make them faster).

    Practically speaking the kernel takes up the whole cog. If it doesn't, then we're leaving performance on the table. We are looking at ways (besides FCACHE) to let user code run in the kernel, based on options given at compile time.

    Eric
  • RonPRonP Posts: 384
    edited 2011-11-18 15:56
    Thanks Eric,

    I just read Bill Hennings original thread about LMM very interesting how it all came together, with the 4 lines of assembly code. The details on the size of the kernel help put it all together and make sense, don't leave anything table.

    Ron
  • Jorge PJorge P Posts: 385
    edited 2011-11-20 07:34
    Thank you very much for NOT making the first tutorial "Hello World"! I'll be waiting to try all this until the first stable release of propeller gcc outside of alpha/beta. By that time there should be plenty of examples to keep me busy for a while.
Sign In or Register to comment.