C or Spin?
ChristianGeek
Posts: 1
Hi, I'm new to the Propellor and just received my Activity Board. I'm curious...is there an advantage to programming with Spin instead of C?
Craig
Craig
Comments
It depends.
If you already know C it is the fastest way to go. If you do not know C then Spin may be easier to learn.
Parallax does a huge work in getting C documentation and demos out, but most Source out there for the propeller is in Spin and Pasm.
Spin is slower than C but uses less memory, thus more complicated programs in Spin might still fit in 32K.
on the other hand C supports external memory for lager programs and spin does not.
Spin is made for the propeller and neatly supports the whole concept of the Propeller. It is quite fun to learn and program with.
so -
it depends.
Enjoy!
Mike
-Phil
I recently bought an Activitybot, and I have been relearning C using the Simple C tutorials.
What would I need to get to be able to learn Spin with the Activitybot? And are there tutorials for it the way there are for C?
Thanks
Tom
We've noticed that since we've started to offer C we have had more people interested in learning Spin. This is great!
Take a look at the Propeller Education Kit tutorial and the Parallax Semiconductor AppNotes. Also see the Propeller Tool Q&A and Propeller Manual. All of these resources are very helpful.
C has it's place as it allows you to abstract your program from the hardware a bit and build some data structures and apply some code designs in a different way than spin. It is also a transportable skill and you want as many of those as you can have in your personal kit.
There are other routes that folks have taken that let you interact directly with the hardware but you specifically asked about Spin and C, so I won't be the one to take us off topic.
Do you have any programming background? That can influence the direction you want to take, also.
Thanks everyone for the answers. A little on my experience:
I'm a retired metallurgical engineer, finally with some time to follow up on other interests. In the 1980's I had a couple of computers (Compucollor II and COSMAC ELF). With the Compucolor, I programmed in Basic (built in to the computer), 8080 assembly language, tiny C, fortran, and fig Forth. I also made some hardware add-on's from BYTE magazine interfacing to the 8080 Bus..
When the Compucolor died (unfortunately the company was out of business) I stopped doing the low level stuff (never got into PC or 8086 programming), but did PDP11 Basic, and Techtronics Basic programming for mechanical test machine control, data acquisition, and analysis. I also did a little Microsoft C utility programming to convert the number formats used by different data acquisition hardware into formats recognized by the data analysis computers. That type of work ended about 25 years ago.
Last year I bought an Android Tablet and downloaded Forth onto it. I've been using that a lot. Unfortunately, the Android Forth is written in Java and the limitations of Java and Android limit its ability to interact with the machine, but as a programmable calculating system, its pretty useful and fun.
My wife and I usually give Christmas gifts that are scientific or tech education to our great nephews and nieces. Recently my niece (a teacher) suggested that we give her 8 year old son a programmable robot, and suggested a specific model (not Parallax). I researched robots and found that the BoeBot would be more appropriate, because of the educational/tutorial materials here and the hardware add-ons. While researching, I also found the Activity Bot and the C tutorials, and decided to buy one for myself - to re-learn C and to re-study microcomputer control (using a modern system.)
I'm part way along the Activity Bot tutorials, and I'm studying the C code in the libraries. I've also read the Propeller documentation and feel that Spin will help me get me a better understanding of how the processor works and of parallel processing (I have no experience in that at all).
I have very limited knowledge (almost none) in interfacing to controller boards, so this is a very interesting experience for me. I doubt that I will use any of this for anything other than a learning experience, but I also find that I like to take published projects / software and modify them, so who knows?.
Thanks again,
Tom
PropForth - see the link in my signature or search for PropForth for some of the "mother" threads. It is very full featured but non-ANSI
Tachyon which is a wonderfully fast, very Propeller oriented forth also that is still a rapidly changing work. It's also in my signature.
The newest kid on the Forth block is pfth - which is an ANSI standard Forth that has grown up quickly and is also a good go on the Prop.
If you enjoyed Forth on your Micros back in the day, these will amaze you!
So all these choices certainly don't help with your predicament at all!
Following Martin's Rule: Forth can be very compact, if you care to use it.
Ahhh, but someone mentioned Forth!! That's the important thing!!
You should say some thing nice about the other language every time you go off topic
I apologize; I had no intention of hijacking a thread. Simply asked how to go about getting the stuff I needed to learn Spin with my Activitybot, was given some very good suggestions, and was asked about my programming background. I answered and found out that in addition to the Parallax languages C, Spin, and PASM, there was also he that shall not be mentioned. I thought it was a good response since it pointed me to other sources rather than going into detail in this thread.
Once again, I apologize, and I appreciate the sharing of knowledge in these forums.
Tom
There are at least 6 different forths mentioned in the Parallax forum history.
Parallax does not offer any Learn materials on forth.
Useful information about forth on Propeller can be found in threads beyond the Learn forum.
Thanks.
Haha, don't fret! I really did think you were the original poster!
One of the true joys of the Propeller is that it has several languages available on it that are production quality and let you explore it in many ways. With C it is useable without some folks having to leave gheir confort zones. As stated earlier, Spin/PASM give you access in the 'native language'. While the Activitybot tutorials are written in C, the OBEX (objecf exchange) contains code for most of the Activitybot sub components.
The activities on learn.parallax.com are a great collecfion of tutorials and regardless of the language they are written in are great learning resource to work through.
I have a collection of links to Spin tutorials (and a bunch of other stuff) in post #3 of my index.
I think I've even fixed all the broken links caused by Parallax's recent website change.
One nice thing about Spin is you'll get help very quickly in the Propeller forum (you'll likely get help in C too).
Check the Online Tutorials link on the back of the Propeller Activity Board. That learn.parallax.com/PropellerAB page links to the Propeller C Tutorials at learn.parallax.com/propeller-c-tutorials. They were created with and for the Propeller Activity Board. They're quick, easy, and will get you started on all kinds of fun projects with a minimal time investment.
For comparison, there are Spin equivalents of some of the pages in the Propeller C Simple Circuits section that can be found here: learn.parallax.com/PropellerBOE
Andy