P2 template in Prop Tool bug/feature
Rayman
Posts: 14,646
Just downloaded the 2.7.0 PropTool beta hoping this was fixed but seems not...
When you pick File-> New (From P2 Template) it won't compile because it's in P1 mode.
It should put itself in P2 mode and show "P2:" on the file tab.
Instead, it doesn't say if P1 or P2 mode, but seems to always be P1 mode.
This seems to be a bug to me and would confuse new users.
Comments
Also, it would be nice if the template could be something that actually compiles...
Have an object from the library in the OBJ section or comment it out.
Also, be good to specify clock frequency there.
Personally, I'd rename "public_method_name()" to "Main()" and probably but a repeat there.
I have provided my template to Parallax many times -- the only person who use it is Ken.
This is an observation, not a criticism, but the people who build tools at Parallax don't actually do anything meaningful with the Propeller (1 or 2). It's not that the wouldn't if they had time, but they're a very small, over-worked team the Ken worked very hard to keep together the last couple of years with COVID and all the red tape (especially here in CA) forced onto businesses.
My latest template is attached. It has my serial and random libraries included. Since I'm providing an archive, you know it compiles -- after you've saved it as a Spin2 file.
Propeller Tool needs a lot of finishing touches (it has since released), but what I really miss now is being able to compile without saving. That is the purpose of the {$P2} comment tag. Jeff uses tags like this in the BASIC Stamp Editor, and I'm hoping he will incorporate that in Propeller Tool as well.
Whoops.... I had stuffed a little test code into my template; that's cleaned out of this version. This is where it would be nice to compile without having to save.
That's not bad. I'd simplify it and add some comments like this:
Clock set options:
Note I've got fully configured rather than assuming a 20 MHz crystal in use.
How to start program and then shift to serial terminal in time to catch everything is still an issue.
For the template, maybe something like this is a good way to handle that:
In my templates I call this function right after all the IO and objects are setup:
This lets me open the terminal of my choice (usually PST, but sometimes PuTTY), enable it, press and key and go. Easy-peasy. The code works with PST and ANSI (if defined) terminals. I prefer to put this code away in functions to keep the main() method cleaner.