Shop OBEX P1 Docs P2 Docs Learn Events
PropBasic: How to use PropBasic in SimpleIDE !!! — Parallax Forums

PropBasic: How to use PropBasic in SimpleIDE !!!

BeanBean Posts: 8,129
edited 2014-12-08 07:51 in Propeller 1
NOTE: These file will NOT work with BST. I'm sorry...

Jazzed has been kind enough to create a batch file that will allow you to use PropBasic from his SimpleIDE GUI.

Here is how to do it step by step for Windows...

Download the PropBasic_1_42_PC.zip file and extract the files. Put the files into the C:\Program Files (x86)\SimpleIDE\Propeller-gcc\bin directory.

Start SimpleIDE

From the menu choose: "tools" then "Properties"

Click on the "Spin Folders" tab at the top of the dialog box.

Change the "Spin Compiler" setting from "bstc.exe" to "propbasic.bat", then click the "OK" button to close the dialog box.



You are now ready to load a PropBasic file.

From the menu choose: "Project" then "Close Project" (this will close any open project, so we can start fresh).

From the menu choose: "File" then "Open"

Change the "Source Files" selection to "Any (*)"

Find and load your .pbas file.

From the menu choose "Project" then "Set Project". (Or press F4 or click on the gear icon)

In the "Project Option" window (lower right of screen), change "Compiler Type" to "SPIN".

You are now ready to compile your PropBasic file. You can use the "Build" (Hammer), Load RAM and Run (white arrow pointing right with green background) or Load EEPROM (white arrow pointing down with green background).
Or even Run with Terminal (screen icon with white arrow pointing right).

I am very excited about this new development with SimpleIDE.

If anyone needs any help getting this going, just let me know.

Bean

8/16/2013 I changed the .bat file so the IDE stops if an error occurs. It still doesn't highlight the error, but at least it stops and doesn't load the last build.

8/26/2013 I have updated the files to version 1.42 and included the Linux and OSX builds (thanks to David Betz)
«134

