Shop OBEX P1 Docs P2 Docs Learn Events
Download PropBASIC here... 00.01.14 LAST VERSION FOR BST - Page 24 — Parallax Forums

Download PropBASIC here... 00.01.14 LAST VERSION FOR BST

1212224262729

Comments

  • VonSzarvasVonSzarvas Posts: 3,469
    edited 2011-04-22 01:16
    maybe another "something" for which I ask some help to clarify...

    I noticed in some PASM examples the use of "local" labels, such as
    :loop
    

    In a PropBasic compiled program, there appears to be a different format
    __L0001
    

    Is it possible that ":loop" would not be valid for code executed within ASM / ENDASM tags ?

    I read in the PropBasic manual that "loop:" would not be valid, but I could not see mention of ":loop"
  • VonSzarvasVonSzarvas Posts: 3,469
    edited 2011-04-22 02:19
    Is it possible that ":loop" would not be valid for code executed within ASM / ENDASM tags ?

    Answered this one myself having managed to flash an led a few times with PASM !!
    ":loop" seems perfectly acceptable
  • VonSzarvasVonSzarvas Posts: 3,469
    edited 2011-04-22 10:55
    This is probably a feature request- or at least an advice request- for Bean !

    In another thread http://forums.parallax.com/showthread.php?131133-PropBasic-Launch-program-in-ram&p=993959&viewfull=1#post993959 I discovered that a solution was to set the clock speed within the cog/task init method. However, as that is auto-generated by the compiler, I am not sure that it can be overridden?
    PUB Init(pv_DataStart)      
      clkset(0,12000000)    ' Added command                              
      Return ((pv_DataStart >> 2) << 18) + ((@__INIT >> 2) << 4)
    

    There might be other solutions, so with your PropBasic expertise, could you think of any work around?

    Or else, do you think it might be reasonable/possible to have an option added to the COGINIT command to allow selection of the clk speed ?

    Example:
    COGINIT MyTask,0,12000000
    

    Thanks Bean.
  • VonSzarvasVonSzarvas Posts: 3,469
    edited 2011-04-22 11:34
    Hi Bean,

    I could solve the clkset thing (you can see at the other thread).. so probably no need for the COGINIT option; unless you feel that would be a useful feature!!

    The issue seems to be the order in which PropBasic appends the "long" and "res" defines to the end of the .spin file.

    My understanding (from the prop manual) is that the long's should be defined before the res's, otherwise the contents cannot be guaranteed.

    I think this is what happens, which you can see clearly in this code snippet generated by the bst/propbasic compiler.

    If I move the longs before the res, the problem goes away, and I do not need to set the dira and outa at the start of the task. It seems the "__InitDirA" and "__InitOutA" are in the 'wrong' place.

    I hope it makes sense... here is the snippet!
    delayforflash           long    20 * 20000 / 4 * 10     '? ms flash delay
    delayforspeedchange     long    20 * 20000 / 4 * 100                                                                  
    clkmode12               long    %0000_0000                  
    clkfreq12               long    12_000_000                  
                                                                
    command                 res     1                           
    address                 res     1                           
    count                   res     1                           
    bits                    res     1                           
    eedata                  res     1                           
    low_byte                res     1                           
    high_byte               res     1                           
                                                               
                      '             ENDASM                       'ENDASM
    
    
              mov           __temp1,#0                   'ENDTASK
                      waitpne       __temp1,__temp1             
    '**********************************************************************
    __InitDirA       LONG %00000000_00000000_00000000_00000000
    __InitOutA       LONG %00000000_00000000_00000000_00000000
    
    
    __remainder
    __temp1          RES 1
    __temp2          RES 1
    __temp3          RES 1
    

    Regards, Max.
  • BeanBean Posts: 8,129
    edited 2011-04-22 13:33
    Yeah, Don't use "RES" in the ASM...ENDASM blocks. Just define them as "LONG 0".

    Bean
  • VonSzarvasVonSzarvas Posts: 3,469
    edited 2011-04-24 12:30
    Bean wrote: »
    Yeah, Don't use "RES" in the ASM...ENDASM blocks. Just define them as "LONG 0".

    Bean

    Simple and Brilliant !

    Thank you Bean.
  • Alex41Alex41 Posts: 112
    edited 2011-05-07 14:26
    Trying to install PropBasic....

    I got my feet wet with PBasic on the SX and love it. I've been trying Spin now on the propeller and its kinda driving me nuts so I thought I'd go back to something I'm more familiar with.

    I have a MacBook Pro running OSX 10.5.8 and have programmed the propeller fine with Brad's Spin Tool. I try to add PropBasic as stated in the directions in this thread.

    "Run the bst file. When it launches, from the menu choose:
    Tools->IDE Preferences->PropBASIC click Browse and find the PropBASIC-BST file that you just extracted."

    I do this, I select the file, but then nothing happens. It is in the same folder if that makes any difference.

    the full file name is "PropBasic-bst.osx"

    Any ideas?

    Alex
  • EaglemanEagleman Posts: 31
    edited 2011-05-11 17:14
    Bean,
    I'm working on a cheap hobbyist CNC prototype using PropBasic for control and input/output using Rayman's 4.3" TFT screens. As of right now, I'm still working with a modified version of your VGA_demo4 and your demo VGA.lib outputing to a straight VGA screen. Currently, I'm going crazy trying to modify VGA.lib to include a new subroutine (SUB VGA_Num based on SUB VGA_Char) to convert the contents of variables to a string printable to the VGA screen. I'm wondering if there are any more PropBasic libraries or code snippets available that may be helpful in my quest. I am trying to go through all of the postings and replys on the forum, but it is a gigantic task. Any insight would be appreciated.
  • BeanBean Posts: 8,129
    edited 2011-05-11 17:27
    Eagleman,
    Sounds like the STR function is what you're after.

    Bean
  • EaglemanEagleman Posts: 31
    edited 2011-05-11 19:39
    Bean,
    Thanks for your input. I never thought of using str because I wasn't totally clear of the command. The manual only says:

    STR ArrayName, Variable, Digits

    I tried it as I understand the commands:

    X_to var long
    str_X var long

    X_to = 501 ' next X position
    str str_X, X_to, 6

    with each line in the proper block. I get the following error:
    ERR : UNKNOWN COMMAND "str"

    Is the STR command working and am I just using it wrong? I only need the 6 lsb of the X_to value.
  • VonSzarvasVonSzarvas Posts: 3,469
    edited 2011-05-11 23:01
    Eagleman, check post #422 in this thread. There was a change to the STR function that might not have been updated in the manual

    http://forums.parallax.com/showthread.php?118611-Download-PropBASIC-here...-00.01.08&p=904819&viewfull=1#post904819
  • EaglemanEagleman Posts: 31
    edited 2011-05-12 05:04
    Thanks, Maxwin. It seems that I've been using the PropBasic Syntax Guide instead of the PropBasic.pdf as my guide. Plus, I've been using old copies that I thought were thrown away. I've changed my code to use the STR function, but still have a compiler error.

    the code is:
    X_to VAR long
    Y_to var long
    Z_to var long
    XY_func var long
    XY_speed var long
    dat_line var long
    i var long
    str_X var long
    str_Y var long
    str_Z var long

    ' Start of main code
    PROGRAM Start

    Start:
    value = 201
    dat_line = 50
    X_to = 501 ' next X position
    Y_to = 235 ' next Y position
    Z_to = 1 ' next Z position
    XY_func = 1 ' type of next move
    XY_speed = 25 ' XY speed of next move

    ' Draw text
    VGA_PrintAt 5, 2, "CE LABS CNC CONTROLLER rev 0.0a"
    VGA_PrintAt 0, 24, " LINE X Y Z FUNC SPEED"
    VGA_SetPos 16 , 40
    VGA_char 48
    VGA_char 49
    VGA_char dat_line
    VGA_SetPos 32, 40

    str_X = X_to, 6, 7
    str_Y = Y_to, 6, 7
    str_Z = Z_to, 6, 7

    VGA_printAt str_X, 2, 56
    VGA_PrintAt str_Y, 12, 56
    VGA_PrintAt str_Z, 22, 56

    the error is ERROR : INVALID NUMBER OF PARAMETERS

    What stupid thing am I doing wrong? Is the variable "str_X" improperly defined?
    Also, should I throw the Syntax Guide away? It looks like it is obsolete.

    Thanks very much for your help.
  • BeanBean Posts: 8,129
    edited 2011-05-12 05:15
    I assume you want to print the value of variables X_to, Y_to and Z_to ???

    Not sure what you are trying to do with "str_X = X_to, 6, 7" ??? Do you want "str_X = STR X_to, 6, 7" ??? If so you need str_X to be a string variable not a long. Also you would need to change "VGA_printAt str_X, 2, 56" to "VGA_printAt 2, 56, str_X".

    To make str_X a string variable define it as "str_X HUB STRING(20)" change 20 to whatever the maximum length of the string will be.

    I hope this helps,

    Bean
  • EaglemanEagleman Posts: 31
    edited 2011-05-12 06:29
    Bean and Maxwin,

    Thanks for your help. It now works as expected and I can proceed to the next step. Later on, when I try to switch from VGA to Rayman's TFT screen it should be great fun trying to get that working.

    Bean, is the PropBasic Syntax guide obsolete and should I get rid of it to avoid confusion like what I just went through?

    eagleman
  • Alex41Alex41 Posts: 112
    edited 2011-05-13 04:14
    Got it working. Same thing I did earlier and now it works. Happy to do this on my Mac and not on Windoze...


    Alex41 wrote: »
    Trying to install PropBasic....

    I got my feet wet with PBasic on the SX and love it. I've been trying Spin now on the propeller and its kinda driving me nuts so I thought I'd go back to something I'm more familiar with.

    I have a MacBook Pro running OSX 10.5.8 and have programmed the propeller fine with Brad's Spin Tool. I try to add PropBasic as stated in the directions in this thread.

    "Run the bst file. When it launches, from the menu choose:
    Tools->IDE Preferences->PropBASIC click Browse and find the PropBASIC-BST file that you just extracted."

    I do this, I select the file, but then nothing happens. It is in the same folder if that makes any difference.

    the full file name is "PropBasic-bst.osx"

    Any ideas?

    Alex
  • VonSzarvasVonSzarvas Posts: 3,469
    edited 2011-05-13 08:56
    Well done Alex41!

    My "Macless" life meant I could not offer help with your install problem, but I am really glad you managed to solve it. I wish you great fun and success with the Propeller and PropBASIC !!

    Max.
  • Alex41Alex41 Posts: 112
    edited 2011-05-16 13:29
    Maxwin wrote: »
    Well done Alex41!

    My "Macless" life meant I could not offer help with your install problem, but I am really glad you managed to solve it. I wish you great fun and success with the Propeller and PropBASIC !!

    Max.

    Thanks Max, this is an eternal learning process and I'm having lots of fun along the way.

    Alex
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-05-16 20:39
    Bean:
    Are you still developing PropBASIC? I can not help but notice that the last update to the top post was from 2010. I use PropBASIC quite a bit and do hope that it is still being developed by you.
  • amveronisamveronis Posts: 21
    edited 2011-06-02 09:51
    Fellow propellers

    I am new to the device. I prefer Propbasic to sping. I downloaded both bst and propbasic, created the path to PropBasic from the BST IDE, but every time I tried to compile a program, I get a Compile Error. Also, in the event that I pass the error, how do I run a program. I don't see any Run button.

    Thanks for any help

    Andrew
  • BeanBean Posts: 8,129
    edited 2011-06-02 10:04
    David,
    I can't get in contact with BradC anymore. I've send a couple updates, but I've not heard anything back. Because he modifies my source files to work with BST I cannot release updates without his conversion applied.

    Andrew,
    You probably have an error in your code. Please post your code and I'll take a look at it.
    To run you use F10(Compile and load Ram) or F11(Compile and load EEPROM).

    Bean
  • amveronisamveronis Posts: 21
    edited 2011-06-02 11:35
    Bean

    I tried several example programs, and they all gave me a compile error. For example, there is the RANDOM example code on Page 69 of the PropBasic Syntax manual. It gave me an error. I typed exactly as shown.

    Andrew
  • BeanBean Posts: 8,129
    edited 2011-06-02 12:47
    Here is the simplest PropBasic program. See if it compiles okay.
    DEVICE P8X32A
    
    PROGRAM Start
    
    Start:
    END
    

    Bean
  • RsadeikaRsadeika Posts: 3,837
    edited 2011-06-02 13:35
    So, Bean, what is the future of PropBASIC?

    Ray
  • BradCBradC Posts: 2,601
    edited 2011-06-02 19:11
    I've just found an E-mail from Bean with 00.01.10, so I've compiled and uploaded this.

    Aside my other issues, my lack of responsiveness on this has not been fair to Bean at all. He does very good work and is great at fixing issues in a timely fashion. I'll try to get off my backside and keep things moving.
  • BeanBean Posts: 8,129
    edited 2011-06-02 19:55
    Brad,
    No hard feelings at all. Glad to see you back. I'm not giving up on PropBasic at all.
    Is there any way for me to create at least the windows version for BST ? It's alot easier to test a change from within BST.

    Bean
  • BeanBean Posts: 8,129
    edited 2011-06-07 09:51
    I just created a PropBasic wikipedia article.
    I'm not familiar with how wikipedia works so I would like to invite others to add to it.

    Thanks,

    Bean

    http://en.wikipedia.org/wiki/PropBasic

    [edit] Link added
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-06-07 09:55
    Bean,

    Got a link?

    OBC
  • BeanBean Posts: 8,129
    edited 2011-06-07 09:58
    Jeff,
    Yeah, sorry about that. I have added the link to my post above.

    Bean
  • SapiehaSapieha Posts: 2,964
    edited 2011-06-07 10:08
    Hi Bean.

    Have You made new PDF on statements/commands usage.

    As some old pbas will not compile in 1.10
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-06-07 10:44
    Bean:
    Your article is marked for deletion on wikipedia. I saw this when I went to look at it, you may wish to expand the article, and contest the deletion before they do this.
Sign In or Register to comment.