PropBASIC Questions:
davidsaunders
Posts: 1,559
I have been catching up on the propbasic version of my 3D Printer firmware (as well as the pure PASM version), though there are somethings I am having difficulty figuring out.
Is there a better manual than the 'PropBASIC Syntax Guide 0.13? Something more up to date?
How do you work with multiple source files in PropBASIC?
And is there some better info on starting tasks in PropBASIC?
I do like what I know of PropBASIC quite well, though the documentation is lacking in some areas, and I have searched the forums. I may not have seen a thread that has this info (assuming there is one).
Is there a better manual than the 'PropBASIC Syntax Guide 0.13? Something more up to date?
How do you work with multiple source files in PropBASIC?
And is there some better info on starting tasks in PropBASIC?
I do like what I know of PropBASIC quite well, though the documentation is lacking in some areas, and I have searched the forums. I may not have seen a thread that has this info (assuming there is one).
Comments
I'd be interested in seeing PropBASIC 3D Printer Firmware, if you have any specific questions please ask and I'll answer them for you.
Doing tasks is basically:
Task code shares PIN variables and HUB variables, but all VARs are seperate in each TASKs.
Bean
Thank you for the link to the manual.
Bean
I am writing the PropBASIC code under that assumption, so good to know it is correct.
And I am also assuming that the "LOAD" keyword includudes the file specified inline at the location of the "LOAD" statement (at least as far as the generated output is concerned). I hope that is correct.
Bean,
What is the status of work to get PropBASIC working with Propeller IDE ?
Did you get any further along with a PropPASCAL parser version of PropBASIC ?
See also this thread about Lazarus/FPC now running on Pi2 :
http://forums.parallax.com/showthread.php/160718-Propeller-Chip-Raspberry-Pi-2-Interfacing-With-Free-Pascal-amp-Lazarus
Bean has very generously agreed to transfer PropBASIC source to Parallax, so we can more closely look into the integration with Propeller IDE. We've asked Brett Weir to look into it for us and should have a lightly integrated solution soon, later with syntax highlighting and some project management.
Are we committed to it yet? Still looking into it, but should be able to clarify our plans by mid-May.
Ken Gracey
I think you want the INCLUDE keyword.
"LOAD" is more complicated and is used to have libraries with multiple sections of code.
Bean
There are not many examples, and the documentation is not to clear.
I am looking to be able to use modular coding, as in multiple source single output.
I have decided to ditch the Spin version all together. So there will just be two versions to begin with, a PropBASIC version and a PASM version.
That will expand on the release of the Prop 2.
David,
Look at the VGA and VGA2 libraries in the OBEX. Search for PropBasic.
You will see that first come all the defines, then there is a compiler directive '{$CODE} then comes the main code with a bunch of '{$IFUSED directives to remove dead code. Then comes the '{$TASKS} directive and any TASKs that are needed for the library.
The libraries in the OBEX have the library code with an extension of .lib, but I've since just used .pbas for the library code too. To make it easier for the IDE. I suggest you do the same.
Thanks for choosing PropBASIC for the 3D printer driver. If you have any questions please feel free to ask.
The libraries actually get processed more than once, the defines are processed at the LOAD command, then AFTER all your main code, the compiler processes each library again but only the lines after '{$CODE}.
Bean
I do not think it will take to long before I post a PropBASIC firmware, I may post it a bit at a time, or may wait till it is usable, undecided.
Though PropBASIC makes the task fairly simple. The built in serial IO simplifies things a lot as well (as 3D printers use serial IO in most cases for G-Code, and mine uses serial for either G-Code or the binary code I developed for it [which has changed radicaly, thanks to PropBASIC and simplifying everything]).
The original firmware supported only G-Code, and PropBASIC does simplify using strings enough that the G-Code part is easy.
You did a very good job with PropBASIC. thank you.
Thanks. You'll probably want to use LMM for the G-Code parser. "PROGRAM label LMM" or "TASK taskname LMM".
I can't wait to see your code.
Bean
@Bean - re the inbuilt SEROUT, what Baudrate has that been tested to ?
I think the inner-most optimized DJNZ loop is good for 4MBd send, (with some extra time between chars ), but I could not decide if the start bit would be the correct width at highest baud rates ?
Simple 'ricegrain' slaves can ~match Prop fSys with a 3.07MBd setting.
( & also ~ 0.5% errors @ 2.051MBd, 1.739MBd, 1.538MBd, 1.355MBd, 1.230MBd .. etc )
I've never timed it, but I regularly use 1MBaud with the FTDI chip. And I'm sure I've used 2MBaud at times.
Bean
I just stumbled acrossed your blog, and noticed the picture. How do you get syntax highlighting for PropBASIC in BST? It would be helpful.
Though I am getting the hang of PropBASIC quite quickly.
That blog is really old. I don't remember doing anything extra special. Maybe it's a configuration setting or something ?
As you are learning PropBASIC and looking at the documentation it would be helpful if you could keep some notes about what needs to be better documented, or added to the existing documentation. Then next time I update the documentation I'll incorporate what notes you have.
Bean
I'm glad to see your PropBASIC is finally getting some attention! Is it pretty much complete or do you have plans to enhance it? What sorts of changes are you planning?
Thanks,
David
In the works to transfer ownership of PropBASIC to Parallax. The language is pretty much complete, but the documentation needs some work. That is what I'll be working on in the near future.
Bean
It's up to Parallax, but I assume it would since it can be compiled for Windows, Linux, and IOS.
Bean
P.S. Source is in Delphi / Lazarus / Free Pascal
Last time I checked, PropBASIC did not have Conditional Compile, is that planned ?
as in - and of course, a PropPASCAL would have immediate appeal, now Lazarus/FPC works well on Pi2
Even nested !!!
Bean
whilst I've not seen any other Basic use the conditional in comments form.
One of the primary areas I use Conditional Defines, is for Code test, often on other hosts, & for that it is important the conditional syntax is portable.
However, the form you have now should port to a Pascal parser very easily
Have you looked at gdb support for PropBASIC, at least in LMM mode ?
From another thread, I've found this out about gdb, which seems to be emerging for the Prop
["The debug code in the propeller is a (PropGCC) kernel extension, so the COG part of it fits in the 256 bytes from 0x6c0 to 0x7c0 (the kernel extension space, into which the kernel loads overlays such as debug, floating point, and integer math). There is a bit of LMM code added as well, but it's merged in to the .hub section so I'm not sure of the exact size.
...
at the moment gdb only works in some LMM derivative form (LMM, CMM, XMM). It relies on changes to the LMM interpreter loop."]
While GDB certainly has its flaws, what on earth do you mean by "requires the cooperation of the program" and "does not have any means to do real debugging"?