Shop OBEX P1 Docs P2 Docs Learn Events
Definitive SPIN Tutorial — Parallax Forums

Definitive SPIN Tutorial

HumanoidoHumanoido Posts: 5,770
edited 2010-09-04 09:48 in Propeller 1
Where is the best place to learn the basics of Spin and more about Spin examples?

I see a lot of really fine documents with a lot of excellent information but each document is missing the Definitive Spin Tutorial. After flipping through thousands of pages in an attempt to find one little thing, and not finding it, then going on the Forum only to be told to spend more time looking it up and take the initiative on my own, I really wonder where is the Definitive SPIN Tutorial.

I even went back to post #1 in the prop forum and progressively worked my way through thousands of posts to learn things. There are many things of great complexity in the highest level of detail, yet some of the most simple things are elusive.

It is as if you are in an alien world and the strange object on the wall is described in every detail, shape, size, color, mass, conductivity, specific gravity, electroluminescent, thermal properties, electro and spectral properties, ring, density, temperature, geometric and trigonometric constructs, alignment, radioactive half life, magnetic stasis, its curved calculus, chemical composition, construction, manufacturing, wall mounts, permeability, reflective/exo properties, molecular stability.. but someone forgot to give you the Definitive Tutorial! :)

I know about the PEK book, Propeller Manual, Data Sheets, the Propeller Forum stickies, some book samples, and the introduction in the HYDRA book. I've printed out stuff from web sites, and save info to files & collected Forum information.

Humanoido

