New to Spin ...
Rsadeika
Posts: 3,837
from a SimpleIDE perspective. I have been working with SimpleIDE for awhile, using the C part of it, and I thought I would give that a rest and try some Spin, again. Yes, SimpleIDE is PropGCC centric, so when you start up the IDE it is in C mode. And it is project mode oriented, hopefully their will be no debate about the project mode, that debate has already been done.
Below is the code listing for a program that basically sets up a terminal I/O situation with three commands, turn on an LED, turn off an LED, and quit the program. I tried to gear this for a brand new user of the Propeller, and the Spin language. All of the program commands that are associated with tools.spin, are "under the hood", sort of speak. In fact I left the the tools.spin object without any comments, hopefully you will get the manual out, read about some of the specific Spin commands, and then make the appropriate notations in the tools.spin object.
The zip file that is attached, is a zipped project file, when you unzip it, it contains the test1 project; you will have to find and download SimpleIDE-0-9-28 file. After you have installed SimpleIDE, you can go to the test1 folder and double click on the test1 SimpleIDE Application and the program should start up, in the Simple View format. Then go to the Menu bar press Program->Run with Terminal, that should get the program started, in terminal mode. This is geared for the PropellerBOE, but you can use it with an Activity Board also. You can also get more information in the IDE Help menu.
So, again this for a new user that just wants to start up a program that lights up an LED, and look at some code as to how that was all done. I hope this helps out somebody, because I know when I first started using the Propeller I could have used something like this.
Ray
Below is the code listing for a program that basically sets up a terminal I/O situation with three commands, turn on an LED, turn off an LED, and quit the program. I tried to gear this for a brand new user of the Propeller, and the Spin language. All of the program commands that are associated with tools.spin, are "under the hood", sort of speak. In fact I left the the tools.spin object without any comments, hopefully you will get the manual out, read about some of the specific Spin commands, and then make the appropriate notations in the tools.spin object.
The zip file that is attached, is a zipped project file, when you unzip it, it contains the test1 project; you will have to find and download SimpleIDE-0-9-28 file. After you have installed SimpleIDE, you can go to the test1 folder and double click on the test1 SimpleIDE Application and the program should start up, in the Simple View format. Then go to the Menu bar press Program->Run with Terminal, that should get the program started, in terminal mode. This is geared for the PropellerBOE, but you can use it with an Activity Board also. You can also get more information in the IDE Help menu.
So, again this for a new user that just wants to start up a program that lights up an LED, and look at some code as to how that was all done. I hope this helps out somebody, because I know when I first started using the Propeller I could have used something like this.
Ray
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '' test1.spin '' '' July 1, 2013 '' '' To be used with SimpleIDE in Spin mode. ''''''''''''''''''' '' This program is setup to use the PropellerBOE. '' In SimpleIDE Spin mode you have to have a _clkmode and _xinfreq '' because the program is using a BAUD rate of 115200. CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 '' This program uses the terminal and some common tools, so '' to use them, label the objects. OBJ term : "FullDuplexSerial" '' FDS misc : "tools" '' My object that contains some common tools. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' PUB Start '' Setup FDS for a 115200 BAUD rate. '' Rx,Tx,Mode,BAUD term.Start(31,30,0,115200) Main '' Goto the main PUB. PUB Main | inSbyte,inAbyte '' Use local variables. misc.waitms(1000) '' Pause the program for one second. term.str(string("Press CR to continue",13,10)) '' Wait for a CR. repeat inSbyte := term.Rx '' Waits for a CR, if no CR is pressed then it repeats. if inSbyte == 13 '' If CR term.str(string("Menu: o - LED on, f - LED off, q - QUIT",13,10)) '' then start the main repeat. repeat term.Tx("#") inAbyte := term.Rx if inAbyte == "o" '' Turns on the LED at 26. term.Tx(inAbyte) misc.high(26) '' Pin 26 on PropBOE which is an LED. '' These next two lines do a CRLF, which could be done in its own PUB '' within this program, or the CRLF PUB could be in the tolls.spin object, '' and called with a misc.CRLF. This could be a small assignment, create '' your own Method, a pub, and add it to the tools object. And then place '' it in the appropriate parts of the program. term.Tx(13) '' CR term.Tx(10) '' LF if inAbyte == "f" '' Turns off the LED at 26. term.Tx(inAbyte) misc.low(26) term.Tx(13) term.Tx(10) if inAbyte == "q" '' Quit the program. term.Tx(inAbyte) term.Tx(13) term.Tx(10) term.str(string("Program Stopped",13,10)) abort '' Stop the program. '' This loop continues until you key in 'q' to leave the program. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Comments
The Propeller Tool, developed by Parallax, what is there not to like? First off, it does not have a built in terminal mode, yes I know, you can get availability to PST, but that turns out to be a hassle after awhile. For one thing the PST terminal is kind of awkward, for me, and the things that I play around with.
Some other concerns have been, by other people, is that it is strictly a Windows program. That could be a legitimate complaint if all you have available are Linux boxes or Apple stuff.
Some of the pluses are the IDE has some very nice highlighting features, it also has a nifty indentation feature. There are other things, this is just a quick overview.
BST, anybody that has been around this forum has definitely seen references made to this IDE. BST is no longer, nor has it been supported, for quite a few years. One of the things that impressed me, with the IDE, when it first came out, was that it had a "project" feature, which I used quite a lot. The other major feature was that it was available for Linux, so it took care of that aspect that the Propeller Tool was lacking. But, since it is now basically dead, I guess that should conclude any further discussion.
The last one on the scene is SimpleIDE in Spin mode. There has been some discussion that there will be a more Spin centric SimpleIDE somewhere along the line, the details about this are very very scarce, so it is not known as to what it will really be. The major features that it has: project oriented, available for the Windows, Linux, and Apple crowd, and has a built in terminal mode, just to name a few items. It takes a little more work to use the IDE, but in my opinion it is well worth it.
The above has been a brief overview as to what is available for the Spin language, since the next major improvement, for SimpleIDE, I think is going to be a Spin centric IDE, I am probably going to keep using SimpleIDE.
Ray
The things you do not get with Spin, even when using SimpleIDE, is access to LMM,CMM, or XMM modes. For the beginner that is probably not a problem, yet. I guess you might want to read the manual as it concerns COG ram, and HUB ram, you want to get a firm grasp of this.
In the program, I use some loops, 'repeat' and 'if', so you really want to pay attention to the indentation, since SimpleIDE does not give you a visual on this like the Propeller Tool does. Be very careful with indentation, it could create some major frustration when you develop a larger program.
Some of the commands that I use that are associated with the tools.spin object, I left not commented, you really should get to know waitcnt, DIRA, OUTA, and others. In the command(s) wait and waitms, there is a fifty three second limitation that I found out about the hard way, any further interest should be discussed in another thread for those of you that are interested.
This is a very general overview, there are a lot of Spin experts here, so if you need further explanation, just ask the question, and I am sure somebody will have an answer.
Ray
This in no way detracts from the excellent work being done by jazzed (Steve) on SimpleIDE and open compilers etc by others.
For the new users, the program in the first post, test1.prj/spin can be run on either bst or Propeller Tool. As I mentioned earlier, SimpleIDE has a built in terminal program which the others do not. If you do not want to use the built in terminal, you can also use some other terminal program that you have access too, just make sure that the comm port is released so your personal terminal comm port can gain access to the port. As you can see this can also get complicated if you are not using the built in tool.
As you probably can tell I like SimpleIDE, but if the "new" Propeller Tool comes out with the features that bst and SimpleIDE have, then I will probably start using that new IDE. Also, you have to keep in mind that one of these days Propeller II will be available, with the new features of that chip, the IDE will have to be able to make use of those features. So, it seems like this IDE business will change in the near future, not sure which IDE will come out on top.
Now, if you are thinking of which one to use, then you will have to do your own research, and find out which one is the best fit for you. From a new user stand point, the program that I provided is just a quick and dirty way of seeing what the Spin language is all about.
Ray
Ray
Another good place is :
http://learn.parallax.com/propellerc
Because it's still in a very active development cycle. The author, Jazzed, has been working very closely with the Parallax education department (hence the link posted by Publison) to make SimpleIDE as easy as possible for newcomers, and flexible for experienced programmers.
Just one little gripe:
The phrase: ".. if all you have available are Linux boxes or Apple..." makes it sound like us poor saps are some how stuck with Linux or Mac. I might have phrased it as:
"If your operating of choice is Linux or OSX"
or
"If you are not stuck using a legacy Microsoft operating system"
Sounds much more like the situation.
Isn't it still in BETA? I has been watching but waiting to start using it, as I am not a participant in the development effort. When its really, I have slew of kids that will want to use it. But best to reduce the number of unknows until the dev is complete.
Yes it is, but there are some good references and tutorials already @learn.parallax.com
I think that more clarity, from Parallax, is needed as to what direction support is going as it pertains to Spin? Will it be another Propeller Tool, SimpleIDE, Eclipse, or what?
Ray
Ken told to me to do the SimpleSPIN (name still TBD) version as soon as possible. Education is still top priority though.
SimpleIDE is part of the Parallax Education Propeller C effort. At the moment SimpleIDE is an IDE designed for using BSTC and/or Propeller-GCC. SimpleIDE is also a platform for some great libraries and tutorials written mostly by Andy at Parallax (and a few by me) with micro-controller sized code in mind.
The next version of SimpleIDE (un-named so far) will be PropellerTool-ish, will use Roy's Spin compiler exclusively, and will be in a much smaller package (any C ability will likely be an add on).
The Parallax Learn forum is a good place for beginners to ask questions. Experienced programmers should ask questions here or in the Propeller-GCC forum.
Next week we will be announcing the latest updates that fix some key issues. I recommend waiting for that before downloading another SimpleIDE package (unless someone suggests downloading a specific version).
Ray
I am not sure as to how far I will take this, but here is another new users example. In this program I decided to use a very simple example of the cognew command. If anybody has been browsing this forum they have seen, " Yes, but we do not have to deal with interrupts, we have cogs." So, the program below implements a COG in its simplest form, it starts the LED on P27, and keeps flashing and flashing and ...
The other thing I used here was the Extended_FDSerial.spin object, if I happen to remember how to use 'RxStr(@myStr)' then I will change the menu selection from 'o,f,q' to maybe something like 'onLED', 'offLED', and 'quit'.
I added a PUB CRLF, some of the more interested new users may want to look into as why it does not work if you were to move the method into the tools.spin object.
Ray
Since I have been working with the Propeller from the beginning, yes I have a large variety of boards laying around to choose from. But, from a new user perspective I would highly recommend the Propeller Quick Start board, it is about the smallest investment that you can make, as you work towards making a decision as to whether the Propeller is a microprocessor that you want to pursue.
I mentioned third party choices, these are: Propellerpowered, Gadget Gangster, MGH Design, and Wulfden. There are probably more, but these are the ones that I am familiar with.
I believe I have supplied enough information that you can make a reasonable decision and pursue getting deeper into the Propeller world.
Ray
Is what I ended up getting in the build status window.
SimpleIDE and Propeller-GCC work with OSX-Lion and Mountain-Lion.
Looks like SimpleIDE worked, but not Propeller-GCC.
Is your MAC Intel?
Is your MAC Intel?[/QUOTE]
Could you possibly run this in the Terminal and let us know what gets returned?
I get: "/opt/parallax/bin/propeller-elf-gcc: Mach-O 64-bit executable", which means propeller-elf-gcc is built for 64-bit only and works fine on my 1 year-old MacBook Pro, but will not run on 32-bit Macs. But, since you are running 10.5.8, I'm thinking that you should also have a 64-bit Intel CPU as that is a requirement for an 10.5.n builds. Let us know what gets returned...
I should be able to help you in building a working propgcc, if you have the 10.5.8 developer tools installed.
Well, "might"...
dgately
Seems odd that running propeller-elf-gcc on 10.5.8 does not give a more informed error or a "nice" crash report. Unfortunately, I don't have any systems older than 10.8.n, else I could test and/or try to rebuild propgcc for 10.5.n.
Tymkrs, Your'e not cheap, just "thrifty". Happily, Jazzed built SimpleIDE to run and look almost the same across OS types! So, your Win CPU is fine!
dgately
There is one detail that needs to be discussed, the absence of a stand-alone program that could be called SimpleTerm. Maybe if we asked jazzed very nicely, he could make the resident terminal program that is within SimpleIDE also available as a stand-alone program. The reasoning behind this is, the terminal program has some built in commands for cursor control, and I think most of the terminal programs that are available will not respond to the SimpleIDE terminal commands. I would imagine, at some point people will want to save a testxx.prj to EEPROM and run the program as stand-alone, with some fancy cursor control.
Now the question that should come up is, big deal, so what do I do with this program(s)? Well, I guess you could just delete everything, and move on to Forth. I figured what you have here is a very simple program that is command driven where you could add your own commands to do some fast and simple testing. For instance, on the PropBOE or the Activity board you have some servo connectors, you could write a method/driver for testing out a servo. Possibly create a command like tServo which would run your method/driver that you have come up with. That is just one example, remember you have breadboard, and other components like SD, XBee, ADC, ..., etc to work with, also.
I just wanted to create this so some new users would have some real programs that would not scare them away. Now all you have to do is use your imagination, and read the manual for further instruction.
Ray