Comments

  • jazzedjazzed Posts: 11,803
    edited 2013-08-15 19:44
    Bean, I've verified the following works. That is, errors will not allow propeller-load to start.

    Some errors don't get printed for some reason.
    @rem Parameter %4 is the program assuming SimpleIDE does this or equivalent:
    @rem propbasic.bat -b -L C:/propgcc/spin/ VGA_demo1.pbas
    @rem
    
    
    :startshift
        @if '%1%' == '' (
            @goto endshift
        )
        @set PARM=%1
        @rem echo %PARM%
        @shift
    @goto startshift
    :endshift
    
    
    @echo Building %PARM%
    
    
    @propbasic .\%PARM% /B
    @if not errorlevel 1 (
        @set %PARM%=%PARM%.spin
        @bstc -b .\%PARM%
        if not errorlevel 1 (
            @exit 0
        ) else (
            @exit 1
        )
    ) else (
        @exit 1
    )
    @exit 0
    
  • NWCCTVNWCCTV Posts: 3,629
    edited 2013-08-15 20:59
    I followed instructions. After closing the Project when I go to File on the menu there is no Open option.
  • Ken GraceyKen Gracey Posts: 7,386
    edited 2013-08-15 21:11
    Excellent, Terry. Now I've got something to look at for a 15-hour plane flight!

    Last time we got into BASIC compilers we started quite the project with SX/B.....add a little JonnyMac to this concoction, a tad of Jazzed, a bit of interest and it'll grow organically pretty quick. Seen it happen before!

    Ken Gracey
  • dgatelydgately Posts: 1,621
    edited 2013-08-15 23:12
    Whoops, I should have put my PropBasic within SimpleIDE on Mac OS X script solution here...

    Sorry to have Hijacked the PropBasic Studio thread.

    Here's my attempt:
    http://forums.parallax.com/showthread.php/148214-PropBasic-Studio-Coming-Soon?p=1201361#post1201361


    dgately
  • jazzedjazzed Posts: 11,803
    edited 2013-08-16 00:46
    NWCCTV wrote: »
    I followed instructions. After closing the Project when I go to File on the menu there is no Open option.

    You must be in simple view. Use Tools -> Set Project View, and you'll see more file commands.

    Dennis,

    I looked at how to split the filename for several hours in Windows (.bat is too easy to be useful LOL).

    There is a shift bash shell? Thanks for showing that.
  • dgatelydgately Posts: 1,621
    edited 2013-08-16 02:49
    jazzed wrote: »

    I looked at how to split the filename for several hours in Windows (.bat is too easy to be useful LOL).

    There is a shift bash shell? Thanks for showing that.

    Yes, shift would have worked as well, but I wanted to parse-out the filename without the .pbas extension for later use with the .spin extension. Found that code on the internet and used it as a shortcut to getting the code to work.

    dgately
  • RsadeikaRsadeika Posts: 3,822
    edited 2013-08-16 03:51
    I just tried the PropBasic installation, PropBasic works with SimpleIDE. One note of caution, you must make sure that the 'Compiler Type' is set to 'SPIN'. I am guessing that in a later edition of SimpleIDE, PropBasic will be added as a 'Compiler Type'.

    I used the dgately .pbas example program with my PropBoe board, changing the line to 'LEDs PIN 27..26 LOW', the program runs as expected.

    The program name that I used is test1.pbas, I just noticed that in the project manager the file name that is shown is 'test1.pbas.c', in my directory listing I have:
    lmm file folder
    test1.pbas.binary BINARY file
    test1.pbas C file
    test1.pbas SimpleIDE Aplication
    test1.pbas Spin file
    I am thinking that this might lead to some confusion as to what file gets used and when.

    I guess, now the question is, where will PropBasic end up, with SimpleIDE or the 'Propeller Tool-like' Spin IDE?

    Ray
  • David BetzDavid Betz Posts: 14,511
    edited 2013-08-16 06:06
    Ken Gracey wrote: »
    Excellent, Terry. Now I've got something to look at for a 15-hour plane flight!
    Do you get funny looks on the plane when you plug your QuickStart or Propeller Activity Board into your laptop? :-)
  • JonnyMacJonnyMac Posts: 8,912
    edited 2013-08-16 08:29
    Do you get funny looks on the plane when you plug your QuickStart or Propeller Activity Board into your laptop? :-)

    About a month ago I was waiting on a PCB for a new product, and really wanted to work on the code with some hardware; I was able to put the core and user interface elements onto a PPDB. Then I decided a change of venue (out of the home office that is) would be helpful, so I took everything to a local Starbucks. I live in the neighborhood so people know me, but I did get a lot of funny looks with all the wires and blinking lights. It was kind of nice, though; nobody wanted to sit near me which helped with the noise.

    I found it humorous that mine was the only laptop in that Starbucks NOT running FinalDraft (screenwriting software)!

    As with many, I am very appreciative ot Steve's work on SimpleIDE. The plague called the Arduino has only spread because of the availability of a cross-platform IDE. With a wonderful cross-platform tool like SimpleIDE, and a choice of language tools -- now expanding, there is no reason why the Propeller cannot reclaim it's rightful market position amongst electronics enthusiasts.

    Follow-up: I haven't used PropBASIC in a long time but decided to install it to help my customers that prefer BASIC or are transitioning from the BASIC Stamp. I have a little test program that I've used before that seems to compile, but when I try to run it I get a loader error.
    1024 x 640 - 70K
  • doggiedocdoggiedoc Posts: 2,239
    edited 2013-08-16 09:10
    This may be the spur I need to try PropBasic! Good to hear Bean!

    Doc
  • jazzedjazzed Posts: 11,803
    edited 2013-08-16 09:30
    JonnyMac wrote: »
    Follow-up: I haven't used PropBASIC in a long time but decided to install it to help my customers that prefer BASIC or are transitioning from the BASIC Stamp. I have a little test program that I've used before that seems to compile, but when I try to run it I get a loader error.

    Would like to test this. Got Source?
  • JonnyMacJonnyMac Posts: 8,912
    edited 2013-08-16 10:38
    Got Source?

    Yes, sir!
  • BeanBean Posts: 8,129
    edited 2013-08-16 10:46
    Ken Gracey wrote: »
    Excellent, Terry. Now I've got something to look at for a 15-hour plane flight!

    Last time we got into BASIC compilers we started quite the project with SX/B.....add a little JonnyMac to this concoction, a tad of Jazzed, a bit of interest and it'll grow organically pretty quick. Seen it happen before!

    Ken Gracey

    Thanks Ken.
    I can only hope.
    Fingers crossed...

    Bean
  • jazzedjazzed Posts: 11,803
    edited 2013-08-16 11:00
    JonnyMac wrote: »
    Yes, sir!
    Seems to build and load for me with the attached propbasic.bat (zipped).
    The small program size is rather curious though ... 236 bytes of PASM ?
  • jazzedjazzed Posts: 11,803
    edited 2013-08-16 11:10
    Ray, at the moment we have to change the file type in the save dialog to "any".
    Rsadeika wrote: »
    I guess, now the question is, where will PropBasic end up, with SimpleIDE or the 'Propeller Tool-like' Spin IDE?

    Ray

    Very good question! At the moment I'm considering minimal PropBasic changes in the current IDE.
    A "Propeller-IDE" would probably be the best place for more propeller programming languages.
  • BeanBean Posts: 8,129
    edited 2013-08-16 11:29
    I changed the .bat file that is included in the .zip file in the first post of this thread.
    SimpleIDE will now not try to load the program if a PropBasic error occurs.

    Jazzed, How do I need to format the .err file so SimpleIDE can locate the error in the source file ?

    Bean
  • BeanBean Posts: 8,129
    edited 2013-08-16 11:32
    jazzed wrote: »
    Seems to build and load for me with the attached propbasic.bat (zipped).
    The small program size is rather curious though ... 236 bytes of PASM ?

    Jazzed, Yes the 236 instructions is correct.
    PropBasic generates really small PASM code, and it's fast because it's a single-pass compiler.

    Bean
  • jazzedjazzed Posts: 11,803
    edited 2013-08-16 11:38
    Bean wrote: »
    Jazzed, Yes the 236 instructions is correct.
    PropBasic generates really small PASM code, and it's fast because it's a single-pass compiler.

    Bean

    So it's 236 longs? My experience with BSTC is that it reports bytes even though it says longs.
  • BeanBean Posts: 8,129
    edited 2013-08-16 11:41
    jazzed wrote: »
    So it's 236 longs? My experience with BSTC is that it reports bytes even though it says longs.
    Oh yeah, I think you are right. I remember that being the case before. 59 Instructions sounds a lot closer.

    Bean
  • RsadeikaRsadeika Posts: 3,822
    edited 2013-08-16 12:35
    @Bean, now that PropBasic is more accessible, hopefully you will have some of the latest Docs available for download? Still not sure what version of PropBasic you are at, and if you have some Docs that cover the latest version.

    Ray
  • jmgjmg Posts: 15,140
    edited 2013-08-16 15:04
    jazzed wrote: »
    I looked at how to split the filename for several hours in Windows (.bat is too easy to be useful LOL).

    Did you mean like this ? - a little buried, but once you know what to look for, this is useful in re-packaging parameters.

    http://en.wikibooks.org/wiki/Windows_Batch_Scripting#Percent_tilde
  • jmgjmg Posts: 15,140
    edited 2013-08-16 15:12
    Bean wrote: »
    Jazzed, How do I need to format the .err file so SimpleIDE can locate the error in the source file ?

    Not all IDEs expect to read an err file, so there is this info, if you want to work via captured output in the meantime.

    http://forums.parallax.com/showthread.php/148214-PropBasic-Studio-Coming-Soon?p=1201119&viewfull=1#post1201119
  • Cluso99Cluso99 Posts: 18,066
    edited 2013-08-16 15:39
    I have long wanted a usable BASIC for the prop and have seen it as an enabler in the hobby fraternity. I totally agree Ken - it could well happen again.

    The real enabler as I see it is with a simple and standard IDE across platforms and languages. SimpleIDE seems to be the right product at last to fill this bill. It is quite a while since I looked - I am just waiting for the SimpleIDE release using Roy's new compiler and I can switch over.

    I do understand why everyone wants C, and I totally agree it is a necessary evil, but there are far easier ways (for hobbyists) if you can mix BASIC and pasm, and even SPIN. And we can include C and even Forth into the mix as well.

    It is really a shame it has taken soooo long to get here, but now we are on the cusp. Thanks Steve & co.
    Ken Gracey wrote: »
    Excellent, Terry. Now I've got something to look at for a 15-hour plane flight!

    Last time we got into BASIC compilers we started quite the project with SX/B.....add a little JonnyMac to this concoction, a tad of Jazzed, a bit of interest and it'll grow organically pretty quick. Seen it happen before!

    Ken Gracey
  • dgatelydgately Posts: 1,621
    edited 2013-08-16 15:56
    JonnyMac wrote: »
    Yes, sir!

    Built, uploaded and runs on my QuickStart, from SimpleIDE on Mac OS X.
    Project Directory: /Users/myHome/Downloads/
    
    propbasic2spin.sh -b -L /Users/myHome/ParallaxCode/SpinObjects/ chaser.pbas
    Compiling chaser.pbas to chaser.spin
    PropBasic Version 00.01.14 July 26, 2011
    Modified by Brad Campbell. Do not bother author about non-compiler related bugs, they are my fault (proptools@fnarfbargle.com)
    Finished Compile. 119 Lines Read, 119 Lines Generated,  0 Warnings, 0 Errors.
    Successfully created chaser.spin
    Propeller Spin/PASM Compiler (c)2012 Parallax Inc. DBA Parallax Semiconductor.
    Compiled on Apr  9 2013
    Compiling chaser.spin...
    Done.
    Program size is 240 bytes
    propeller-load -Dreset=dtr -r chaser.binary -p /dev/cu.usbserial-A1013PDNPropeller Version 1 on /dev/cu.usbserial-A1013PDN
    Loading chaser.binary to hub memory
    228 bytes sent
    
    Verifying RAM ... 
    OK
    
    dgately
  • dgatelydgately Posts: 1,621
    edited 2013-08-16 15:59
    Bean,

    I had asked in a prior post, but it was probably missed. How can I get the latest PropBasic for Mac OS X (1.40?). Right now, the latest version from BST's website is 1.14.


    Thanks,
    dgately
  • jazzedjazzed Posts: 11,803
    edited 2013-08-16 17:56
    jmg wrote: »
    Did you mean like this ? - a little buried, but once you know what to look for, this is useful in re-packaging parameters.

    http://en.wikibooks.org/wiki/Windows_Batch_Scripting#Percent_tilde
    That helps a lot. Thanks.
  • BeanBean Posts: 8,129
    edited 2013-08-16 19:11
    I'm afraid I don't have a Mac.

    Is there anyone that can compile a program with Lazarus for Mac ?

    We will also need someone to compile it for Linux too ?

    How about it ? Can anyone help out here for the good of PropBasic ?

    Thanks,

    Bean
    dgately wrote: »
    Bean,

    I had asked in a prior post, but it was probably missed. How can I get the latest PropBasic for Mac OS X (1.40?). Right now, the latest version from BST's website is 1.14.


    Thanks,
    dgately
  • David BetzDavid Betz Posts: 14,511
    edited 2013-08-16 19:17
    Bean wrote: »
    I'm afraid I don't have a Mac.

    Is there anyone that can compile a program with Lazarus for Mac ?

    We will also need someone to compile it for Linux too ?

    How about it ? Can anyone help out here for the good of PropBasic ?

    Thanks,

    Bean
    I guess I could try compiling with Lazarus. Where do I get the PropBasic sources?
  • BeanBean Posts: 8,129
    edited 2013-08-16 19:20
    David Betz wrote: »
    I guess I could try compiling with Lazarus. Where do I get the PropBasic sources?

    Thank you David, I currently use Delphi. So I'll have to get up-and-running with Lazarus and make sure I can compile cleanly with it.
    Then I will send you the source files. Give me a couple days to test everything out, I don't want to waste your time.

    Bean
  • David BetzDavid Betz Posts: 14,511
    edited 2013-08-16 19:31
    Bean wrote: »
    Thank you David, I currently use Delphi. So I'll have to get up-and-running with Lazarus and make sure I can compile cleanly with it.
    Then I will send you the source files. Give me a couple days to test everything out, I don't want to waste your time.

    Bean
    I just installed Lazarus so I'm ready when you are! :-)
Sign In or Register to comment.