Help with Propeller Tool and Serial terminal
System
Posts: 45
This discussion was created from comments split from: Welcome to the P2 - PASM2 and SPIN2 code category!.
Comments
Serial terminal only works with flexprop C code. None of the examples in Spin2 work for the P2 Eval board for serial / debug output.
Very little to no support available. Is not backwards compatible to P1 code, not to mention random syntax changes.
Serial terminal works with every language.
Some SPIN2 examples might be targeted for certain boards, but most will work on all P2 boards.
Support is available- you only need to ask.
As the system is developed, some changes will be made to improve.
Code is not supposed to be fully backward compatible- that has been made very clear from the outset because the P2 is far more powerful then P1, and has many new features.
If you have any specific questions or need help to achieve something, please start a new thread and ask for help.
If you're using Propeller Tool you can press F12 to launch PST (Propeller Serial Terminal) to work with your app. I write a lot of public demos -- all of them are in Spin (1 or 2) and all work with PST. Some of my more recent programs have added ANSI support to allow FlexProp users to run my programs.
The P1 and P2 are different, and yes, there are some code modifications. Those of us who use Python had to make adjustments going from Python 2 to Python 3. Progress means that these things sometimes happen.
I have used the P1 for many years with great success. Spin1/PSAM1 is easy to handle and everything ~mostly works~. Spin2 is a bit of an offshoot (requiring massive re-writes) and you just cannot use Spin1 and expect it to still work with Spin2 as many functions don't exist any more (or have new parameters - or needs a complete changeover) - both Spin and PASM [for instance "JMPRET" ASM P1 does not have an equivalent to P2 ASM] and now this function cannot be ported from P1 to P2.
I have the P2 Eval board Rev C and none of the serial/terminal demos work with this board. I have literally tried every example instance that exists with 100% failure. I can get everything else to seemingly work (with no way to really know for sure) but serial terminal/debug is out of the question in Spin2... though it works perfectly fine with FlexC.
On my old P1 boards, every instance of Serial I/O works just fine. Why is it that every example for the P2 does not work except for in the FlexC language?
Not a single Spin2 example of Serial / Terminal / Debug works with the P2 Eval Board Rev C.
Its been quite a challenge to switch from P1 to P2. I have spent multiple months trying to get a simple serial output to work and yet nothing works. Other functions seem to work fine but there is no way to confirm without a serial data output function.
So far it seems the P1 is the only viable solution and I should look at linking two chips together instead of trying to get the $150 P2 Eval to work.
I did not expect to have to switch to FlexC to get Terminal to work instead of simply just using Spin2 for the same purpose. Now I have to re-write everything into FlexC if I want to migrate my projects from P1 to P2. This is a bit ridiculous.
I would have to say, it has been the most frustrating upgrade I have ever done in my life & I still question if it is even possible. It might be better to link 2x P1 chips together vs trying to get 1x P2 to work.
PST does not output data from the P2 Serial output function... Or there is something wrong with every example presented. PST stays a blank screen with every example attempted.
It would be great to get this chip working as I had graciously waited for its release many years past when it was said to be first released.
@zlantz,
I am seriously confused, I can run any available serial in SPIN 2 using PropTool or FlexProp and had never any problems.
My guess is that this is not P2 related. FlexC uses it's own Terminal, PropTool uses PST.
Maybe your PST is borked?
Test as follow. Program P2 with FlexC and verify output with Flex build in terminal.
close Terminal
Then Open PST on the same port baud settings and see if the output is visible. If not PST might be borked.
try,
Mike
Hi Mike,
PST seems to work just fine with any and all P1 codes... but P2 it just stays blank. If i code a very very basic HelloWorld in FlexC it works with the built in Debug terminal and PST (but not in Spin2 in any fashion). Instead it is just a blank screen the entire time.
As a simple example... this works 100%:
But this works 0%:
Idk how to make this webpage format the code right... I used proper indentations as required - posting ~here~ re-formats what I have copied and messes it all up.
Do note that the Flex compiler has full Spin2 support (and can even do Spin1-on-P2, with some caveats).
I have downloaded some codes to try and attempt this... I didn't intend to switch to the P2 only to have to use a P1 interpreter to run a serial terminal on the P2 so that it works. P2 should have a working terminal / serial / debug output function just like the P1 did that operates on the Spin2 language. Its really hard to wrap my head around using a P2 chip with P1 code that uses an interpreter to function on the P2 chip... Why cannot I just program P2 code directly to the P2 chip?
@zlantz It should work, but there are nuances... Sometimes, with Prop Tool, the name of the file is important. Spin1 files end in .spin and Spin2 files end in .spin2.
If you have FlexProp IDE, try the fibo.spin2 example. That has serial output.
BTW: FlexProp has it's own serial terminal and isn't intended to work with PST, but you could probably make it work with PST.
Do you try that Spin2 code with flexProp or the with PropTool?
If flexProp, have you set the Baudrate to 115200 in the Menu?
Have you tried the Examples in the samples directory of flexProp that do serial communications (mostly with SmartSerial)?
We all use Serial communications with the P2 since forever, with PNUT, PropTool, flexProp, with Basic, with Spin2, with C, with TAQOZ, with microPython and other languages. Without it you could not develop and debug all the code that got made so far.
BTW: You should use waitms(100) not waitus().
So, with Propeller IDE (P1/P2) its easy to code in, but apparently I then need to copy that code into a different compiler to transfer the data to the chip/flash such as PNut or flexprop because the Propeller IDE compiler doesn't work as it was intended? Totally unexpected but I can work with that...
When I try to do this, the program that would have no problem compiling in the PropIDE has many errors in flexprop and cannot compile but has zero problems in the Propeller Tool IDE with the exact same code.
I corrected the us/ms mix up but didn't really change anything as the delay does not matter in the functionality aspect. It instead only makes it easier to read. Still no serial in Spin2 but works just fine in FlexC.
In FlexProp as Spin2 I cannot directly copy code that works fine in Propeller IDE as Spin2 and expect it to work in FlexProp as Spin2. There are too many errors that were otherwise not there with the other IDE to try and make it work.
Again, it 100% works just fine in FlexProp if I use C as the language but as Spin2 it does not work at all while still using FlexProp for the programming aspect.
In your FlexC example you used the default baud rate (which is 230_400 for P2) whereas for your Spin2 example you used 115_200 for the baud rate. Try using 230_400 for the baud rate in jSer.start(), or else try changing the PST baud rate to 115_200.
Can you show the code? Or the errors? The most likely cause I can think of is that you're trying to use some library files that may be built in to PropellerTool that aren't in FlexProp. You could try some of the sample code in the "samples" directory of flexprop.
While not a user of FlexProp, I do try to keep my training programs compatible with it so those who can't use Propeller Tool can still participate in training.
This program runs from both platforms. The only change I made from one to the other is use \n with FlexProp in place of \r in PST (PST adds a CR to the NL).
I believe FlexProp defaults to 230400 baud -- in fact, I adjusted my presentation code to accommodate that.
The attached archive was last run in FlexProp so it's setup for that but, as I stated, it works fine in both development tools.
Note: If you're using FlexProp you can comment out these lines:
They allow the programmer to open and enable PST; the FlexProp terminal will auto-open.
This is what I get when I run the jm_serial test... It compiles fine and loads to the flash but the serial terminal remains blank.
Just like with FlexProp, the terminal opens but nothing comes over...
well you try to receive one character then sending out the same string repeatly.
Have you tried running it and hit enter in the top lines of the terminal?
Mike
Oh, it's that Wait_for_terminal(), right?
You don't need that with FlexProp as the terminal window opens right when the code loads.
That's an advantage over Prop Tool, IMHO.
This has made some headway in that now both the flexprop term or serial term will show the output data but I have to use flexprop for serial terminal to work as PropIDE compiled code still do not return data. I have tired sending various characters to no success.
I would very much prefer to use the PropIDE over FlexProp, I am not too fond of the plain white screen and little code coloring. Makes the code harder to read and follow.
It is great to see a Spin2 serial working, thanks for all the help on that! Now to figure out how to get the PropIDE to work.
Many pre-writ codes will compile fine with PropIDE but will fail with many errors in FlexProp so to make the switchover everything has to be re-wrote once more. For instance BinFloat needs modified because the NAN value is not allowed in FlexProp but is with PropIDE. Many unknown problems, not sure how to fix. The code looks right. This is part of the not wanting to migrate into FlexProp, the whole starting over once again thing.
Assuming I could use PropIDE and had a working serial terminal then my code is nearly complete and everything works fine... but if I try to migrate to FlexProp it has hundreds of errors and is impossible to get to compile.
Just to be clear... when you mention "PropIDE", are you meaning "Propeller Tool" or something else (such as Propeller IDE) ?
For reference for anyone else later, here's the download link for Propeller Tool- currently at version 2.6 : https://www.parallax.com/package/propeller-tool-software-for-windows-spin-assembly-2/
Yes, v2.5.3. The version that runs both P1 and P2 code, the latest instance I believe it is. Just saw there is a v2.6, installing it now.
Same problem exists with serial output, but now the PropIDE recognizes the same problems with BinFloat that FlexProp found. NAN and other defined functions are also built into the IDE so its in conflict with itself. Other defined functions like FAbs and FSqrt are also in error. Apparently BinFloat.spin2 does not work with the Spin2 language due to all the conflicts.
If you uninstalled the old one after installing the new one, that could've removed the font. Reinstalling the new one should fix that.
Yeah I got the font fixed after a frustrating multi-re-install multi-re-boot. Serial terminal from PropIDE still does not work. The new 2.6 version recognizes all the code errors that flexprop found.
Need floating point math to complete my code but the recommended BinFloat.spin2 is chocked full of errors and neither IDE can compile the code.
I really want to upgrade to the P2, its just been problem after problem with little to no solutions in site.
The Spin2 language was just recently changed to support floating point natively, and some of the new Spin2 keywords conflict with those in BinFloat. Here's a new version of BinFloat with those renamed. The basic operations like F_Add, F_Sub, and so on are redundant now, since Spin2 has +., -., *., and /., but the BinFloat versions are still there (and provide results more in compliance with IEEE than the built in Spin2 ones).
Oh my, this solves pretty much everything so long as I use FlexProp instead of PropIDE for programming. Gonna take a little getting used to I suppose. Just bounce back and forth between the two programs.
It does. Please archive and attach a program that you don't think works so that others can test independently.
BTW, the latest version of Propeller Tool is 2.6.0. This includes FP and other niceties.
It is. Since Propeller Tool can communicate with PST, I'm hoping @"Jeff Martin" will add the ability to open and enable PST at a specific baud rate so that we don't have to do it manually. Propeller Tool does that with the DEBUG windows, so it would make sense to have PST behave the same way.
Well at this point I have tried literally everything and only parts of each IDE/language work with the P2 eval board rev c on a windows 10 pc.
With C, serial terminal and multiple cogs run great but cannot get a basic servo control function to work so that is dead in the water. With Spin2, the serial works in FlexProp but when I try to start a second cog the program hangs forever so that is pretty dead. It is like what works in one language doesn't in the other.
Haven't tried hooking up to a sensor yet... kind of expect that to be very tedious. Just trying to get the most basic functions working first.
Never got serial terminal working in PropIDE. I used the earlier presented jm_serial_test.zip file as my test example as it was already shown to work on both systems. It did work in FlexProp but did not work with PropIDE v2.6.0.
I kinda feel like it is a bit of a bust at this point. Until there are more working examples across multiple languages I think this chip is going to get put on the shelf as its current condition is not usable. Unless there is some underlying system environment variables that need changed or missing system update? The conflict seems to be in the programming software more than the chip.
I am pretty happy with the P1 as it is a very stable chip that almost every example works for. Its only real downside was the maximum program size and it could be a bit faster. It can easily be programmed from the PropIDE software without any issues including multiple cogs and serial.
Maybe link two P1's together in place of the P2? Haven't tried that yet... seems a bit overkill.
I showed you in my post that holds the code that it works in Propeller Tool (I'm currently using version 2.6.0).
Except archiving and posting one of your programs for independent testing.
Is this the IDE you're trying to use?
The author stopped development many years ago (sad, it had potential) and I don't think there's a compiler that understands the P2 that it can use. Since you're on Windows 10, use Propeller Tool 2.6.0 (latest).
No... it is the one you are referencing to use. v2.6.0. This PropIDE serial term does not return data but FlexProp using the exact same code works just fine. Can use both the FlexProp terminal and the original Parallax Serial Terminal (F12 in PropIDE) and get serial data so long as I use FlexProp for the programming.
Is it possible that my P2 eval is damaged some how? This really seems like a software issue as what doesn't work in Spin2 works in C but what doesn't work in C works in Spin2.
Attached is the Spin2 code I am trying to get working in PropIDE. Does work in FlexProp without any issues so long as the wait for terminal is removed. (jm_serial_test)
Attached also is a C code for servo output that has working multi-cog and serial but no real way to implement servo output. (C Servo Test)
Attached also is a Spin2 code to start a second cog. It starts but then the primary hangs forever. Working / not working versions: (Serial Test NotWorks.spin2 and Serial Test Works.spin2)
(The working version never starts the second cog while the non-working version starts the second cog before the main loop repeat.)
@zlantz ,
you are confusing people.
There is a Program called PropellerTool which you are using.
The Serial Part is callt PST
There is a complete different Program called PropellerIDE, having NOTHING to do with PropTool.
Please straighten your names out, pretty please
Mike