Definitive SPIN Tutorial
Humanoido
Posts: 5,770
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
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
Sounds like you are set then.
OBEX is full of examples.
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.
As stated above OBEX objects are created by fellow Prop Heads. If you have a question about the objects use, you should try to contact the writer for help.
What is a Definitive SPIN Tutorial? Who determines definitive?
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
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.
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.
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
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 Abshier
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
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
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.
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.