 |
|
 |
| Parallax Forums > Public Forums > Propeller Chip > Download PropBASIC here... 00.01.02 July 20, 2010 | Forum Quick Jump
|
|  Bean Forum Moderator

       Date Joined Jul 2004 Total Posts : 6367 | Posted 12/23/2009 12:40 PM (GMT -7) |   | | *** NOTICE ***
The GetAddr command has been changed to a function in version 00.00.97.
Instead of "GetAddr hubvar, longvar" use "longvar = GetAddr hubvar"
and get the latest version of BST. The .exe version is for windows, Linux for linux and osx for macintosh.
and make sure you get the latest version of PropBASIC for BST.
Extract both files.
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.
You are now ready to use PropBASIC.
Documentation and demos are available at the bottom of this post.
As well as the PASD debugger (for windows only sorry).
======================================================================
I'm hoping you guys will try it out and let me know about any bugs you find.
I figured most people have a lot of time off work with the holidays, so I wanted to get this out there so you could play around with it.
Make sure you run the PropBASICIDE program. This is the front-end / editor for propbasic.
With in the editor you can select "Compile" this compiles and opens the .spin file in the Propeller Tool.
Select "Run", this uses propellent to compile and run the program from RAM.
Select "EEPROM" to burn the program into the EEPROM so it will run at power-up.
Sorry about the limited documentation, Jon (Jonny Mac) is working on some much better documentation.
P.S. Make sure to check out the demo programs in the demos folder.
If you have any questions please ask.
Thanks,
Bean.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - There are two rules in life:
1) Never divulge all information
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - If you choose not to decide, you still have made a choice. [RUSH - Freewill] Post Edited (Bean) : 7/21/2010 9:37:08 PM GMT File Attachment : PropBASIC_Syntax_Guide_0x13.pdf 1.58Mb (application/pdf) This file has been downloaded 1355 time(s). File Attachment : PASD_062.zip 249KB (application/x-zip-compressed) This file has been downloaded 347 time(s). File Attachment : PropBASIC.pdf 293KB (application/pdf) This file has been downloaded 472 time(s). File Attachment : Demos.zip 29KB (application/x-zip-compressed) This file has been downloaded 31 time(s). | | Back to Top | | |
  |  JonnyMac Registered Member

       Date Joined Jun 2006 Total Posts : 2456 | Posted 12/23/2009 12:49 PM (GMT -7) |   | | For those that have their own favorite text editor, you can use that, too. I have been using EditPlus to write, compile, and download my PropBASIC programs (downloading handled by connecting to Propellant). | | Back to Top | | |
 |  Rsadeika Registered Member
        Date Joined Feb 2005 Total Posts : 801 | Posted 12/23/2009 1:46 PM (GMT -7) |   | I have a question about the serin/serout commands, does it use a cog to accomplish the deed. I can visualize a program where I might be using two 'task's, and each 'task' would be be using separate sets of pins for the serin/serout commands. So, how many cogs would be involved? A general question would be, are there any commands that use a cog(s), in order to work?
Hopefully in your future version of the IDE, you might have a tally of how many cogs are being used, along with ram usage. I have not coded a program just yet, but it feels familiar. I am sure I will have more questions. Looks good so far Bean.
Ray | | Back to Top | | |
   |  Rsadeika Registered Member
        Date Joined Feb 2005 Total Posts : 801 | Posted 12/23/2009 3:46 PM (GMT -7) |   | Another serin/serout question, can the 'pin', and 'baud' values be variables? So, you have something like 'serin inpin, baudrate, inbyte', in a function or a subroutine. If I have a UART subroutine or function, using the serin/serout commands, will I be able to call the UART from within TASK's, with each TASK using a different set of pins, and only using the one subroutine/function? I am wondering if there will be a collision, if the TASK's try to run the UART subroutine/function at the same time?
