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

Download PropBASIC here... 00.01.14 LAST VERSION FOR BST

1101113151629

Comments

  • BeanBean Posts: 8,129
    edited 2010-04-09 01:30
    Version 00.00.90 is now available for download.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
  • BeanBean Posts: 8,129
    edited 2010-04-09 17:59
    I realized that there is no way to make a subroutine that prints a string.

    What would be nice is if you could pass a string to a subroutine that would output the string. However, when you pass a string it is passed as a VAR LONG that contains the hub address of the string. And SEROUT will try to send that as the value.

    So I'm looking for suggestions on how to implement this. Here are some ideas:

    SEROUTSTR pin,baud,value ' A new command SEROUTSTR

    SEROUT pin,baud, STRPTR value ' A prefix word before the value

    SEROUT pin,baud,[noparse][[/noparse]value] ' Enclose value in square brackets

    I'd like to hear your ideas.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
  • Christof Eb.Christof Eb. Posts: 1,106
    edited 2010-04-09 18:03
    Hi Bean,

    could you please have a look at this:

    My routine SFast for a faster shiftout (for 74HC595) does not work,

    .. can this ever be nz?

    ················· test········· __param1,#0·················· '····· SerData= __param1
    ················· muxnz········ outa,SerData

    This is compiled from the line 147 of the pbas-file.

    Should this be?

    test········· __param1,#1 wz·················· '····· SerData= __param1

    Christof
  • BeanBean Posts: 8,129
    edited 2010-04-09 18:14
    Hmmm, I see what you mean.
    Using #1 won't work because the pin should be high with any non-zero value in the variable.

    I think the "test" should be "cmp".
    Can you change it in the .spin file and let me know if that works ?

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
  • Mike GreenMike Green Posts: 23,101
    edited 2010-04-09 18:27
    Re: Outputting a string given a string address

    I like using a prefix. I would prefer using a punctuation character as a prefix rather than something like STRPTR just for ease of use, kind of like the inverse of "@". "[noparse]/noparse" is already used in PBasic with a completely different meaning, so I think it would be better to stay away from that. Having a different statement is also possible, but would preclude possibly extending the SEROUT statement in the future to multiple parameters.
  • BeanBean Posts: 8,129
    edited 2010-04-09 18:38
    @Christof, I see what you are trying to do. I'll get the "speed" parameter of SHIFTOUT working. Then you can just specify what speed you want SHIFTOUT to operate at.

    The next release will support something like:
    SHIFTOUT pin1, pin2, LSBFIRST, datavalue, 5
    The ",5" means to send the bits 5 times faster than normal.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
  • BeanBean Posts: 8,129
    edited 2010-04-09 19:44
    @Mike, As a take on the "SHIFTOUT value\bits" format, how about "SEROUT pin,baud,value\STR" ?

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
  • Christof Eb.Christof Eb. Posts: 1,106
    edited 2010-04-09 19:50
    OK Bean , thanks for looking.

    If the port shall be 1 on everything not zero:
    ...
    do
    __param3 = __param1 & 1

    \ cmp __param3,#0 wz ' SerData= __param3
    \ muxnz outa,SerData
    __param1= __param1 >> 1
    pauseus 1
    SClk = 1
    pauseus 1
    SClk = 0
    loop __param2

    This works.
    Christof
  • Christof Eb.Christof Eb. Posts: 1,106
    edited 2010-04-10 07:24
    Hi Bean,
    I hope, it is helpful and OK, if I send you my discoveries what seem to me "beta version features" here.

    There is a difference between non-LMM and LMM, when I run my simple sceduler.
    I·think for the·ON .... GOSUB construct,·LMM is not adapted yet?

    Because of the impressive speed of PropBasic I want to use it for SubTasks within tasks.

    Best regards
    Christof
  • Gerry KeelyGerry Keely Posts: 75
    edited 2010-04-10 13:43
    Hi

    If you declare a hub or cog variable as long you can assign it the max. 32 bit value using hex or binary notation but not decimal

    ie

    myvar = $FF_FF_FF_FF or

    myvar = %1111_1111_1111_1111_1111_1111_1111_1111

    works but

    myvar = 4294967295· does not.

    Gerry
  • BeanBean Posts: 8,129
    edited 2010-04-10 20:47
    @Christof, I'll check into that and get it fixed for the next release.

    @Gerry, Are you using the latest version of PropBASIC ? It seems to work for me. I think that was a problem in a previous version.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
  • simonlsimonl Posts: 866
    edited 2010-04-10 23:38
    There seems to be a problem with the download site (http://www.fnarfbargle.com/PropBasic/) today - I've been trying since a couple of hours ago :-(

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,
    Simon

    www.norfolkhelicopterclub.com

    Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
  • Gerry KeelyGerry Keely Posts: 75
    edited 2010-04-11 00:00
    Bean
    I am using latest version 0.90, error is from propellent with message that
    "source register/constant cannot exceed $1FF"

    Gerry
  • Mike GreenMike Green Posts: 23,101
    edited 2010-04-11 00:16
    value\STR would be a reasonable notation for treating the value as the address of a zero-terminated string.
  • BeanBean Posts: 8,129
    edited 2010-04-11 00:31
    Gerry,
    Can you post the program that is causing the error ? Or better yet a very small program that exhibits the error.

    Thanks,

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
  • simonlsimonl Posts: 866
    edited 2010-04-11 00:52
    @Bean: Are you able to post PropBASIC ver. 90 here? The normal site is down, and I'm having trouble getting strings to work - just wondering if it's because I'm using ver. 89.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,
    Simon

    www.norfolkhelicopterclub.com

    Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
  • Gerry KeelyGerry Keely Posts: 75
    edited 2010-04-11 01:01
    DEVICE          P8X32A, XTAL1, PLL16X
    XIN             5_000_000
    cogvar var long
    ' ======================================================================
      PROGRAM Start
    ' ======================================================================
    Start:
      cogvar =  4294967295
    Main:
      ' operational code
      GOTO Main
      END
    

    ·code produced is mov·········· cogvar,#4294967295



    regards

    Gerry
  • SapiehaSapieha Posts: 2,964
    edited 2010-04-11 01:08
    Hi ALL.

    If Bean can't post v90

    I can post all 3 versions on forum if he said it is OK

    Regards

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.
    For every stupid question there is at least one intelligent answer.
    Don't guess - ask instead.
    If you don't ask you won't know.
    If your gonna construct something, make it·as simple as·possible yet as versatile as posible.


    Sapieha
  • simonlsimonl Posts: 866
    edited 2010-04-11 01:23
    Thanks Sapieha: Looks like the site's back up now though smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,
    Simon

    www.norfolkhelicopterclub.com

    Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
  • BeanBean Posts: 8,129
    edited 2010-04-11 02:32
    Gerry,
    Thanks. I'll have to confer with BradC. The program works okay when I use the version I compile. But the version he compiled must not be picking up the fix.

    We'll try to get it sorted ASAP.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
  • VonSzarvasVonSzarvas Posts: 3,282
    edited 2010-04-11 08:20
    Bean said...
    @Mike, As a take on the "SHIFTOUT value\bits" format, how about "SEROUT pin,baud,value\STR" ?

    My first thought was to prefix the value with a $ (a 'kind of S' for string).

    But I also like (and think I prefer) your idea to add the suffix \STR.

    It means in the future we could also see \DEC or \HEX without changing the logic. Furthermore, \STR or \HEX seems to follow the concept of BASIC more than $ or ¬ prefixes ! It should almost be obvious what they do instead of requiring a reference guide.

    .
  • BeanBean Posts: 8,129
    edited 2010-04-16 16:26
    The latest version of PropBasic is available for download (00.00.92).
    In case you missed it, SEROUT can now send strings. So you can now do

    SEROUT 30, T115200, "Hello There"

    Here are the other changes:
    Version 00.00.91
    Fixed: pin = longvar ' Used "test", should have been "cmp"
    Added: SEROUT pin,baud,longvar\STR (longvar is a pointer to HUB string)
    Added: SHIFTOUT and SHIFTIN speed multiplier
    Version 00.00.92
    Fixed: ON...GOSUB for LMM
    Changed: GOSUB only works with declared SUBs and FUNCs
    Fixed: Problem with value over 31-bits with bst " temp = 4294967295"
    Fixed: Divide by zero locks-up. Now returns zero.
    Fixed: SEROUT string error if HUB offset is > $1FF
    Fixed: SEROUT string can have an index


    I'll work on updating all the demos to use the new features.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information

    Post Edited (Bean) : 4/16/2010 4:33:12 PM GMT
  • Christof Eb.Christof Eb. Posts: 1,106
    edited 2010-04-16 17:54
    Great, Bean!
    Christof
  • hover1hover1 Posts: 1,929
    edited 2010-04-16 18:37
    Bean and Jon,
    Thanks for all the hard work.
    SEROUT with strings is a Godsend!
    Jim
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2010-04-16 21:01
    Thanks Bean smile.gif
  • BeanBean Posts: 8,129
    edited 2010-04-18 20:27
    There is a major bug in release 00.00.92.
    While we fixed the problem with assigning decimal values, now hex values ($ prefix) don't work.

    In Delphi "VAL(string, longint, error)" works for hex values, but "VAL(string, double, error)" doesn't work for hex values. I didn't realize that.

    Sorry about the problem. I'll get it fixed and post a new version ASAP.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
  • BeanBean Posts: 8,129
    edited 2010-04-19 01:11
    Brad has posted version 00.00.93 so you can get it now.

    Sorry for not catching that before I release it blush.gif

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information

    Post Edited (Bean) : 4/19/2010 1:33:00 AM GMT
  • Christof Eb.Christof Eb. Posts: 1,106
    edited 2010-04-19 18:38
    Hi Bean,
    sorry, that I still have wishes for PropBasic:
    1. Would it be possible, to modify the LET statement: Y= 2*X + 4 *a Strictly calculated from left to right. I think, that a stack is still not needed for this and the benefit would be, that you can write more compact code.
    2. Again I ask about float support (only together with LMM of course). Is this on your list?
    3. What about the docu? Is this still worked on? It would be a great pity to have such a good tool and not to know how to use it....
    Christof
  • JonnyMacJonnyMac Posts: 8,929
    edited 2010-04-19 18:52
    I can answer the docs question as it's in my lap: Yes, it's still being worked on. Both Bean and I do this stuff for fun (no profit) so PropBASIC has to take a back seat to our paying jobs. Thanks for being patient.

    BTW, I am NOT in favor of your request for more than one operator per line. The goal of PropBASIC, in addition to having a nice BASIC compiler for the Propeller, is to show users how to translate BASIC to PASM. While your program using a complex expression would be more compact, the resulting code wouldn't. Just my $0.02. Multiplication takes a fair bit of code, and in my opintion should be dropped into a function so that it's only compiled once -- like this

    FUNC MULT
      param3 = param1 * param2
      RETURN param3
      ENDFUNC
    



    Now your code becomes:

    y = MULT 2, x
      y2 = MULT 4, a
      y = y + y2
    



    Yes, your source listing is longer, but the resulting code is more compact (which is what's important).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA
  • Christof Eb.Christof Eb. Posts: 1,106
    edited 2010-04-19 20:41
    Hi Jon,
    thanks for the answer. I am very happy that you still work for PropBasic. I had feared, that this might be a dropped project (Instead now a C-Compiler?). Your doc in this quality is very very much work, I think!

    Well, I thought simply from left to right: Y= 2*X + 4 *a would be calculated to the result Y= ((2*X)+4)*A eqivalent to:
    Y= 2 * X
    Y= Y + 4
    Y= Y * A
    I think, that this could perhaps be done without great changement of the compiler.

    I have now a project using PropBasic. I am still impressed, how much code can reside inside one cog. In 250 lines of basic code -only the program, without variables declarations- there is a complete 3-axis step motor controller in one cog. And the possible speed is much higher, than my motors allow....

    Thanks for your input how to gain some bytes,
    Christof
Sign In or Register to comment.