Shop OBEX P1 Docs P2 Docs Learn Events
NEW: xBasic IDE and Compiler for Propeller - Page 3 — Parallax Forums

NEW: xBasic IDE and Compiler for Propeller

1356

Comments

  • jazzedjazzed Posts: 11,803
    edited 2011-08-24 09:50
    Bean wrote: »
    When I have more than one program open and press RUN, it runs the program in the first tab instead of the one in the current tab.
    The xBasic IDE is setup to use a "project" scheme. If you want to build a file, you have to set it as the project.

    Some files may use print which is included in the main project file. If you set that file to the project without including print.bas, you will get a compile error. According to David, you can include "print.bas" in files if you like, but only the first include "print.bas" in the files list will be used. Not sure what happens with the project/references list since i never tried that.
    Bean wrote: »
    Everytime I do RUN, I have to unplug and re-plug the QuickStart board. If I don't I get the errror "Lost HW contact. 0 f9
    What program are you running? There was once a problem where board output would cause that error because the loader buffer wasn't flushed.
  • jazzedjazzed Posts: 11,803
    edited 2011-08-24 10:01
    KMyers wrote: »
    On the terminal window I clicked the help and mt mouse pointer stays the circle with the slash in it.
    Now I get it ... sorry it took so long :)
    The ? near the top right X-it button is not defined. I'll remove it.

    Regarding BasicStamp PBASIC. The xBasic compiler does not understand PBASIC syntax.
    It would take lots of motivation for David to consider supporting PBASIC syntax.


    Thanks a ton for your help!
  • SapiehaSapieha Posts: 2,964
    edited 2011-08-24 10:01
    Hi jazzed.

    I have strange problems with Yours TV driver - It cut last 2-3 pixels on every line displayed.


    Ps. Look on posted pictures. Only thing that I changed are Row/Columns and from NCST to PAL

    Will make some pics and post in this thread tomorow.
    1024 x 768 - 51K
    1024 x 768 - 75K
    1024 x 768 - 103K
    1024 x 768 - 123K
  • BeanBean Posts: 8,129
    edited 2011-08-24 10:02
    Okay on the "Set Project". That works.

    Here is the program
    // Demo for QuickStart board
    
    include "propeller.bas" // waitcnt
    
    def inp(pin)
      dira=dira & ~(1 << pin)
    end def
    
    def out(pin)
      dira=dira | (1 << pin)
    end def
    
    def reverse(pin)
      dira=dira ^ (1 << pin)
    end def
    
    def high(pin)
      dira=dira | (1 << pin)
      outa=outa | (1 << pin)
    end def
    
    def low(pin)
      dira=dira | (1 << pin)
      outa=outa & ~(1 << pin)
    end def
    
    def toggle(pin)
      dira=dira | (1 << pin)
      outa=outa ^ (1 << pin)
    end def
    
    def pause(msec)
      waitcnt((clkfreq / 1000) * msec + cnt)
    end def
    
    // Main code
    do
      for i=16 to 23
        toggle(i)
        pause(50)
      next i
    loop
    

    After the first RUN, all attempts after result in the "Lost HW contact" error.

    P.S. The "changed" star after the filename does not go away when you save the file.

    Bean
  • KMyersKMyers Posts: 433
    edited 2011-08-24 11:05
    @jazzed

    Appreciate the info on the term window, no need to remove the ? but could there possibly a clear screen button?

    It also would be great for people like me who cut their teeth on a basic stamp to have a prop basic compiler that was pbasic :friendly: Any way I feel I will use this for my prop work. Also no problems with setting for the C3 in both hub ram and XMM. I am liking it alot!
  • David BetzDavid Betz Posts: 14,516
    edited 2011-08-24 11:14
    KMyers wrote: »
    It also would be great for people like me who cut their teeth on a basic stamp to have a prop basic compiler that was pbasic :friendly: Any way I feel I will use this for my prop work.

    I guess this is really for me since I did the language design and compiler. What pbasic features are you looking for? I haven't used pbasic myself so I'm not really familiar with its capabilities.

    Also, isn't PropBasic similar to pbasic? Maybe you can use that if xbasic doesn't meet your needs.

    Thanks,
    David
  • RsadeikaRsadeika Posts: 3,837
    edited 2011-08-24 11:34
    Sorry jazzed, it is still not working. When I tried to create a simple program, the save part did not save the file. When I hit the build, it seem to accept that without error, but when I hit the run, it came up with a compile error. So, right now I can not get anything to run, it keeps coming up with a compiler error, other than that the program looks good. Can't wait to see BigSpin in action!

    Ray
  • David BetzDavid Betz Posts: 14,516
    edited 2011-08-24 11:49
    Rsadeika wrote: »
    So, right now I can not get anything to run, it keeps coming up with a compiler error, other than that the program looks good.
    What kind of compiler error are you getting? Maybe it's a problem with my compiler code.
  • KMyersKMyers Posts: 433
    edited 2011-08-24 11:49
    @David

    I guess what I would like is to be able to paste a Pbasic source code and get it to run with little muss or fuss. Probably not realistic. I have a program with ping and sensors to tell if someone or something is behind my power chair and set alarms for x and y axis tilt of the chair when I am roaming out side. (Grin). My wifes cat appreciates this as I accidentally ran over her tail once...

    Sorry Bean but I never got to far with Prop Basic even though it seams to work also. For some reason unknown I couldn't get into it...
  • David BetzDavid Betz Posts: 14,516
    edited 2011-08-24 11:52
    Can you post some of your pbasic code so I can see what it looks like?
  • jazzedjazzed Posts: 11,803
    edited 2011-08-24 11:59
    Version 0.1.6 is now available on the web-site.
    It includes fixes and enhancements identified in this thread.
    KMyers wrote: »
    could there possibly a clear screen button?
    Yes. Done.
    Bean wrote: »
    After the first RUN, all attempts after result in the "Lost HW contact" error.
    Odd. I've tried this on 4 different board types except a QuickStart which I don't have.
    Have you tried a different board? What is your PC O/S and CPU type?

    Nice library code BTW. The functions would make a nice addition to the distribution.
    I accidentally left a copy of your file in samples\bean.bas for the 0.1.6 distribution.
    Bean wrote: »
    P.S. The "changed" star after the filename does not go away when you save the file.
    Fixed in V0.1.6.

    Sapieha wrote: »
    I have strange problems with Yours TV driver - It cut last 2-3 pixels on every line displayed.
    I'm investigating this and will get back with it in a while.

    Regarding "last folder" issue identified by JonnyMac: the open/save as dialog seems to remember the last folder in Windows 7 (unless the window is cancled). Windows XP uses that silly folder dialog thing and is quite annoying.
  • SapiehaSapieha Posts: 2,964
    edited 2011-08-24 12:03
    Hi jazzed.

    thanks

    If You need I can post file I made changes in !
  • jazzedjazzed Posts: 11,803
    edited 2011-08-24 12:16
    Ray, I suspect that your xbasic.cfg file in the include directory is corrupt. I had a backup mechanism at first but that caused more trouble than it was worth.

    At this point, it's probably best to uninstall the program. I might try going back to a restore point - unfortunately the installer i'm using does not automatically create a restore point.

    Reinstalling the new version may work but there is no guarantee. I've tested this on several machines and not any problem with the new version code. ...

    Odd thing is that you said you could build but not run. Can you make a screenshot (Ctrl+PrtScr) of the error message box and post it? I get this if I don't have the right board-type:

    attachment.php?attachmentid=84504&d=1314213282

    BTW I stopped working on BigSpin mainly because of performance issues.
    Rsadeika wrote: »
    Sorry jazzed, it is still not working. When I tried to create a simple program, the save part did not save the file. When I hit the build, it seem to accept that without error, but when I hit the run, it came up with a compile error. So, right now I can not get anything to run, it keeps coming up with a compiler error, other than that the program looks good. Can't wait to see BigSpin in action!

    Ray
    328 x 329 - 36K
  • jazzedjazzed Posts: 11,803
    edited 2011-08-24 12:19
    Sapieha wrote: »
    If You need I can post file I made changes in !

    Please do. Thanks. I don't have a PAL TV but I'm sure others do and would appreciate it.

    We still have lots of library code to write.
  • SapiehaSapieha Posts: 2,964
    edited 2011-08-24 12:22
    Hi jazzed.

    I can help You with all needed test's for PAL system.

    file attached.

    jazzed wrote: »
    Please do. Thanks. I don't have a PAL TV but I'm sure others do and would appreciate it.

    We still have lots of library code to write.
  • BeanBean Posts: 8,129
    edited 2011-08-24 12:35
    jazzed wrote: »
    Nice library code BTW. The functions would make a nice addition to the distribution.
    I accidentally left a copy of your file in samples\bean.bas for the 0.1.6 distribution.

    "accidentally" LOL. Thanks. I take that as a compliment. I'll build on it. I plan to expand the routines to handle multiple pins.

    Bean
  • SapiehaSapieha Posts: 2,964
    edited 2011-08-24 13:01
    Hi jazzed.

    As You can see - problem are only on PAL side.

    See pictures.
    1024 x 768 - 67K
    1024 x 768 - 64K
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-08-24 13:32
    @Bean/Steve,

    I've had times with my QuickStart boards that they have not reset reliably from the Propeller Tool when loading a new program. After a random and undocumented series of loads and reloads, it will work and be seen. I haven't tried xBasic yet (maybe tonight if I get to sit down a bit) but I can see if I can repeat the problem...and maybe come up with a repeatable solution. In all cases, the Quickstart has been USB powered and it has happened on at least 2 different computers.

    I also have 32K and 64K quickstarts - I know I've seen the problem on the 64K boards.....not sure about the 32K boards. I of course was also playing with PropForth which I know invalidates my test results and has voided my warranty! :lol:
  • jazzedjazzed Posts: 11,803
    edited 2011-08-24 13:33
    Attached is a zip that contains the 0.1.6 xbasic-qt.exe.

    If you already have a working installation, drop the .exe into your
    C:\Program Files (x86)\xBasic IDE\bin folder.
    This would be faster than downloading a new package!

    If you want to update your entire package, uninstall the old version first then install the with the new setup from: http://www.microcsource.com/xbasic/xBasicIDE.zip


    Sapieha, do you mean that NTSC works but PAL has the clipping problem?

    If so, it's probably best if we make TVPAL.bas driver from an existing known good driver.
    Doesn't Baggers have something that works for both? The driver I used was Chip's TV.spin.
    Sorry, I have not yet integrated the tools for making these and other drivers.
  • SapiehaSapieha Posts: 2,964
    edited 2011-08-24 13:47
    Hi jazzed.

    1. Sapieha, do you mean that NTSC works but PAL has the clipping problem?

    2. If so, it's probably best if we make TVPAL.bas driver from an existing known good driver.
    Doesn't Baggers have something that works for both? The driver I used was Chip's TV.spin.
    3. Sorry, I have not yet integrated the tools for making these and other drivers.

    On 1. Yes - You are correct.
    On 2. Any solution that will work are welcome.
    On 3. I know You can't work on all at same time
  • RsadeikaRsadeika Posts: 3,837
    edited 2011-08-24 14:12
    @jazzed, it started to work, but I do not know why. The program is still a little finicky, for instance, when I have the testinput.bas loaded, and hit run, nothing seems to happen. I noticed on the propplug the little blue light is flashing, so something got loaded. When I hit debug, it opens, I guess, a terminal screen, but it just stays blank. Since the bas program contains some print statements, I was expecting something on the screen.

    Well, at least it started run, will see what happens when I start it up tomorrow.
  • SapiehaSapieha Posts: 2,964
    edited 2011-08-24 14:17
    Hi jazzed.

    Have You possibility to ADD in Properties one more Directory Input?

    "Working Project Path"

    That after start xBasic always starts in That Directory?
  • jazzedjazzed Posts: 11,803
    edited 2011-08-24 15:00
    Rsadeika wrote: »
    @jazzed, it started to work, but I do not know why.

    Ray it's probably working :) There is a delay between compile/download and terminal start-up.

    Try this example.
    include "input.bas"
    include "print.bas"
    include "propeller.bas"	// add propeller specific code
    
    dim a(32) as byte
    waitcnt(clkfreq+cnt)	// add 1 second delay
    do
        print "Type somethheing: ";
        inputLine(0, a)
        print "a='"; a; "'"
    loop
    

    I just noticed the little "*" keeps coming back on file tabs. Not sure why.
  • jazzedjazzed Posts: 11,803
    edited 2011-08-24 15:02
    Sapieha wrote: »
    "Working Project Path"

    That after start xBasic always starts in That Directory?
    Yes, I'll try that. By the time I'm done there will be more properties.


    Meanwhile, here is a procedure for converting any Spin PASM driver to xBasic.
    The bin2xbasic.zip attached below contains bin2xbasic.exe for windows.

    TV.spin is a good example to use. Any driver that uses a "mailbox" interface will work.
    1. Unpack bin2xbasic.exe from the .zip
    2. Ensure you have BSTC
    3. bstc -c -Ograucx TV.spin
    4. bin2xbasic TV.dat TV.bas
    5. include "TV.bas" in your application
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-08-24 19:39
    Steve/Dave,

    xBasic IDE installed and ran fine on my Acer Aspire One w/ 1GB running Windows 7Starter. The demos I tried worked fine with my 64kB Quickstart. I don't have any Prop boards with anything but HUB RAM so any testing I do will be limited to that memory model.

    The look and feel of the IDE is impressive. I'm looking forward to doing more with it.

    I noticed the same "loss of communication" issues with the QuickStart that Bean had mentioned. This is not limited to your IDE, I've seen this same problem with the Propeller Tool and the QuickStart board. If you unplug the USB cable and plug it in again, then the tools see the prop and can reload it. I need to gather my other USB connected cards and see if they have the same problem. I don't ever recall seeing this with a Prop Plug connected Prop. Further details is for another thread.

    The IDE is looking good!! I haven't played enough to have any suggestions for additions.
  • jazzedjazzed Posts: 11,803
    edited 2011-08-24 20:51
    @mindrobots, Glad you like the IDE and had good luck installing it.

    The QuickStart stuff is troubling. ... Especially if it's going viral....
    I don't have a board so I can't experiment with it.

    I have a USB ProtoBoard, C3, and other USB connected/powered devices.
    They always work for me. All the PropPlug solutions work fine too.

    Are there any theories at all as to why there might be an issue?
  • RsadeikaRsadeika Posts: 3,837
    edited 2011-08-25 05:27
    I figured out what I was doing wrong to get that compiler error, if you have a mistake in the program like a missing '(' , or anything else, then the IDE produces a compiler error. It would be nice if the IDE would point out the reason for the compiler error. Now that I am of aware of that, the IDE seems to be behaving, although the program itself seems to freeze every once in awhile, to the point where I have use the task manager to kill it.

    When you create a new file, and you hit the 'save', it does not save the new file, you have to use 'save as' on a new file, then 'save' for a save of changes to the file. It is not what I expected to happen, but I guess it is something one has to get used to.

    I noticed in the propeller.bas, it contains a command for starting a new cog, any info as to what the proper usage would be? So far this program looks promising, I will have to dig out my C3 board, and see how it works with the extra SRAM, and flashram. This leads to another question, since the C3 board has an SD, is their a way to use it with xbasic?

    Ray
  • jazzedjazzed Posts: 11,803
    edited 2011-08-25 08:02
    Hi Ray.

    Glad to see you are having success with xBasic now :)
    Thanks for your patience.
    Rsadeika wrote: »
    I figured out what I was doing wrong to get that compiler error, if you have a mistake in the program like a missing '(' , or anything else, then the IDE produces a compiler error. It would be nice if the IDE would point out the reason for the compiler error.
    There was a compiler change from V0.1.5 to V0.1.6 for error info. I didn't notice until yesterday after I posted an update. The next update will include error information again.
    Rsadeika wrote: »
    Now that I am of aware of that, the IDE seems to be behaving, although the program itself seems to freeze every once in awhile, to the point where I have use the task manager to kill it.
    It would be very helpful if you can make notes of what you were doing before/during a freeze. I haven't seen any freezing.
    Rsadeika wrote: »
    When you create a new file, and you hit the 'save', it does not save the new file, you have to use 'save as' on a new file, then 'save' for a save of changes to the file. It is not what I expected to happen, but I guess it is something one has to get used to.
    There are some issues with save that I'm looking at today. I'll look at this too.
    Rsadeika wrote: »
    I noticed in the propeller.bas, it contains a command for starting a new cog, any info as to what the proper usage would be?
    Look at the samples\TvDemo example. The include\TvText.bas shows how to start a COG. The cognew syntax is identical to Spin's cognew for PASM. You can not cognew an xBasic program.

    There are few comments in propeller.bas and other includes - this needs some attention.
    Rsadeika wrote: »
    So far this program looks promising, I will have to dig out my C3 board, and see how it works with the extra SRAM, and flashram. This leads to another question, since the C3 board has an SD, is their a way to use it with xbasic?
    One of the file-system drivers needs to be ported to xBasic. Some silly C3 hardware decisions complicates things, but these can be overcome.
  • David BetzDavid Betz Posts: 14,516
    edited 2011-08-25 08:06
    jazzed wrote: »
    There was a compiler change from V0.1.5 to V0.1.6 for error info. I didn't notice until yesterday after I posted an update. The next update will include error information again.
    Oops! Sorry about that! I didn't make any intentional changes in the error code syntax. Maybe we should discuss this before you change anything. It might be my problem not yours!
    One of the file-system drivers needs to be ported to xBasic. Some silly C3 hardware decisions complicates things, but these can be overcome.
    The C3 cache driver used by xbasic already includes code for low level SD sector I/O. We just need the higher level code ported over. Unfortunately, that may be a big job.
  • RsadeikaRsadeika Posts: 3,837
    edited 2011-08-25 08:27
    Since the subject of SD is up, I also use the Gadget Gangster USB board which has an SD, will that be supported also? And how about the jazzed humungous RAM board, although I would like to see something replicates what the C3 has? Lets see, what other features does the C3 have, ADC, I think that is about it.

    Ray
Sign In or Register to comment.