I am getting ready to do some testing of the SD card that I have, what would be the recommended way of setting up a program to accomplish this. Since the existing code is an object, propBASIC is not capable of handling existing objects, or is it?
Have you considered adding an ADC command? I have another test scenario where I want to check the charge level of a battery. I am thinking of a 'voltage divider' setup, and an ADC command that would use only one pin for the incoming data.
Ray | | Back to Top | | |
   |  JonnyMac Registered Member

       Date Joined Jun 2006 Total Posts : 2456 | Posted 12/23/2009 4:38 PM (GMT -7) |   | Rsadeika said... Another serin/serout question, can the 'pin', and 'baud' values be variables? So, you have something like 'serin inpin, baudrate, inbyte', in a function or a subroutine. If I have a UART subroutine or function, using the serin/serout commands, will I be able to call the UART from within TASK's, with each TASK using a different set of pins, and only using the one subroutine/function? I am wondering if there will be a collision, if the TASK's try to run the UART subroutine/function at the same time?
I am getting ready to do some testing of the SD card that I have, what would be the recommended way of setting up a program to accomplish this. Since the existing code is an object, propBASIC is not capable of handling existing objects, or is it?
Have you considered adding an ADC command? I have another test scenario where I want to check the charge level of a battery. I am thinking of a 'voltage divider' setup, and an ADC command that would use only one pin for the incoming data.
Ray
You've actually jammed a whole bunch of questions into one -- I can help (a little). With SERIN and SEROUT you can presently use a variable pin but you need to use a constant for the Baud (mode and speed) setting -- for most programs this will be fine. It would take a redesign of the SERIN/SEROUT code to support a variable baud, and I think it would generate more code, perhaps significantly more.
For the time being, you can do something like this:
' Use: TX_BYTE txpin, byteout ' -- shell for SEROUT ' -- allows selection of TX pin for multiple devices ' -- Baud is set as program constant
SUB TX_BYTE SEROUT __param1, Baud, __param2 ENDSUB This lets you direct your output to any pin -- given a fixed Baud setting. Again, Baud represents bot the mode (T, N, OT, or ON) and the speed (bps).
You could create tasks to handle serial IO that buffer the data; I would suggest one per device. Still, you could use some cute trickery with hub variables to control where a task sends something (I think it would create more problems than solve, however).
SD card support requires a significant chunk of code; have a look at the FSRW object for Spin to see for yourself.
Bean wrote a demo (that's in his ZIP) that demonstrates using one of the counters as an ADC -- have a look at sndmeter.pbas | | Back to Top | | |
 |  Rsadeika Registered Member
        Date Joined Feb 2005 Total Posts : 801 | Posted 12/23/2009 5:07 PM (GMT -7) |   | That is what I was referring to, the FSRW object, that could be be a major project in itself, to convert it to propBASIC. The other major project could be, some propBASIC code for the use of the upcoming Memory Expansion Board. Hopefully propBASIC will be able to handle the expanded memory capabilities. Or will it? If we have to start rewriting all the existing object code to propBASIC, isn't that going backwards? And, in that case, will there be a propBASIC section in the object exchange?
Ray | | Back to Top | | |
 |  BR Omelette du fromage!

       Date Joined Dec 2008 Total Posts : 42 | Posted 12/23/2009 5:13 PM (GMT -7) |   | Bean, Jon: Wow! VERY nice work! My Prop demo board suddenly looks like a stamp on steroids.
I downloaded PropBasic and ran through most of the demos in less than 5 minutes. Setup was a breeze (there wasn't any). I glanced through the manual that comes with the package, but it really wasn't necessary because the thing is virtually self-documenting. IDE simple, clean, completely intuitive. And the Pbasic syntax is quite easy to digest anyway. The in-line basic-to-PASM conversion is really neat, a great way to bust down that PASM learning curve barrier. Not to mention this should be handy for whipping up quickie assembly routines for inclusion into other Spin projects.
And this thing is FREE!? | | Back to Top | | |
 |  JonnyMac Registered Member

       Date Joined Jun 2006 Total Posts : 2456 | Posted 12/23/2009 5:20 PM (GMT -7) |   | | | |
 |  Bean Forum Moderator

       Date Joined Jul 2004 Total Posts : 6367 | Posted 12/23/2009 5:50 PM (GMT -7) |   | PropBASIC cannot run spin code. So the existing objects cannot be used as is. If you look at the Mouse_to_PC demo, I took the existing mouse object and modified it slightly to work with PropBASIC.
PASM code will need slight modifications, spin code will need to be completely re-written.
The best present I could get right now is some cool PropBASIC programs. Or believe it or not some bugs discovered (I know there are some in there).
Jon needs to be commended on his dedication to the documentation. He is not being paid for all his hard work, and I kept changing/adding features on him.
I know I should have waited until his documentation was completed, but I really wanted the bugs to be found sooner rather than later.
And this is the best time of year to check members with lots of free time being off work for a couple days.
My hope is that the compiler will be useful enough to warrent inclusion in the Propeller tool.
We shall see, I just need to get Ken and some of the Parallax employees hooked on it.
Bean.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Post Edited (Bean (Hitt Consulting)) : 12/24/2009 12:58:50 AM GMT | | Back to Top | | |
   |  JonnyMac Registered Member

       Date Joined Jun 2006 Total Posts : 2456 | Posted 12/23/2009 7:25 PM (GMT -7) |   | Bean has done the heavy lifting, creating the compiler and putting up with my "suggestions."  | | Back to Top | | |
  |  Bob Zero Registered Member
        Date Joined Dec 2009 Total Posts : 1 | Posted 12/24/2009 3:29 AM (GMT -7) |   | | Thank you very much . I just bought a Chameleon PIC system with PIC24 and Propeller from XGS and this is the cherry on top . | | Back to Top | | |
 |  Rsadeika Registered Member
        Date Joined Feb 2005 Total Posts : 801 | Posted 12/24/2009 7:57 AM (GMT -7) |   | I have a question about the COUNTERA/COUNTERB command, which mode would I use to check the values of a voltage divider? I set up a little test to check the charge level of a battery (9V), in this case. The battery is at 6.76V, and with my voltage divider the value is 2.83V, I am using 10K resistors to achieve this. There are a lot of 'mode' selections, and I am not sure what they all mean, like 'POS', is that 'point of sale' LOL. I guess I need a mode that would give me the value, that would make sense, in the program, for checking the charge level.
Thanks Merry Xmas to everyone! | | Back to Top | | |
 |  pmrobert Registered Member
        Date Joined Apr 2008 Total Posts : 72 | Posted 12/24/2009 9:31 AM (GMT -7) |   | The Prop has no internal ADCs. You can either use a sigma delta technique or a separate ADC chip to convert your divider output to a digital form the Prop can understand. Merry Xmas back to you! | | Back to Top | | |
 |  Bean Forum Moderator

       Date Joined Jul 2004 Total Posts : 6367 | Posted 12/24/2009 9:35 AM (GMT -7) |   | Rsadeika, Use mode 72 (POSFB). You'll need to use two pins. Look at the sndmeter demo program and the demo board schematic. It uses microphone built into the demo board and samples it.
The demo board uses P8 for the feedback pin, and P9 for the output pin.
You would keep the 100K resitor, and the two 1nF caps. And connect the output of your voltage divider to the point where all three come together (so you'll have 6 leads together).
You may need to adjust the values of your voltage divider (keeping the ratio the same) to get a good voltage range when you read it.
Bean
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Post Edited (Bean (Hitt Consulting)) : 12/24/2009 5:34:07 PM GMT | | Back to Top | | |
 |  JonnyMac Registered Member

       Date Joined Jun 2006 Total Posts : 2456 | Posted 12/24/2009 10:52 AM (GMT -7) |   | | | |
 |  TonyWaite Registered Member
        Date Joined Sep 2009 Total Posts : 170 | Posted 12/24/2009 1:08 PM (GMT -7) |   | I've a question regarding PropBASIC:
Could there be a workaround - however rough - that would enable one to include the functionality of some of our favorite Obex utilities?
Perhaps a template written in Spin to behave as the 'wrapper'; calling in a variety of Spin objects from the Obex, including of course the compiled output of the main application written in PropBASIC?
It may be inelegant, but it would be a very useful kludge.
T o n y | | Back to Top | | |
  | 572 posts in this thread. Viewing Page : | | Forum Information | Currently it is Thursday, July 29, 2010 5:16 PM (GMT -7) There are a total of 462,439 posts in 62,066 threads. In the last 3 days there were 90 new threads and 802 reply posts. View Active Threads
| | Who's Online | This forum has 20143 registered members. Please welcome our newest member, ME01. 52 Guest(s), 9 Registered Member(s) are currently online. Details John Abshier, Rayman, kf4ixm, BradC, Sapieha, Gene Bonin, laser-vector, localroger, Nick McClick |
Forum powered by dotNetBB v2.42EC SP2.02 dotNetBB © 2000-2010 |
|
|