Question regarding spin2
pilot0315
Posts: 910
@cgracey
Am I missing something really simple or is this a bug?
I am using the new propeller tool with the p2.
I ran the hello blinky code and it ran fine.
I used it for a base line for toggling some pins worked fine.
Copied and pasted to a new page and keep getting this error:
Unrecognized character
It is a simple copy and paste. Commented out those lines and nothing works at all either.
Thanks
Am I missing something really simple or is this a bug?
I am using the new propeller tool with the p2.
I ran the hello blinky code and it ran fine.
I used it for a base line for toggling some pins worked fine.
Copied and pasted to a new page and keep getting this error:
Unrecognized character
It is a simple copy and paste. Commented out those lines and nothing works at all either.
Thanks
Comments
The debug feature is currently not implemented in the Propeller Tool, but it will be soon available. Until then please use PNut if you want to use debug. It is currently only working there.
You'll find the recent version here.
@DigitalBob
@Kaio
I was using the blink program that came in the examples of the new propeller tool.
All I did was copy and paste and rename. This is where the error is.
I copied and pasted the hdmi and gave it a new name. Got this error.
This is the same thing I did with the blink. Still getting errors.
Same error in pnut.
Thanks
There must be a PUB routine in P1 mode.
Maybe rename file extension to .Spin2, close it, then reopen...
Is there a setting to change??
THAT DID THE TRICK!
Did not notice the drop down that chooses p1 or p2
Thanks
'.spin' is spin 1 and '.spin2' is spin 2?
confused,
Mike
As you've noted many times, I keep my files neat and tidy; adding a small comment tag in my header does not clutter the code.
In FlexProp, at least, the choice of language is independent of the choice of processor. That's not true of the PropTool yet, but perhaps some day it could be. A comment tag to indicate processor would be useful. It may also allow us to distinguish between different versions of the P2, if any of those exist some day (I suppose for now Rev A versus Rev B/C).
It makes porting code back to PropTool difficult if one can mix e.g. the Spin operators of P1 and P2 in the same code. This is also hard to see for one who believe to use the code for P2 and don't have experience with P1, that one must have to check the documentation for the P1 too to figure out what's going on.
As FlexProp does support the #if-directive and the PropTool not, it would be more useful if one would use it to differentiate parts of code to the related Propeller. So, it would be clear to see the difference of coding between P1 and P2 for everybody.
The "Spin operators of P2" are really "Spin 2 operators", they don't have to "belong" to the P2. The P1 can implement most of those operators just fine. Similarly the Spin1 operators can be implemented for P2.
There are two reasons I seperated language and processor:
(1) Logical: there's no reason that Spin2 (the language) cannot run on P1, and the new language features like the SEND operator are nice for P1 users. The exception is some of the built in functions for smart pins, of course, but the language structure itself is platform independent.
(2) Practical: it's very useful to be able to compile legacy Spin1 code for the P2. I think the lack of backwards compatibility with Spin1 is the biggest flaw in Spin2 (which is otherwise a very nice extension to Spin1).
There is a warning you can enable to show when you use FlexProp extensions for Spin. That doesn't cover everything yet, but it will help with making sure code in a .spin2 file can compile with P2 PNut.
That said, I really like @JonnyMac 's suggestion of comment tags like {$P1} and {$P2} to mark files that are processor dependent. This would help to sort out portability -- some Spin2 code is generic and can work on both processors, but some relies on P2 specific features like the smart pins.
I really hope Parallax will add a preprocessor to PropTool as well, since having #ifdef would make a lot of things easier.
Ken Gracey
These are excellent news specially for people like me new to the P2! The debug features are really impressive, but Pnut is not adequate for novices IMHO.
pnut was never meant to be for novices. It is the cutting edge for the experienced to get a preview into the P2, and to develop techniques before adding to PropTool.