Before the current version 00.00.96, STR was a command "STR ascii, value, digits", but now it is a function "ascii = STR value, digits".
The new STR function now also adds the termination zero at the end of the string. And you cannot store the STR result into a VAR array.
I will go through the demo programs and get them updated ASAP.
Bean
P.S. I have attached the updated DS18B20 program.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
No worries, Bean. Like I said I'm just getting started with PropBasic so I won't understand most of it for a couple days. (or weeks actually) I'm glad my thrashing around in the shallow end gave you some insights.
Just to let everyone know. I'm making a change to the way strings are handled.
Instead of using longVar\STR in the SEROUT command (I never really liked that anyway), I have implemented a system array called __STRING
So you can use __STRING(longVar) as a string in hub memory at location "longVar". This will allow subroutines to use string parameters.
SUB Trunc // String, length
__STRING(__param1) = LEFT __STRING(__param1), 2
ENDSUB
I may just use the word "STRING" without the two leading underscores, but .spin must have "STRING" as a reserved word. I'll let everyone know how it works out.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
And multiline comments and signed rdword and and and!
The "'{$IFUSED ASSIGN}" is not in the docu. I have not yet used this, but I thought that it could be very valuable to make libraries to be included with·LOAD.
Perhaps you might add the option PROGRAM LMM at page 75 and TASK LMM at page 88.
Version 00.00.97 has been posted. You can download it from the links in the first post in this thread.
NOTICE: The GetAddr command has been changed to a function. So instead of doing:
GetAddr hubVar, longVar
You will now do:
longVar = GetAddr hubVar
So you will need to change any code that uses GetAddr.
I have already updated the demos.
Also instead of "SEROUT pin, baud, longvar\STR" you need to use "SEROUT pin, baud, __STRING(longvar)"
The __STRING() is a system array that can be used with any of the commands that use strings. If you have the address of the string (like gets passed to a SUB), just use __STRING(address) to access the string.
If you have ANY questions about the changes, please ask. I'll be happy to answer them for you.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
.. also, not wishing to jump the gun - well ok, I will...
"Assuming" it is ok to define the PIN in the TASK/ENDTASK, then it is possible I might "by accident" try to define the same PIN in 2 or more places (in a task and also in the main program, or even in multiple tasks - perhaps more so if tasks become portable objects).
Could the compiler check for duplicate PIN definitions ?
Also, some arbitration might be needed for CON definitions? - if it doesn't already exist...
Compiler crashed with run time error: 217 : Unhandled Exception
If you define some DATA with the same name you get the above "unspecific" exception. Does not matter if both declarations are in main program, or one is in the TASK and the other in the main program. Could there be a more specific error message in this case ?
BUSCONFIG1 DATA "Wakeup and shine",CR,LF,0
BUSCONFIG1 DATA "Go to sleep",CR,LF,0
I am thinking about what else I can declare duplicates of...!! This might apply to HUB variables too! If the compiler can protect me from my own stupidity that would be a good thing !
-- I hope it is ok for me to keep posting these things as I notice them... PropBASIC is the best, so I hope if I report these little things "as I go along" it can help someone else !!
Maxwin, · Thanks for the reports, but as BradC said, if you could post complete program it will make it much easier for me to correct the error. · I'll look at that SEROUT error this morning.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
Maxwin, · On the duplicated DATA label... · I get "ERROR 6 SYNTAX ERROR ;" if the duplicate is in the main program OR in a task.
· What happens is that since "BUSCONFIG1" is already defined when the duplicate is evaluated, the compiler thinks it is an assumed LET. So it tries to·evaluate "LET BUSCONFIG1 DATA " which it can't figure out and throws a Syntax error.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
Maxwin, · I don't see a problem with the SEROUT in a task.
· You do realize that the TX pin will NOT be set HIGH initially in the task ? Pin setup modifier only work in the COG they are defined. Otherwise all cogs would hold pins high, and none of the other cogs could use them. This would explain why when you move the PIN definitions into the TASK it works.
· If this is the case, a simple "HIGH BUSTXPIN" at the beginning of the TASK code might solve the problem.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
I have attached a sample code (for the dupl. DATA error) and screenshot for BST showing the version numbers in the About box (and also the error message at the bottom).
I believe I am using the latest version/s. I am a little curious as to why I seem to get a different error to that mentioned by BradC and Bean. I am running my BST on WinXP, if that makes a difference...
Hi Bean - just downloaded version 00.00.97 from Brads site. Same error for me using the demo file attached above. I just load the file, press F9 - nothing else. The BST "About" menu shows the basic compiler at version 97. I am slightly suspicious of the "Compiler Version"; mine says 0.15.4-pre5 although I am using the latest? BST 0.19.3.
Not sure what else could be different... is there a log file somewhere? - maybe that is a question for Brad - not sure...
Anyhow, thanks for your help - this little error message is not a big deal for me, but if I can help with any diagnostics please shout!
Maxwin said...
Hi Bean - just downloaded version 00.00.97 from Brads site. Same error for me using the demo file attached above. I just load the file, press F9 - nothing else. The BST "About" menu shows the basic compiler at version 97. I am slightly suspicious of the "Compiler Version"; mine says 0.15.4-pre5 although I am using the latest? BST 0.19.3.
bst uses the bstc compiler. It's telling you the bstc compiler version is 0.15.4-pre5.
The unhandled exception error is coming from PropBASIC (bst catches error exit codes and translates them if it knows them). Can you try and compile that file using the PropBASIC .exe file in a cmd prompt window and see what happens?
Oh, now I can reproduce the crash here. Hrm... go figure.. Let me get the details to Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Are you suggesting coconuts migrate?"
BradC, · Okay, I see the problem. I'm throwing a syntax error, but then I go ahead and try to process the LET anyway. No worky... Tries to access pointers that don't exist.
· That will be fixed in the next release.
· Thanks Maxwin for finding that problem.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
Something I learned today was using the LOAD "myTask.pbas" feature.
It certainly makes the code source cleaner/leaner/easier to work with IMO; splitting the source to have each COG/TASK in its own file.
I have realised I can move the PIN and CON definitions into the TASK, and it works well unless their is a duplicate CON - then it fails.
1. As CON definitions are by nature CONstant, could the complier NOT issue the "duplicate variable name" error, but instead use some logic that if a TASK has a CON defined, it uses that "local" definition- otherwise it looks in the main code for a CON. Failing that, it errors "unknown variable". A kind of priority system.
2. At the moment, although duplicate CON definitions throw an error, duplicate PIN definitions do NOT (I mean 2 definitions using different PIN alias names but the SAME pin number between a task and main code). IMO that could be a source of future "hickups".
mypin1 PIN 1 HIGH
mytaskpin PIN 1 LOW
3. Is there an argument for allowing HUB/DATA declarations in the attached TASK code? This way a task could be self contained. At the moment I am thinking that DATA should be allowed, but not necessarily HUB variable declarations. As I might like to use a long predefined DATA in a specific task only - but HUB vars probably should be in the main program as by nature they are designed to be shared.
I hope these observations make sense. If we consider programming in a modular fashion, using external task files, then these thoughts might be useful.
All HUB vars and DATA are global. Can be accessed by all cogs.
HUB vars and DATA can be declared in TASKS. This should not cause any problems.
You can also use LOAD to access commonly used subroutines. If you enclose each subroutine with a '{$IFUSED name} ... {'ENDIF} pair unused subroutines will be stripped and will not take any code space. Note that the LOAD must come at the end of the program so the compiler knows what subroutines were called, and which were not.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
Comments
The new STR function now also adds the termination zero at the end of the string. And you cannot store the STR result into a VAR array.
I will go through the demo programs and get them updated ASAP.
Bean
P.S. I have attached the updated DS18B20 program.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
Post Edited (Bean) : 5/7/2010 4:35:13 PM GMT
to
and it compiled.
Now where did I put that Prop Dongle?
You will probably have to specify option "5" for the STR function. The default option of "1" will put a termination zero after the ascii value.
I didn't think offset worked anymore. I'll have to investigate. I've been making an additional label.
Message DATA "The value is "
valueStr DATA "1234 units.", 13, 0
Then use valueStr = STR value, 4, 5
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
Yeah, offsets don't work. It should throw an error, but instead it is making Message = 13, 0. So it is not even doing the STR function.
I'll have to get that fixed.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
Paul
I have updated the demos in the zip file that you can download from the first post in this thread.
That should get you going...
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
Instead of using longVar\STR in the SEROUT command (I never really liked that anyway), I have implemented a system array called __STRING
So you can use __STRING(longVar) as a string in hub memory at location "longVar". This will allow subroutines to use string parameters.
SUB Trunc // String, length
__STRING(__param1) = LEFT __STRING(__param1), 2
ENDSUB
I may just use the word "STRING" without the two leading underscores, but .spin must have "STRING" as a reserved word. I'll let everyone know how it works out.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
If you are not 100% comfortable with __STRING, would it make sense to use TOSTRING(longVar) instead ?
It might be more descriptive of what is happening... Just a thought..
And multiline comments and signed rdword and and and!
The "'{$IFUSED ASSIGN}" is not in the docu. I have not yet used this, but I thought that it could be very valuable to make libraries to be included with·LOAD.
Perhaps you might add the option PROGRAM LMM at page 75 and TASK LMM at page 88.
Christof
NOTICE: The GetAddr command has been changed to a function. So instead of doing:
GetAddr hubVar, longVar
You will now do:
longVar = GetAddr hubVar
So you will need to change any code that uses GetAddr.
I have already updated the demos.
Also instead of "SEROUT pin, baud, longvar\STR" you need to use "SEROUT pin, baud, __STRING(longvar)"
The __STRING() is a system array that can be used with any of the commands that use strings. If you have the address of the string (like gets passed to a SUB), just use __STRING(address) to access the string.
If you have ANY questions about the changes, please ask. I'll be happy to answer them for you.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
You rule!
Your compiler has made the propeller more marketable....
Bravo!
I have simple program with 1 task that is doing serial.
In the main program I defined:
In the task I am doing:
Using BST, compiles fine, SERIN is OK, but cannot SEROUT - scope shows nothing coming out on the pin.
Simply move the pin definition: BUSTXPIN PIN 18 HIGH
from the main program to inside the TASK/ENDTASK block, and then SEROUT also works.
Should the compiler generate an error? OR should SEROUT work ok when the PIN is defined in the main program area?
(As an aside, I moved all my PIN defs to the TASK now - it seems for now a more logical way to keep the TASK portable)
"Assuming" it is ok to define the PIN in the TASK/ENDTASK, then it is possible I might "by accident" try to define the same PIN in 2 or more places (in a task and also in the main program, or even in multiple tasks - perhaps more so if tasks become portable objects).
Could the compiler check for duplicate PIN definitions ?
Also, some arbitration might be needed for CON definitions? - if it doesn't already exist...
Just some thoughts...!
If you define some DATA with the same name you get the above "unspecific" exception. Does not matter if both declarations are in main program, or one is in the TASK and the other in the main program. Could there be a more specific error message in this case ?
I am thinking about what else I can declare duplicates of...!! This might apply to HUB variables too! If the compiler can protect me from my own stupidity that would be a good thing !
-- I hope it is ok for me to keep posting these things as I notice them... PropBASIC is the best, so I hope if I report these little things "as I go along" it can help someone else !!
I get
ERROR: DUPLICATE VARIABLE NAME BUSCONFIG1
Can you post the entire source file please?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Are you suggesting coconuts migrate?"
· Thanks for the reports, but as BradC said, if you could post complete program it will make it much easier for me to correct the error.
· I'll look at that SEROUT error this morning.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
Post Edited (Bean) : 5/13/2010 11:19:25 AM GMT
· On the duplicated DATA label...
· I get "ERROR 6 SYNTAX ERROR ;" if the duplicate is in the main program OR in a task.
· What happens is that since "BUSCONFIG1" is already defined when the duplicate is evaluated, the compiler thinks it is an assumed LET. So it tries to·evaluate "LET BUSCONFIG1 DATA " which it can't figure out and throws a Syntax error.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
Post Edited (Bean) : 5/13/2010 11:19:50 AM GMT
· I don't see a problem with the SEROUT in a task.
· You do realize that the TX pin will NOT be set HIGH initially in the task ? Pin setup modifier only work in the COG they are defined. Otherwise all cogs would hold pins high, and none of the other cogs could use them. This would explain why when you move the PIN definitions into the TASK it works.
· If this is the case, a simple "HIGH BUSTXPIN" at the beginning of the TASK code might solve the problem.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
I have attached a sample code (for the dupl. DATA error) and screenshot for BST showing the version numbers in the About box (and also the error message at the bottom).
I believe I am using the latest version/s. I am a little curious as to why I seem to get a different error to that mentioned by BradC and Bean. I am running my BST on WinXP, if that makes a difference...
No.
Yes, that's it solved.
I just posted version 00.00.97 of PropBasic yesterday. That is probably why we are getting different error messages.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
Not sure what else could be different... is there a log file somewhere? - maybe that is a question for Brad - not sure...
Anyhow, thanks for your help - this little error message is not a big deal for me, but if I can help with any diagnostics please shout!
bst uses the bstc compiler. It's telling you the bstc compiler version is 0.15.4-pre5.
The unhandled exception error is coming from PropBASIC (bst catches error exit codes and translates them if it knows them). Can you try and compile that file using the PropBASIC .exe file in a cmd prompt window and see what happens?
Oh, now I can reproduce the crash here. Hrm... go figure.. Let me get the details to Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Are you suggesting coconuts migrate?"
using: PropBasic-bst.exe 0_testing.pbas
I get:
ERROR 6 SYNTAX ERROR ;
An unhandled exception occurred at $0041FA69 :
EAccessViolation : Access violation
$0041FA69
$0043F003
$0040B60E
· Okay, I see the problem. I'm throwing a syntax error, but then I go ahead and try to process the LET anyway. No worky... Tries to access pointers that don't exist.
· That will be fixed in the next release.
· Thanks Maxwin for finding that problem.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Are you suggesting coconuts migrate?"
It certainly makes the code source cleaner/leaner/easier to work with IMO; splitting the source to have each COG/TASK in its own file.
I have realised I can move the PIN and CON definitions into the TASK, and it works well unless their is a duplicate CON - then it fails.
1. As CON definitions are by nature CONstant, could the complier NOT issue the "duplicate variable name" error, but instead use some logic that if a TASK has a CON defined, it uses that "local" definition- otherwise it looks in the main code for a CON. Failing that, it errors "unknown variable". A kind of priority system.
2. At the moment, although duplicate CON definitions throw an error, duplicate PIN definitions do NOT (I mean 2 definitions using different PIN alias names but the SAME pin number between a task and main code). IMO that could be a source of future "hickups".
mypin1 PIN 1 HIGH
mytaskpin PIN 1 LOW
3. Is there an argument for allowing HUB/DATA declarations in the attached TASK code? This way a task could be self contained. At the moment I am thinking that DATA should be allowed, but not necessarily HUB variable declarations. As I might like to use a long predefined DATA in a specific task only - but HUB vars probably should be in the main program as by nature they are designed to be shared.
I hope these observations make sense. If we consider programming in a modular fashion, using external task files, then these thoughts might be useful.
HUB vars and DATA can be declared in TASKS. This should not cause any problems.
You can also use LOAD to access commonly used subroutines. If you enclose each subroutine with a '{$IFUSED name} ... {'ENDIF} pair unused subroutines will be stripped and will not take any code space. Note that the LOAD must come at the end of the program so the compiler knows what subroutines were called, and which were not.
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]