Shop OBEX P1 Docs P2 Docs Learn Events
PropBasic - What is the lastest situation please? - Page 2 — Parallax Forums

PropBasic - What is the lastest situation please?

2

Comments

  • BeanBean Posts: 8,129
    edited 2016-01-23 11:58
    Brett,
    Thanks. I'll have to get familiar with github.

    Let me know if there is anything I can do to help get PropBASIC in SimpleIDE.

    P.S. What is the difference between "Pull Request" and "Fork" in Github ?

    Bean
  • I just compiled the PropBasic 1.44 Project from GitHub successfully with Lazarus version 1.4.4 and one of my most complex (and longest) Propbasic programs compiled successfully with the new propbasic .exe - still have to test the program though. I did not change any Project Options in the Lazarus IDE other than the exe output path and the Optimization Level. Watch out for the Debugging Info Option - it must be off otherwise the exe is very big - mine was off by default. For those that want to play, here is the download link: http://www.lazarus-ide.org/

    Have never seen or used Lazarus before this morning so I am no expert, but I made a reference doc for myself for future use after having figured what to do. Doc is attached.

    I am thrilled by the fact that the source code is available because now I can actually see what changes have been made and what Bean is still going to work on - something that has not been freely available over the years.

    But, I think it is an absolute requirement for the executable to be available on GitHub because we cannot expect newbies who are just starting out to go through the source code compiling exercise.
  • Sad news - the program I am testing with my compiled version of propbasic 1.44 does not work. Many things in the program do not work. Don't know if I compiled it incorrectly. Bummer, I was so excited :depressed:

    I think I will wait for Bean to publish the latest exe. Will just stick to 1.42 for now.
  • BeanBean Posts: 8,129
    Yeah, stick with 1.42 for now. That is the most stable, most tested version.

    I will do some testing of 1.44 soon and make any corrections that are needed.

    Bean
  • Cool, thanks, Bean.
  • Now that source is available, I would be happy to add this to my build server. Is it possible to cross-compile this from an Ubuntu 14.04 machine?
  • dgatelydgately Posts: 1,630
    edited 2016-01-23 17:38
    I built 1.44 sources with Lazarus on Mac OS X and was able to compile a very small example program to a PASM .spin file, which I then built with PropellerIDE and loaded onto an Activity Board. It ran the simple blink pin 26 program successfully.

    Not a complete test for sure, but does prove the ability to build with Lazarus and compile a basic source file.

    Thanks Bean, Bob, Andre and David for discussing and making PropBasic source available!

    dgately
  • Hi Brett, Bean,

    Ths is most excellent news. It would be awesome if you could get releases working for propbasic.exe for Windows, and thank you very much for you work in getting something like this of the ground and implemented :-D

    Regards
    Andre

    Ah I'll get something set up maybe this afternoon. It was already late yesterday. I'm glad to help. :P
  • Bean wrote: »
    Brett,
    Thanks. I'll have to get familiar with github.

    Let me know if there is anything I can do to help get PropBASIC in SimpleIDE.

    P.S. What is the difference between "Pull Request" and "Fork" in Github ?

    Bean

    If you meant to say PropellerIDE, you can help by putting together a collection of PropBASIC code to use as demos and maybe some libraries. I haven't seen much PropBASIC code so I really need a better idea what the average project is like.

    Forking a project is cloning the repository to your own account. You then download that version to work on it. After checking in your changes and pushing them back to github, a pull request notifies the original repository that you'd like to merge your changes in, where they can be reviewed and accepted or rejected.

    It's confusing at first but it's actually pretty easy once you do it a couple times.
  • I just compiled the PropBasic 1.44 Project from GitHub successfully with Lazarus version 1.4.4 and one of my most complex (and longest) Propbasic programs compiled successfully with the new propbasic .exe - still have to test the program though. I did not change any Project Options in the Lazarus IDE other than the exe output path and the Optimization Level. Watch out for the Debugging Info Option - it must be off otherwise the exe is very big - mine was off by default. For those that want to play, here is the download link: http://www.lazarus-ide.org/

    Have never seen or used Lazarus before this morning so I am no expert, but I made a reference doc for myself for future use after having figured what to do. Doc is attached.

    I am thrilled by the fact that the source code is available because now I can actually see what changes have been made and what Bean is still going to work on - something that has not been freely available over the years.

    But, I think it is an absolute requirement for the executable to be available on GitHub because we cannot expect newbies who are just starting out to go through the source code compiling exercise.

    I'm happy to hear your excitement. :)

    Relax, guys, I'll set up automated builds this afternoon! :P

  • jmgjmg Posts: 15,173
    edited 2016-01-23 20:28
    Brett Weir wrote: »
    If you meant to say PropellerIDE, you can help by putting together a collection of PropBASIC code to use as demos and maybe some libraries. I haven't seen much PropBASIC code so I really need a better idea what the average project is like.

    Two examples I think is very good for showing what can be done is

    http://forums.parallax.com/discussion/123170/propbasic-reciprocal-frequency-counter-0-5hz-to-40mhz-40mhz-now

    The extension to 0.5Hz allows GPS 1pps to be used to check/calibrate the timebase.
    Reciprocal Frequency Counters give very good resolutions, at all frequencies, but they do need a little more maths, which is what makes it a good example.

    A useful extension to this would be to add a Frequency Generator (PLL Counter mode) that can be used to verify Counter operation without needing an external frequency source.
  • Cluso99Cluso99 Posts: 18,069
    This is great news. Always wanted to see a propeller basic just because a number of users find basic easy to use.
  • Here you go! Automated PropBASIC releases for Windows, Mac, and Linux.

    https://github.com/parallaxinc/PropBASIC/releases/tag/1.44.1
  • Hi Everybody and Brett,

    I have just posted my collection of PropBasic Libraries with sample code here: http://forums.parallax.com/discussion/163372/propbasic-libraries#latest

    Perhaps they can also be loaded on GitHub? I am not sure what the rules and intentions are around what goes on GitHub and what not.

    Cheers
    Andre

    Brett, thanks, I have just downloaded PropBasic 1.44.1 Win32 zip from GitHub ("propbasic" without file extension?). I will test and let everybody know how it goes. Interestingly, the propbasic 1.44.1 exe is quite a bit smaller than 1.42?
  • Nope, propbasic.exe 1.44.1 from GitHub does not work. Same problem as when I compiled the 1.44 source with Lazarus myself - my program compiles fine but it does not work properly. As stated in an earlier post by Bean, he is still testing 1.44.

    Can we perhaps have the latest stable release of PropBasic (which seems to be 1.42) on GitHub? Can you perhaps differentiate between Stable Releases and Untested Releases on GitHub?
  • Possible additional oddball report with the latest compiler (1.44.1 from GitHub)

    with
    DEVICE P8X32A
    or
    DEVICE P8X32A, RCSLOW

    Cannot compile. Always error message:

    _CLKFREQ or _XINFREQ must be specified
  • BeanBean Posts: 8,129
    If you can post a complete (small) program. I will try to see if I can create the errors and fix them.

    Bean
  • sure thing:
    DEVICE P8X32A
    'DEVICE P8X32A, RCSLOW
    
    ' ======================================================================
      PROGRAM Start 
    ' ======================================================================
    
    Start:
    
      DO
      
        PAUSE 60000
        
        LOOP
    
    END
    
    
  • Your test case compiled properly under PropBasic 1.42 and a 1.44 I built from source with Lazarus 1.4.4. However, the generated .spin failed to compile using Homespun 0.31, with Homespun emitting the error message noted above. BSTC and PropTool digested and loaded both .spin files generated by the two PropBasic versions. The 1.42/1.44 .spin files were different - 1.44 automatically creates a Pause subroutine where 1.42 keeps the pause code inline. See attached.
    ''  *** COMPILED WITH PropBasic VERSION 00.01.42  Aug 25, 2013 ***
    
    
    CON                                                          'DEVICE P8X32A
      _ClkMode = RCFAST                                         
    
                                                                 ''DEVICE P8X32A, RCSLOW
    
                                                                 '' ======================================================================
    PUB __Program | __VarsPtr                                    '  PROGRAM Start 
      __VarsPtr := 0                                            
      CogInit(0, @__Init, __VarsPtr)                            
                                                                
    DAT                                                         
                      org           0                           
    __Init                                                      
    __RAM                                                       
                      mov           dira,__InitDirA             
                      mov           outa,__InitOutA             
                      jmp           #Start                      
    
                                                                 '' ======================================================================
    
    Start                                                        'Start:
    
    
    __DO_1                                                       '  DO
    
    
                      mov           __temp2,_60000               '    PAUSE 60000
                      mov           __temp1,_1mSec              
                      add           __temp1,cnt                 
    __L0001                                                     
                      waitcnt       __temp1,_1mSec              
                      djnz          __temp2,#__L0001            
    
    
                      jmp           #__DO_1                      '    LOOP
    __LOOP_1                                                    
    
    
                      mov           __temp1,#0                   'END
                      waitpne       __temp1,__temp1             
    
    '**********************************************************************
    __InitDirA       LONG %00000000_00000000_00000000_00000000
    __InitOutA       LONG %00000000_00000000_00000000_00000000
    _1mSec           LONG 12000
    _60000           LONG 60000
    _FREQ            LONG 12000000
    
    ____STRING_adr   LONG 0
    __clkfreq_adr    LONG 0
    
    __remainder
    __temp1          RES 1
    __temp2          RES 1
    __temp3          RES 1
    __temp4          RES 1
    __temp5          RES 1
    __param1         RES 1
    __param2         RES 1
    __param3         RES 1
    __param4         RES 1
    __paramcnt       RES 1
    
    FIT 492
    
    CON
      LSBFIRST                         = 0
      MSBFIRST                         = 1
      MSBPRE                           = 0
      LSBPRE                           = 1
      MSBPOST                          = 2
      LSBPOST                          = 3
    
    DAT
    __DATASTART
    
    ''  *** COMPILED WITH PropBasic VERSION 00.01.44  Jul 13, 2014 ***
    
    
    CON                                                          'DEVICE P8X32A
      _ClkMode = RCFAST                                         
    
                                                                 ''DEVICE P8X32A, RCSLOW
    
                                                                 '' ======================================================================
    PUB __Program | __VarsPtr                                    '  PROGRAM Start 
      __VarsPtr := 0                                            
      CogInit(0, @__Init, __VarsPtr)                            
                                                                
    DAT                                                         
                      org           0                           
    __Init                                                      
    __RAM                                                       
                      mov           dira,__InitDirA             
                      mov           outa,__InitOutA             
                      jmp           #Start                      
    
                                                                 '' ======================================================================
    
    Start                                                        'Start:
    
    
    __DO_1                                                       '  DO
    
    
                      mov           __temp1,_60000               '    PAUSE 60000
                      call          #_PAUSE                     
    
    
                      jmp           #__DO_1                      '    LOOP
    __LOOP_1                                                    
    
    
                      mov           __temp1,#0                   'END
                      waitpne       __temp1,__temp1             
    
    '-------------------------------------------------------------------------------------------
    'PAUSE SUBROUTINE (pass mSec in _temp1)                     
    ' ------------------------------------------------------------------------------------------
    _PAUSE                                                      
                      shr           __temp1,#0 WZ               
                      mov           __temp2,_1mSec              
                      add           __temp2,cnt                 
    _PAUSE_1                                                    
        IF_NZ         waitcnt       __temp2,_1mSec              
        IF_NZ         djnz          __temp1,#_PAUSE_1           
    _PAUSE_ret                                                  
                      ret                                       
    '**********************************************************************
    __InitDirA       LONG %00000000_00000000_00000000_00000000
    __InitOutA       LONG %00000000_00000000_00000000_00000000
    _1mSec           LONG 12000
    _60000           LONG 60000
    _FREQ            LONG 12000000
    
    ____STRING_adr   LONG 0
    __clkfreq_adr    LONG 0
    
    __remainder
    __temp1          RES 1
    __temp2          RES 1
    __temp3          RES 1
    __temp4          RES 1
    __temp5          RES 1
    __param1         RES 1
    __param2         RES 1
    __param3         RES 1
    __param4         RES 1
    __paramcnt       RES 1
    
    FIT 492
    
    CON
      LSBFIRST                         = 0
      MSBFIRST                         = 1
      MSBPRE                           = 0
      LSBPRE                           = 1
      MSBPOST                          = 2
      LSBPOST                          = 3
    
    DAT
    __DATASTART
    
  • BeanBean Posts: 8,129
    edited 2016-02-02 13:04
    So it appears to be an issue with homespun ?

    You should be able to just add a FREQ line to prevent the error.
    For RCSLOW use FREQ 20_000 and for RCFAST use FREQ 12_000_000.
    Note that the default is RCFAST.

    Bean
  • Another observation is the substantial exe size difference I'm seeing between the Propbasic.exe from github (490,496) and the Propbasic.exe from local compilation (548864) under Win32 Laz 1.4.4/FPC 2.6.4.
    Unsuccessful attempts were made to change compiler options (-O3, -Os, etc..) to try to at least get in the ballpark with replicating the Github compiled exe size. This is more for curiousity's sake than anything else. Any thoughts?
  • BeanBean Posts: 8,129
    pmrobert,
    I get 542K, I'm not sure why the other exe is smaller ? Maybe from an older version of Laz ?
    I don't have the computer that it was compiled on so I'm afraid I don't have an explaination.

    Bean
  • @pmrobert Thanks for the thorough review.

    @Bean FYI- I'm certain I tried manually adding both FREQ and then XIN values (one at a time, then both together "just for fun"). That didn't get me past the error.

    So thanks both for your time on this. I'll try to follow this along with Homespun when time allows. I had tried Propellent on the spin files (that barked), but using PropTool in the meantime is a good enough fix.

    Michael.


  • BeanBean Posts: 8,129
    @VonSzarvas, okay I'll investigate. I just assumed that would work.

    Bean
  • BeanBean Posts: 8,129
    Yes, you are right. FREQ generates a warning and does NOT put in a _XINFreq line.
    I'm not sure why I don't but I purposefully do not.

    If you want to change it, in the "Procedure ProcessFreq" there is a line that reads "If Not g_bInternalClock Then OutSpin(' _XInFreq = '+ sTemp);" just remove the "If Not g_bInternalClock Then" part.

    Bean
  • Thanks, Terry, that works. Homespun compiles the .spin w/o complaint. PropBasic, as expected, gives a "NOT RECOMMENDED" warning. I think the base problem is with Homespun as alluded to above but this is a viable workaround.

    -Mike
          // PMR: Removed Conditional per Bean's advice so as to remove
          //      incompatibility w/ HomeSpun.
          // Reference thread: http://forums.parallax.com/discussion/156252/propbasic-what-is-the-lastest-situation-please/p2
          // Original code: If Not g_bInternalClock Then OutSpin('  _XInFreq = '+ sTemp);
          OutSpin('  _XInFreq = '+ sTemp);                             
    
  • Fabulous! Thanks again guys.

    Another fine example of why PropBasic should be fully integrated.

    The dedication and support from Bean and the community is first class.
  • I am trying to learn Propbasic.

    I've downloaded v1.42 along with Brad's programs, and figured out how to get it to work from either the cmd line and BST or with with Simple IDE (after following the instructions, I needed to make a Propbasic .SIDE project with "empty.pbas" that I use to copy or enter .pbas code into.)

    I've read the manual and Jon's Spin Zone article and wrote a few "blink the LEDs" programs. I used Jon's Spin Zone program that uses input from the terminal (used "run with terminal" in Simple IDE) to turn LEDs on and off, but I can't figure out how to print to a terminal.

    Is there an existing function or task that can be posted to print text and/or numbers to a terminal?

    I appreciate your help.
    Tom
  • Tom,

    You want to use the SEROUT command, and build that into a string output function. The STR function is used to convert numbers into string form for printing to the serial port.

    Jon also wrote several libraries, including serial I/O. I don't remember if they're in the OBEX, but here's a link to a forum posting where he included them. http://forums.parallax.com/discussion/160865/propbasic-library-examples

    Recently Andre Nieuwoudt also posted a number of PropBasic libraries. http://forums.parallax.com/discussion/163372/propbasic-libraries

    There should be something in one of those offerings to get you going.

    Bob
  • Thanks, those will help.

    Tom
Sign In or Register to comment.