Now that it seems there is a willingness to support PropBasic from SimpleIDE, that problem has been eliminated.
Please don't confuse willingness with availability. Until the last few weeks, I just haven't been available. I've helped with a temporary solution so far because I've had some free time. I can do more later. Just got a list of priorities that will consume all free time until September though.
Ray, and others. If you use PropellerGCC, make sure to set your SPIN compiler back to bstc. I've been bitten by having the wrong thing set for building SPIN. In the future, a PropBasic (or other) compiler setting and properties tab can be added to eliminate such problems.
Sorry Jazzed, "willingness" wasn't really the word I was looking for...
I really do appreciate what you have done so far. I think we can figure most stuff out from here.
At least now I can make changes to PropBasic and have a proper IDE to write programs.
I don't want you to feel any kind of commitment, I realize that paying gigs, family and free time come first.
And while there are resource starved projects, there is also untapped talent standing at the gates. How do these get joined up? How do forum members with some time, skills and willingness to assist get plugged in to the projects that interest them?
And while there are resource starved projects, there is also untapped talent standing at the gates. How do these get joined up? How do forum members with some time, skills and willingness to assist get plugged in to the projects that interest them?
And while there are resource starved projects, there is also untapped talent standing at the gates. How do these get joined up? How do forum members with some time, skills and willingness to assist get plugged in to the projects that interest them?
Like JonnyMac said, the biggest library needed is for SD card access. If anyone wants to tackle that PLEASE let me know.
I have code for some things like keyboard, VGA, TV, etc. I just need to find the time to make them into useable libraries.
What is the relationship between a TASK and a LOAD library? I created an XBee TASK and a library that contains subroutines/functions. I LOAD the library in the main body of code, but when I try to use the subroutine/function in the TASK I keep getting an error at compile. If I leave the TASK without the subroutine/function, then the program compiles without an error. The subroutine/function is working code, no errors. Does the specific library need to be LOADed in the TASK itself?
Ray
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' PropBase.pbas
'
' August 20, 2013
'
' Use of PropBOE or Activity board as a stand alone device.
'
''''''''''''''''''''
' Define hardware requirements
''''''''''''''''''''
DEVICE P8X32A, XTAL1, PLL16X
XIN 5_000_000
STACK 16
''''''''''''''''''''
' Constants
''''''''''''''''''''
Xbaud CON "T9600" ' Use of XBee
''''''''''''''''''''
' Special usage I/O Pins
''''''''''''''''''''
xbRX PIN 15 INPUT ' Use of XBee
xbTX PIN 14 HIGH ' Use of XBee
''''''''''''''''''''
' Cog Variables (Long only)
''''''''''''''''''''
inByte VAR LONG
xbcog VAR LONG
LOAD "pbasic.lib"
LOAD "pbasicIO.lib"
LOAD "pbasicXB.lib"
''''''''''''''''''''
' Declare special Subroutine/Functions/Tasks
''''''''''''''''''''
XBeeStart TASK
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''
PROGRAM Start
''''''''''''''''''''
Start:
' Wait for terminal screen.
wait_MS 300
COGSTART XBeeStart,xbcog
Main:
tx_STR "The PropBase Program\r\n"
DO
tx_BYTE "#"
inByte = rx_BYTE
IF inByte = "q" THEN
EXIT
ELSE
tx_STR "Unknown Command\r\n"
ENDIF
LOOP
tx_STR "Program Stoped!\r\n"
COGSTOP xbcog
END
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''
' Special Subroutine/Functions/Tasks
''''''''''''''''''''
TASK XBeeStart
DO
' xbtx_BYTE "A"
' wait_MS 1000
LOOP
ENDTASK
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Ray,
Each TASK runs in it's own cog. So a TASK cannot use a subroutine created in a different task (the main program is a task too).
You should put the TASK inside the library by using the '{$TASKS} directive. It works similar to the '{$CODE} directive.
For an example look at the TV library that is on the OBEX http://obex.parallax.com/object/681
BTW: The demo program for TV libary is a great one to show the speed of PropBasic. It moves 1000 dots on the screen. Check it out if you have time. Then remove the "PAUSE 10" line at the bottom of the program and view it again. I think you will be impressed...
I was going to do a short review of PropBASIC, based on the program below, but I do not want to put Bean on the defensive, again.
For now, the error messaging is not useful at all, aside from the fact that it does tell you that there was an error. In a much larger program this could become a major hair removal event, so you have been warned. But the program does run fast.
For now I think I will probably use PropBASIC the way it was designed to be used, a learning tool for PASM. Meaning, write some code that does something, compile it, and then get the PASM listing to study how it was all done in PASM.
The program below is a functional program, at least it runs on my Windows setup. It would be interesting to know if and when the Linux and Mac versions become available, if indeed this program runs as expected.
But the program does run fast ...
Ray
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' PropBase.pbas
'
' August 20, 2013
'
' Use of PropBOE or Activity board as a stand alone device.
'
''''''''''''''''''''
' Define hardware requirements
''''''''''''''''''''
DEVICE P8X32A, XTAL1, PLL16X
XIN 5_000_000
STACK 16
''''''''''''''''''''
' Constants
''''''''''''''''''''
''''''''''''''''''''
' Special usage I/O Pins
''''''''''''''''''''
''''''''''''''''''''
' Cog Variables (Long only)
''''''''''''''''''''
inByte VAR LONG
xbcog VAR LONG
LOAD "pbasic.lib"
LOAD "pbasicIO.lib"
''''''''''''''''''''
' Declare special Subroutine/Functions/Tasks
''''''''''''''''''''
XBeeStart TASK
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''
PROGRAM Start LMM
''''''''''''''''''''
Start:
' Wait for terminal screen.
wait_MS 300
COGSTART XBeeStart,xbcog
Main:
tx_STR "The PropBase Program\r\n"
DO
tx_BYTE "#"
inByte = rx_BYTE
IF inByte = "q" THEN
EXIT
ELSE
tx_STR "Unknown Command\r\n"
ENDIF
LOOP
tx_STR "Program Stoped!\r\n"
COGSTOP xbcog
END
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''
' Special Subroutine/Functions/Tasks
''''''''''''''''''''
'
' This is an XBee wireless task.
TASK XBeeStart LMM
Xbaud CON "T9600" ' Use of XBee
xbRX PIN 15 INPUT ' Use of XBee
xbTX PIN 14 HIGH ' Use of XBee
inbyte VAR LONG
xbtx_BYTE SUB 1
xbtx_STR SUB 1
xbrx_BYTE FUNC 0
wait_MS SUB 1
''''''''''''''''''''
DO
xbtx_BYTE ">"
inByte = xbrx_BYTE
IF inByte = "q" THEN
EXIT
ELSE
xbtx_STR "Unknown Command\r\n"
ENDIF
LOOP
xbtx_STR "Wireless Stopped!\r\n"
END
''''''''''''''''''''
' Subroutines/Functions
SUB xbtx_BYTE
SEROUT xbTX, Xbaud, __param1
ENDSUB
''''''''''''''''''''
SUB wait_MS
PAUSE __param1
ENDSUB
''''''''''''''''''''
FUNC xbrx_BYTE
SERIN xbRX, Xbaud, __param1
RETURN __param1
ENDFUNC
''''''''''''''''''''
SUB xbtx_STR
tsPntr VAR __param3
tsChar VAR __param4
tsPntr = __param1
DO
RDBYTE tsPntr, tsChar
IF tsChar = 0 THEN EXIT
xbtx_BYTE tsChar
INC tsPntr
LOOP
ENDSUB
ENDTASK
' End of XBeeStart TASK.
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
pbasic.lib
' SimpleIDE PropBasic library
' Declarations for terminal use.
Baud CON "T115200"
TX PIN 30 HIGH
RX PIN 31 INPUT
' Subroutine/Function declarations
wait_MS SUB 1
tx_STR SUB 1
tx_BYTE SUB 1
' Compiler directive for main code space.
'{$CODE}
'
' Subroutines/Functions
'
' Usage - waitMS xxxx, waitMS 1000 , 1000 = 1 second
'
'{$IFUSED wait_MS}
SUB wait_MS
PAUSE __param1
ENDSUB
'{$ENDIF}
' Use: tx_STR strpntr
' -- transmits a z-string at strpntr
' -- uses tx_BYTE
' Usage - tx_STR strgptr
'{$IFUSED tx_STR}
SUB tx_STR
tsPntr VAR __param3
tsChar VAR __param4
tsPntr = __param1
DO
RDBYTE tsPntr, tsChar
IF tsChar = 0 THEN EXIT
tx_BYTE tsChar
INC tsPntr
LOOP
ENDSUB
'{$ENDIF}
' Usage - tx_BYTE char, count
'
'{$IFUSED tx_BYTE}
SUB tx_BYTE
SEROUT TX, Baud, __param1
ENDSUB
'{$ENDIF}
pbasicIO.lib
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' pbasicIO.lib
''''''''''''''''''''
' Declare Subroutines/Functions
''''''''''''''''''''
rx_BYTE FUNC 0
' Compiler directive for main code space.
'{$CODE}
'
''''''''''''''''''''
' Subroutines/Functions
''''''''''''''''''''
'
' Usage - result = rx_BYTE
' used with SERIN
'{$IFUSED rx_BYTE}
FUNC rx_BYTE
SERIN RX, Baud, __param1
RETURN __param1
ENDFUNC
'{$ENDIF}
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
I'm not sure why you made everything LMM though ? Native code would run even faster.
I wanted to see how much larger the program got when using LMM, but that did not help because it shows up as 'longs'. At this point 'longs' does not compute in my brain in terms of useable program size. As noted by Bean " Native code would run even faster."
Ray,
Your code looks fine to me. I'm not sure why you made everything LMM though ? Native code would run even faster.
Yes, the error are useless because (for now) simpleIDE does not locate them.
Bean
When errors are output on the command line by propbasic, some errors will be highlighted in the source, and other errors will not. Most of the declaration errors are not found for some reason.
Jazzed,
I see part of the problem. If you take out the @s in the batch file, you will see that %4 is set to "test.pbas" (with the extension).
So when you try to delete the .err and .binary files it is actually looking for test.pbas.err and test.pbas.binary instead.
I'm not sure why bstc works, since we are passing it a .pbas file ??? I guess it ignores the extension of the file.
I'll try to find a way in the batch file to remove the extension (not sure if it is possible)...
P.S. Okay figured it out you have to use %~n4 instead of just %4 to get the name without the extension.
I'm not really sure why we care if .err exist though because simple application return codes should work just as well if errors are dumped to the cmd shell as they are found. That's the way it works for bstc error output and other programs; that's the only way I'll ever look at error info in the IDE.
I have just uploaded files for the latest version of PropBasic 1.42
Thanks to David Betz for the Linux and OSX builds.
The PC version contains a batch file, but I'm not sure what is done on Linux or OSX as I'm afraid I'm not familiar with them. If you have questions perhaps David would be kind enough to answer them.
Bean
Version 00.01.40
Changed from Delphi to Lazarus
Version 00.01.41
Changed path character "\" to "/" for compatiblity with Mac and Linux
Fixed PulsOut that hangs at lower clock speeds Aug 19, 2013
Version 00.01.42
Changed to add "/" to end of g_sInputDir because Mac version seems to be lacking it
Added code to avoid Lazarus warnings
I have just uploaded files for the latest version of PropBasic 1.42
Thanks to David Betz for the Linux and OSX builds.
The PC version contains a batch file, but I'm not sure what is done on Linux or OSX as I'm afraid I'm not familiar with them. If you have questions perhaps David would be kind enough to answer them.
Bean
Version 00.01.40
Changed from Delphi to Lazarus
Version 00.01.41
Changed path character "\" to "/" for compatiblity with Mac and Linux
Fixed PulsOut that hangs at lower clock speeds Aug 19, 2013
Version 00.01.42
Changed to add "/" to end of g_sInputDir because Mac version seems to be lacking it
Added code to avoid Lazarus warnings
What is in the Windows batch file? I'll try to make a Mac and Linux shell script that does the same thing.
Since I kind of got burned a little on BST, I would like all the users of PropBasic to know that David Betz has the source code for the compiler (so he can create the OSX and Linux versions) and if anything should happen that I can't or won't support it, I give him permission to release the source code. It is written in pascal using Lazarus (free) to compile it so there should be at least a couple people who can make changes.
hi, I am trying to download PropBasic_1_42_PC.zip. When I click on it
Win7 asks "do you want to open or save attachment.php" but this is not the file I want. WHAT AM I DOING WRONG, CAN YOU HELP ME - thanks
What browser are you using? I just tested IE10, a recent Firefox and a current Chrome using default security settings and all d/l the file without issue.
Comments
Ray, and others. If you use PropellerGCC, make sure to set your SPIN compiler back to bstc. I've been bitten by having the wrong thing set for building SPIN. In the future, a PropBasic (or other) compiler setting and properties tab can be added to eliminate such problems.
I really do appreciate what you have done so far. I think we can figure most stuff out from here.
At least now I can make changes to PropBasic and have a proper IDE to write programs.
I don't want you to feel any kind of commitment, I realize that paying gigs, family and free time come first.
Bean
Like JonnyMac said, the biggest library needed is for SD card access. If anyone wants to tackle that PLEASE let me know.
I have code for some things like keyboard, VGA, TV, etc. I just need to find the time to make them into useable libraries.
Bean
Ray
. Viewing his examples made the relationships very clear.
-Mike
Each TASK runs in it's own cog. So a TASK cannot use a subroutine created in a different task (the main program is a task too).
You should put the TASK inside the library by using the '{$TASKS} directive. It works similar to the '{$CODE} directive.
For an example look at the TV library that is on the OBEX http://obex.parallax.com/object/681
BTW: The demo program for TV libary is a great one to show the speed of PropBasic. It moves 1000 dots on the screen. Check it out if you have time. Then remove the "PAUSE 10" line at the bottom of the program and view it again. I think you will be impressed...
Bean
For now, the error messaging is not useful at all, aside from the fact that it does tell you that there was an error. In a much larger program this could become a major hair removal event, so you have been warned. But the program does run fast.
For now I think I will probably use PropBASIC the way it was designed to be used, a learning tool for PASM. Meaning, write some code that does something, compile it, and then get the PASM listing to study how it was all done in PASM.
The program below is a functional program, at least it runs on my Windows setup. It would be interesting to know if and when the Linux and Mac versions become available, if indeed this program runs as expected.
But the program does run fast ...
Ray
pbasic.lib pbasicIO.lib
Your code looks fine to me. I'm not sure why you made everything LMM though ? Native code would run even faster.
Yes, the error are useless because (for now) simpleIDE does not locate them.
Bean
Ray
I see part of the problem. If you take out the @s in the batch file, you will see that %4 is set to "test.pbas" (with the extension).
So when you try to delete the .err and .binary files it is actually looking for test.pbas.err and test.pbas.binary instead.
I'm not sure why bstc works, since we are passing it a .pbas file ??? I guess it ignores the extension of the file.
I'll try to find a way in the batch file to remove the extension (not sure if it is possible)...
P.S. Okay figured it out you have to use %~n4 instead of just %4 to get the name without the extension.
Bean
This might help: http://stackoverflow.com/questions/8749637/dos-command-to-sperate-file-name-and-extension-into-variables
Bean
I'm not really sure why we care if .err exist though because simple application return codes should work just as well if errors are dumped to the cmd shell as they are found. That's the way it works for bstc error output and other programs; that's the only way I'll ever look at error info in the IDE.
Thanks to David Betz for the Linux and OSX builds.
The PC version contains a batch file, but I'm not sure what is done on Linux or OSX as I'm afraid I'm not familiar with them. If you have questions perhaps David would be kind enough to answer them.
Bean
I get PropBasic.exe is not a valid Win32 application when I run on Windows XP. (Only with v1.42)
Thanks
Bob
Here is what is in the batch file.
Bob,
Hmmm, not sure why it would do that. I'll look into it.
Bean
Sorry I created a 64-bit app my mistake.
I'll rebuild as 32-bit and upload ASAP.
Bean
I have corrected the problem.
Please download the zip file and try again.
Let me know if it is working now.
Bean
Thanks! I'll work on a shell script later.
All seems well again. Thanks for the quick response. It is greatly appreciated!
Bob
I had created a shell script for Mac OS X, that may be a starting point for this:
http://forums.parallax.com/showthread.php/148214-PropBasic-Studio-Coming-Soon?p=1201361#post1201361
dgately
Bean
Bean
Win7 asks "do you want to open or save attachment.php" but this is not the file I want. WHAT AM I DOING WRONG, CAN YOU HELP ME - thanks