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
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.
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.
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
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.
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.
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?
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.
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 !!
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.
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.
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.
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).
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.
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.
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:
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.
Comments
I noticed in some PASM examples the use of "local" labels, such as
In a PropBasic compiled program, there appears to be a different format
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"
Answered this one myself having managed to flash an led a few times with PASM !!
":loop" seems perfectly acceptable
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?
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:
Thanks 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!
Regards, Max.
Bean
Simple and Brilliant !
Thank you Bean.
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
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.
Sounds like the STR function is what you're after.
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.
http://forums.parallax.com/showthread.php?118611-Download-PropBASIC-here...-00.01.08&p=904819&viewfull=1#post904819
the code is:
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.
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
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
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
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.
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
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
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
Bean
Ray
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.
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
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
Got a link?
OBC
Yeah, sorry about that. I have added the link to my post above.
Bean
Have You made new PDF on statements/commands usage.
As some old pbas will not compile in 1.10
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.