Comments

  • Heater.Heater. Posts: 21,230
    edited 2010-08-31 03:49
    Humanoido:
    I know about the PEK book, Propeller Manual, Data Sheets, the Propeller Forum stickies, some book samples, and the introduction in the HYDRA book. I've printed out stuff from web sites, and save info to files & collected Forum information.

    Sounds like you are set then.

    OBEX is full of examples.
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-08-31 05:03
    Heater. wrote: »
    Humanoido: Sounds like you are set then. OBEX is full of examples.
    Heater, thanks for the OBEX reminder. But did you know, some of the objects have no comments whatsoever.. I think there should be comments and a specific link to the Forum thread containing additional and more detailed info.

    Humanoido
  • RinksCustomsRinksCustoms Posts: 531
    edited 2010-08-31 06:04
    Humanoido wrote: »
    Heater, thanks for the OBEX reminder. But did you know, some of the objects have no comments whatsoever.. I think there should be comments and a specific link to the Forum thread containing additional and more detailed info.

    Humanoido

    As far as uncommented objects go, those were written by a forum member to accomplish a task for his own projects and as such took the liberty of providing the rest of us with an already made object that performs a certain task for you to use without copywrite or royalty concerns (the basis of the MIT licensing). The objects written by you or others do not require comments or instructions, but they do help whe learning spin and especially when learning PASM.
    Like the rest of us, the information you have already found, such as the propeller education labs (your best bet) is as close to a tutorial as it comes to this subject. There does exist a type of beginner program for spin, it's called 12 Blocks. It's drag and drop code chunks in a visual way, sort of like a puzzle game, but it can lead to some unexpected results if certain blocks are passed inapropriate values such as INB x -as i havent tried this command within the 12 Blocks program and wether it would catch such a typo or not- since there is no such functional command or parameter in the current propeller (INB reffered to port B input in which reffers to another 32 pins for I/O which has not yet been made into an IC form -sigh).
    I'm sorry to hear you were basically shunned away from a straight answer, this forum and everyone in it tries to be informative and friendly and are here to help. To get to the point of your question, the only tutorials that exist are those written by the staff (PEK Labs) and various ones contained here within the forums and other places. These tutorials are how the rest of us learned. It helped to have the manual handy, even in PDF form, to step through each line of an object to decipher the code within the object so you have a better picture of just how the object achieves its function(s). For me to figure out how to get the TV driver to output S-Video, i had to read through sections in the Hydra book on how the video hardware worked and how the TV driver did its thing. It still took some experimenting with the settings and reading through a few hundred times the code comments at the bottom of the driver to figure out exactly which bits to set to get my desired result. Did you know that with the right setting for output, you can have composite or S-Video & broadcast to ch 4 at the same time? (requires two resistor DAC's on a contigious group of 8 pins). The best way to learn spin or PASM is to read through the examples and tutorials, disect a few objects, and just become very familiar with the commands in the manual, and if you become stuck on something the forums are a good place for an explanation in simple terms on a command or if you think there is something wrong about your code, post at least a clip of the suspect code in a forum post and if someone can read it and disect it, they will likely be able to pick up what is wrong and at least offer suggestions to help fix the code so it will point you in the right direction. Thats how even Mike Green and the rest of us Senior posters had to learn it.
  • Mike GMike G Posts: 2,702
    edited 2010-08-31 06:38
    I find the Propeller documentation to be more than adequate. If I don’t understand a construct I’ll create unit test code and experiment. If I still can’t get it through my head I’ll post a specific question. Like anything, it’s a learning process.

    As stated above OBEX objects are created by fellow Prop Heads. If you have a question about the object’s use, you should try to contact the writer for help.

    What is a “Definitive SPIN Tutorial”? Who determines definitive?
  • LeonLeon Posts: 7,620
    edited 2010-08-31 06:40
    I think he's after something like The C Programming Language, by K&R.
  • StefanL38StefanL38 Posts: 2,292
    edited 2010-08-31 07:45
    Hello Humaniodo,

    can you give an example of what YOU mean by definitive?

    The example can be even from far away of SPIN itself
    it just has to illustrate what is definitive for you!

    I can try to think of different variants what you MIGHT mean:

    should this tutorial provide exampleS for each command for every
    variation of the command?

    like

    repeat ' infinite loop

    repeat 8 'repeat 8 times unconditional

    repeat i from 0 to 100 'repeat 100 times and use variable i as index

    repeat while <condition>

    repeat

    until <condition>

    ???

    should theses sample include democode with debugoutput that shows how important variables change their values and how the program-execution goes under different conditions etc.?

    Should it provide complete demo-programs from a to z ?
    in a variation-"depth" like

    starting blinking one LED
    blinking a group of LEDs
    switch on/off a group of LEDs
    creating a "K.I.T. knightrider" LED-row with 6 LEDs, 7 LEDs, 8 LEDs, etc ?


    I have a question too and I mean it serious - I'm really interested:

    What is the advantage for you of this tutorial over asking concrete questions here in the forum?

    best regards

    Stefan
  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-31 08:09
    There is no Definitive SPIN Tutorial and there is no Definitive PASM Tutorial. Bits and pieces of what might eventually become these omnibus tutorials appear from time to time and that's the way these things happen unless some selfless 3rd party comes forward inspired to create. There's no money in it and Parallax doesn't have the resources to do it any other way and there's no use complaining.

    The heart of the matter is that it's a huge amount of work for a small market and a Definitive Tutorial isn't something that just anyone can knock off in a few days. We're talking about someone who has experience teaching and/or writing technical books for sale, who's expert at using the Propeller, and who's willing to invest six months to a year part time in writing, developing examples and exercises, etc.
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-08-31 08:36
    The propeller syntax manual helped me out greatly. For SPIN and PASM
  • Nick McClickNick McClick Posts: 1,003
    edited 2010-08-31 10:59
    I agree with Mike - it is a ton of work to put together an all-encompassing tutorial. The Propeller manual is a decent start, though. There are 2 pretty good assembly tutorials - I put up a link to them here.

    The market is small, but whoever puts up the first comprehensive tutorial will be in the leading spot & will likely sell plenty of copies as the market grows.
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-09-01 20:33
    StefanL38 wrote: »
    Hello Humaniodo,
    can you give an example of what YOU mean by definitive?
    The example can be even from far away of SPIN itself
    it just has to illustrate what is definitive for you!
    I can try to think of different variants what you MIGHT mean:
    should this tutorial provide exampleS for each command for every
    variation of the command?
    like

    repeat ' infinite loop
    repeat 8 'repeat 8 times unconditional
    repeat i from 0 to 100 'repeat 100 times and use variable i as index
    repeat while <condition>
    repeat
    until <condition>
    ???
    should theses sample include democode with debugoutput that shows how important variables change their values and how the program-execution goes under different conditions etc.?
    Should it provide complete demo-programs from a to z ?
    in a variation-"depth" like
    starting blinking one LED
    blinking a group of LEDs
    switch on/off a group of LEDs
    creating a "K.I.T. knightrider" LED-row with 6 LEDs, 7 LEDs, 8 LEDs, etc ?
    I have a question too and I mean it serious - I'm really interested:
    What is the advantage for you of this tutorial over asking concrete questions here in the forum?
    best regards
    Stefan
    Hi StefanL38, a definitive source of learning spin programming would cover the things necessary to write (with simple focused examples for each) spin programs so that a beginner can follow along without missing any of the foundation elements. The book is well written and more examples of more complicated routines would be made clear for understanding. You could take this Definitive Spin Tutorial and use these minimal illustrative working examples in your own programs, and gain further "technical" information using the Propeller manual and other sources as references.

    The closest I have found to a DST is chapter 15 - The Spin Language, in the book Game Programming for the Propeller Powered HYDRA by Andre LaMothe. This section is from pages 245 to 318, and is so well written, that it's simply not enough.

    The LED programs you mention are short, simple and sweet. Yes, they should be included, and they can serve to illustrate many fine concepts with working example code. BTW, some of these already exist in PEK.

    The advantage of such a tutorial over the Forum is that you can DIY your own program using the examples and have instant on-hands access to all the routines and code you need for your project.

    Plus, the DST will be written at a level you can understand and answer questions you may have that might otherwise take days for a reply on the Forums.

    You would see code examples with comments for each line of code, and paragraph descriptions for each sample program, written in a manner of understanding, not of illustrative technical prowess.

    I mean if your going to say CRn by lv at clock node div to trailing edge of PWM at upper Long to particulate phased counter, those things need to be explained first for understanding.

    Humanoido
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2010-09-03 06:37
    Mike Green wrote:
    Bits and pieces of what might eventually become these omnibus tutorials appear from time to time and that's the way these things happen unless some selfless 3rd party comes forward inspired to create. There's no money in it and Parallax doesn't have the resources to do it any other way and there's no use complaining.

    I'm not sure why this point keeps coming up. Parallax was recently featured on a Make video about open-source companies as having > $1,000,000 annual revenue. It seems reasonable that they could hire a tech writer to create some documentation, which is being requested by paying customers.

    Make video: http://blog.makezine.com/archive/2010/05/million_dollar_baby_-_businesses_de.html
  • John AbshierJohn Abshier Posts: 1,116
    edited 2010-09-03 07:43
    I wonder if David A. Lien is available? The Radio Shack Model I manual was outstanding as a tutorial manual.

    John Abshier
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-09-04 09:48
    I wonder if David A. Lien is available? The Radio Shack Model I manual was outstanding as a tutorial manual. John Abshier
    John, I remember it - and it was fantastic. Their technical manual was complete enough to do lots of projects in hardware too. Plus the Model I level II BASIC was the most improved and complete version with string handling we've seen since that time.

    Speaking of bits and pieces, I now think one of the best introductions to Spin language can be found in the Propeller Software Tool help file. It lays down a solid foundation. However, it left me wanting more. It would be really great to see Parallax make its own book out of it by expanding it, keeping it in the most simple layman's terms. There are those of us wanting to program in SPIN for the majority of our programs and learning by short working examples is a great way to have rapid success.

    Humanoido
  • The_MasterThe_Master Posts: 200
    edited 2016-07-29 11:52
    I was looking for a Spin tutorial and came across this forum. I wanted to start checking out the Propeller. Years ago a used a really wonderful Parallax tutorial to learn the SX. So has any tutorial been produced since the last post here in 2010 :-] I ask because I couldn't find any tutorial myself.

    Either Spin or Assembly is fine, but I specifically wanted to see a tutorial for Spin to see what it was about.

    Also, can anyone just tell me if Spin is strictly a structured language, i.e. no address labels are allowed? According to what I came across labels are only in PASM. If Spin is strictly no lables, I will probably stick with assembly
  • Heater.Heater. Posts: 21,230
    I think everything you need to get started is in the Propeller Manual. That's all I used to get into SPIN and PASM all those years ago. That and perhaps a few questions here when got confused or stuck.

    Spin is a structured programming language. Even better it has objects and it has no goto statement.

    Why do you want address labels in your high level language? Effectively variable names and method names are address labels. GOTO is a bad idea so no need for that or the labels it needs.

  • The_Master wrote: »
    I was looking for a Spin tutorial and came across this forum. I wanted to start checking out the Propeller. Years ago a used a really wonderful Parallax tutorial to learn the SX. So has any tutorial been produced since the last post here in 2010 :-] I ask because I couldn't find any tutorial myself.

    Either Spin or Assembly is fine, but I specifically wanted to see a tutorial for Spin to see what it was about.

    Also, can anyone just tell me if Spin is strictly a structured language, i.e. no address labels are allowed? According to what I came across labels are only in PASM. If Spin is strictly no lables, I will probably stick with assembly
    In the Propeller Tool click Help then click Propeller Education Kit (pdf)...
  • Programming and Customizing the Multicore Propeller Microcontroller and Programming the Propeller with Spin: A Beginner's Guide to Parallel Processing are both great for (what i would call) "project based" learning.

    For tutorials though, i would suggest the Propeller Education Kit Labs Fundamentals. It's a freebie too. That might be the same doc lardom referenced above.
Sign In or Register to comment.