PropForth 3.2 is available
prof_braino
Posts: 4,313
Please note: PropForth 3.4 is now the current release as of 2010-Sept-05
http://forums.parallax.com/showthread.php?p=936909#post936909
The new version of PropForth is available on Google code
http://code.google.com/p/propforth/
The PropForth version 3.2 file set is a single archive download.
This version uses descriptive names and a (hopefully) clearer naming convention.
The README.txt file included in the archive includes a list of the name changes to help bring forward any existing code.
There are 10 types of people in the world,
Those who understand binary, and those who don't
http://forums.parallax.com/showthread.php?p=936909#post936909
The new version of PropForth is available on Google code
http://code.google.com/p/propforth/
The PropForth version 3.2 file set is a single archive download.
This version uses descriptive names and a (hopefully) clearer naming convention.
The README.txt file included in the archive includes a list of the name changes to help bring forward any existing code.
There are 10 types of people in the world,
Those who understand binary, and those who don't
Comments
Sounds like a typo. Can you let me know where you saw it so I can take a look at it?
[noparse][[/noparse]edited after examination]
I think I found what you were referencing:
http://code.google.com/p/propforth/wiki/PropForthTechnicalDocumentation
had the explanations swapped for $C_ and $H_. It is fixed now, the explanation is consistent with the actual code and how you would expect it.
Thanks for pointing this out. We don't have the resources to to review everything properly, so this kind of error can slip by.
If something looks kooky, it's probably a mistake; just let me know and I'll fix it.
cheers!
Braino
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
Post Edited (prof_braino) : 7/12/2010 2:53:17 AM GMT
I think that I have been all through the PropForth google site and I have been so far unable to find a doc or a list that contains the PropForth dictionary. I am particularly interested in the Prop's uniquenesses, i.e., setting pins as I or O, reading/setting pins, grouping pins as a single variable, access to counters, etc ... is there such a doc?
Keep up the great work ...... cheers ... BBR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
The Shoppe at Wulfden
www.wulfden.org/TheShoppe/
www.wulfden.org/TheShoppe/prop/ - Propeller Products
www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear
What would be real useful would be a simple archive that contains all of·PropForth's how-to pages.·That would be useful, especially if your latest version significantly morphs away from the older version and the how-to's·no longer match.
Post Edited (Fred Hawkins) : 7/12/2010 9:59:42 PM GMT
Nb:those last 2 links don't work. Both files are inside the both the 3.2 and 2.7 download archives under the same names. (in other words keep the versions·separate)
Post Edited (Fred Hawkins) : 7/12/2010 9:56:11 PM GMT
What he said! +1
cheers ... BBR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
The Shoppe at Wulfden
www.wulfden.org/TheShoppe/
www.wulfden.org/TheShoppe/prop/ - Propeller Products
www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear
Could one of you guys show some simple code to do BlinkLED ? say, blink an LED on pin 4, 1/2 second on, 1 second off in an endless loop.
Thanks in advance ... BBR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
The Shoppe at Wulfden
www.wulfden.org/TheShoppe/
www.wulfden.org/TheShoppe/prop/ - Propeller Products
www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear
Type in
words
at the forth prompt, this gives the entire dictionary in order
Also, all the source for the words is in PropForthPart1 and PRopForthpart2
The structure of the dictionary and the tasker is in propforth.spin but we didn't have any questions on that yet, so we didn't add any comments to the original
You can get nearly all the forth books online as pdf downloads.
Oh, I see Fred already responded. Glad to see this is getting used a little.
Cheers guys!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
This is what I used with PropForth v2.5 for the 'make and LED blink' thread. http://forums.parallax.com/forums/default.aspx?f=25&p=1&m=427618
There are two examples, the first one is long with many comments, the second one is for when you want to make life miserable for the next person that has to read it. I think the word 'variable' needs to change to 'wvariable' but you get the idea. They are pretty straight forward let me know if you have problems.
\ FLASH AN LED using PROPFORTH 2.5 (new version of salsanci spinforth 1.1, not propellerforth from Cliffe Biffle)
\ load PropForth.spin into eeprom and use teraterm 1 ms per char and 1 ms per line 38400 baud worked best for me
\ save as file and "send file" in teraterm
\ unmodified demo board
\ sorry but I didn't get the parenthesis comments to work so the
\ stack notes are at the end of each line (it looks funny to me, too)
\ I always put in too many comments, force of habit [noparse]:)[/noparse]
\
\ each unit of functionality is implemented as a single word
\ when each word is functioning correctly, string them together
variable w-delay \ ( uses w@ w! time delay in milliseconds )
: !DELAY w-delay w! ; \ ( ms - ) ( store the milliseconds to wait )
: .DELAY w-delay w@ del_ms ; \ ( - ) ( wait for milliseconds in delay )
: pin16-output 10000 dira ! ; \ ( - ) ( make pin16 output )
: pin16-hi 10000 outa ! ; \ ( - ) ( make pin16 high LED ON )
: pin16-lo 0 outa ! ; \ ( - ) ( make pin16 low LED OFF )
\ ... string them together...
: flash16 pin16-hi .DELAY pin16-lo .DELAY ; \ ( - ) ( flash LED using DELAY )
\ ... and put it in a loop
: FLASHES pin16-output 0 do flash16 loop ; \ ( number of flashes desired - )
\ After one has determined what code is needed, it is possible to
\ cram everything into a single word
\ doing everything all in one word is sometimes refered to as
\ write only code (write once - edit never again )
\ this takes slightly less space but can be confusing on larger applications
\ after the code has been left alone for a few days
: ALL-ONE-WORD \ ( flashes - )
10000 dira ! \ ( make pin16 output )
0 do \ flashes to 0 DO ...
10000 outa ! \ ( make pin16 high LED ON )
100 del_ms \ ( delay for 100 ms)
0 outa ! \ ( make pin16 low LED OFF )
100 del_ms
loop ;
10 ALL-ONE-WORD
\ next use the other method
50 !DELAY
20 FLASHES
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
Thanks for the help ... I have 3.2 up and running on an old demo board (rev B 32k EEPROM) Does PropForth make use of a 64K EEPROM? I have several PropPlatforms with 2 64K EEPROMS is there any mods that would make use of the extra space?
"Starting Forth" is only available on the web as HTML ... no coherent PDF. When my copy arrives I will make it a point to attempt to do as many of the exercises using just PropForth and see how far I get.
cheers ... BBR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
The Shoppe at Wulfden
www.wulfden.org/TheShoppe/
www.wulfden.org/TheShoppe/prop/ - Propeller Products
www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear
The only other thing I can think of is there might be something about the end of eeprom memory. There is either a constant for the max address, or it just goes and goes until it runs out (and crashes) and the user is responsible for keeping track if there is enough space. We tested in parallel and my demo board ran out of space once when I tried to load a particularly huge file using the FL (file load) command. But this is solved by breaking large files into smaller files and loading in multiple FL steps. You probably won't encounter these issues until you get further alone in experimenting, by which point it might be apparent what to do. In any case post issues and we will fix 'em.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
Post Edited (prof_braino) : 7/13/2010 1:42:22 PM GMT
This is something we are trying to do, but it keeps getting away from us due to the trade-off of new functionality versus complete documentation. Unfortunately, the documentation is trailing the code. Since we have limited resources, we only address items that are brought to our attention and thus placed near the top of the list. Your comments are driving corrections, the most specific comments and questions have the best chance of getting addressed sooner.
I haven't had time to go through all Sal's original documentation (v2.4) and decode it into earth-speak, and therefore have not updated some to version 2.5, 2.7 or 3.2.
Also, I haven't deleted anything, since key information is present, I just don't understand it yet. So it has been left as a reference in case someone smarter than I can use it. Old versions can be accessed through the search filter "DEPRACATED" in google code.
What I have done is add information to the Main Page http://code.google.com/p/propforth/wiki/PropForth
and to the FAQ http://code.google.com/p/propforth/wiki/PropForthFAQ
The links listed on the Main Page if read in the sequence presented, should get you to the current state of the project (if the documentation is "clear and unambiguous", please point out where it is otherwise). The links on the main page listed as "under review" may or may not be useful, please read them if you get that far and post if there are problems.
The FAQ was up-to-date as of v2.7. As questions come in (like these) I will start adding the v3.2 section at the top, and tagging the old answers in the v2.7 section that that will be the existing stuff and leave this at the bottom. Possibly later today.
If you look at the wiki tab and try to read any of the pages that are NOT linked from the main page, you will most likely run across stuff that is out of date or inaccurate. If you would please let me know the problems, I can ask specific questions and post the answers.
What I am asking for: Please flag the specific instances that cause you an issue, and post or PM to me or to the page (using 'comments' st the bottom)
Note: The author, Sal Sanci, only does the low-level stuff (the fun part), and leaves the higher level testing, documentation and posting (the other fun part) to me. So I have to understand an issue enough to ask a specific question, otherwise the issue might not make it to the top of the fix-this-today list.
Note to self: I should probably add all this to the FAQ, and edit this out when its done.
Cheers
braino
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
I updated v3.2.
And I changed lcd.f to v3.2. (mpxl->_maskoutlo @->COG@ mpxh->_maskouthi !->COG! pxo->pinout del_ms->delms)
lcd.f work fine on v2.7.
Loaded lcd.f, error occurred.
Message:
Cog6 ok
: command
2 _maskoutlo 4 _maskoutlo 3 lshift outa COG@ or outa COG! 4 _maskouthi 2 _maskouthi FFFFF807 outa COG@ and outUNDEFINED WORD out
Cog6 ok
Changed comment out "FFFFF807 outa COG@ and outa COG!" on word command, error has gone.
Why does error occur?
It work fine after deleting 2-space-character in front of "FFFFF807 outa COG@ and outa COG!".
I think WordPad is bad.
And I have question.
I' m going to make array of bitmap for LCD(132dot X 162dot) and font data for character.
How does array make?
caskaz
cheers ... BBR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
The Shoppe at Wulfden
www.wulfden.org/TheShoppe/
www.wulfden.org/TheShoppe/prop/ - Propeller Products
www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear
1. Note that you can get the UNDEFINED WORD message if the serial transmission is garbled, usually this does not happen when typing, but if you paste to tera terminal and do not your the FL (file-load) command at the start of the text pasted you can get serial overrun.
2. When you use the fl command (file load) it streams the pasted text into a temporary area which is unused EEPROM, and then interpreters the pasted text from EEPROM, then releases the EEPROM back to unused space. BUT at one time the temporary buffer manager did NOT SET the pointer for the TEMPORARY BUFFER back when it releases the EEPROM. So after multiple pastes using fl, it thinks it ran out of EEPROM. I thought Sal fixed this but maybe this bug got back into the code. Please check if this is a factor and please inform me.
3. WordPad also causes problems; I use PSPad http://www.pspad.com/ as my editor as it was free and the first thing that came up on google.
4. The word "create" make a new dictionary entry as in
create MyArray
The word "allot" allocates space in the dictionary as in
10 allot
so the full usage would be
the number base defaults to hex so 10 means 16 decimal,
and the amount allocated is in words (I believe) so this will allocate 16 words in the data dictionary which is hub memory (accessed via W@ and W!);
but I haven't used it yet and Sal is on holiday, so please experiment and post if reality is different than my explanation
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
Post Edited (prof_braino) : 7/14/2010 11:00:30 PM GMT
Thanks prof_braino. Sorry,I can't understand.
I used "Send File" on Tera Term to upload lcd.f to Prop.
I thought lcd.f uploaded to Prop's RAM.
My idea is wrong?
I try "create MyArray 10 allot".
caskaz
Post Edited (caskaz) : 7/15/2010 12:45:09 AM GMT
Thanks Brian
I'd like to post your updates to these words on the google code site when I start the examples page
Is it worthwhile to have two examples, 'ALL-ONE-WORD' vs the step-by-step-by construction of 'FLASHES' ?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
Ah... Excellent, we have found something that is not clearly stated in the documentation, thank you very much.
This is the issue:
PropForth does not implement any flow control on the serial communication at this time, so it is possible to overrun the buffers.
This is actually documented in the comments, but I read it and didn't catch it either, so I need to A) update the instructions and b) figure out a nice flow control
Normally, typing will NOT overrun the input buffer, as the prop is faster than you type BUT
If you send a big chunk of text to propforth, it interprets the text same as if you typed it, BUT
when it gets to the end of a definition (the semicolon ';') propforth has to write to the dictionary, and processing the new dictionary entry takes a little more time than reading in characters.
After several lines (definitions), the interpreter lags behind the buffer, and a couple characters get lost. In your case, the interpreter did not see 'outa', it saw 'out~~~~' due to the garbled data from the buffer overrun. (my guess).
So, why does the author Sal permit this to happen? Turns out, he never send more than one line text directly into the interpreter, so this in never an issue for him.
When he want to compile a file of text, he put 'fl' at the beginning of the text, and buffers it to unused eeprom
Then these lines are buffered in the unused EEPROM
This process allows one to paste entire files up to 26,000 character long to the propforth command prompt (the interpreter)
The blue LED on the demo board flashes while the text is writing to EEPROM,
then the RED LED flashes as each line of text is displayed at the forth prompt and the interpreter responds with
after each line. If the interpreter does not respond with 'ok' after a line, there was an error and usually (always so far) it means there was an error in your code, and interpretation stops, and the rest of the definitions are discarded.
Saving the text to EEPROM (the fl command) happens as fast as the text comes in, and propforth interprets the text from EEPROM at it own speed, so there is no problem.
Sal found this 'buffer to unused EEPROM' method easier than implementing flow control. Probably this seems kooky, (I thought so too) but it works after you get used to it.
SO TO SUMMARIZE:
Try to use the fl command at the begin of a section of code that you PASTE into tera term,
try NOT to use teraterm's built in send-file feature.
This should eliminate the UNDEFINED WORD error you saw when the 'outa' word was trying to compile.
Using the fl command should fix it.
[noparse][[/noparse]edit]
Sorry, I forgot your listing includes the fl command at the top as it should.
The fl command is placed at the begining of the text pasted into the teraterm window, but the fl method is not tested with uploading a file using teraterm's upload file feature.
If you paste the text in your listing into teraterm, you should not experience the issue I described.
If you still have problems, we have found another bug, privat message me and we will work through it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
Post Edited (prof_braino) : 7/15/2010 1:46:12 AM GMT
By all means YES! Now, reminding you again of my Forth newby-ness and total rank beginner at PropForth, the differences between the two ways to express it taught me a lot.
In fact several things I learned from that allowed me to create the words I needed to get through the first two chapters of exercises in "Starting Forth".
cheers ... BBR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
The Shoppe at Wulfden
www.wulfden.org/TheShoppe/
www.wulfden.org/TheShoppe/prop/ - Propeller Products
www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear
Hopefully, the wiki listing code.google.com/p/propforth/w/list is the simplest archive that contains all the how-to and instructions. Most of the version tags have now been updated to show what has been modified for version 3.2
Most of the google code pages for propforth code.google.com/p/propforth/ have been updated to include the comments and responses I have received up to and including version 3.2.
If you follow the links from the main page code.google.com/p/propforth/wiki/PropForth in order, and come back to the previous page when you finish a page, you'll get the information in the same order that I constructed it. To me, this is the logical flow. Try this if the wiki listing doesn't get you what you want.
The links to files that are still present and not deprecated pages from previous versions should still be relevant.
If you notice anything that looks odd in a way that is not typical for forth to look odd, please post or send me a message and I will fix it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
I don't think anyone would mind if the snapshot lags the wiki as long as it does keep up with the major versions.
I had a bunch of questions about all this but that was in the fast reply box - so I'll settle for a simple "what gives?"
Meanwhile, oh joy: diving into eewritepage and friends in propforth1.f --- ahhhhhhhhhhhhh ooo murky waters indeed
It is an error in my notes. Thanks for sorting this out, I had a question about this and was waiting for Sal to get back from vacation to ask it.
Please confirm this agrees with the data sheets:
The 32k eeprom can do 64 byte page writes, and not 128 byte page writes.
The 64k eeprom can to 128 byte page writes, as well as 64 byte page writes.
If so, the propforth is set to 64 byte page writes, as it is intended to work for both parts, and didn't in a previous version.
Does your application have a problem with the 64 byte page writes? I was under the impression the code works on both parts and just keep doing pages of the specified size until it runs out of data or hits the end of the EEPROM.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
I do buffer_display after I put " buffer 9 W!".
But value of buffer is not changed.
Why doen't value change?
(I think I am getting an understanding of the wiki now: we have Propforth/Sal/Prof_Braino/wiki and depending on where you sit, you get a different view. Works for me. And worth mentioning: Good job guys.)
·
Thanks! And thanks again for you comments. Sal does the design; I ask him the questions, and write on the wiki. All typos are mine.
The EEPROM write word does a maximum or 512 pages writes of 64 bytes on a 32k EEPROM, and does a maximum of 1024 page writes of 64 bytes on a 64k EEPROM.
Sal indicated the EEPROM write routine is driven by the amount of data. That is, If you give it 123 bytes, it does two 64 byte writes. It just keeps doing 64 byte page writes to EEPROM until it runs out of data. When we tried to write 33k to my board (32k EEPROM), it crashed (locked up and had to be power cycled), but his board (64k EEPROM) had no problem.
When we tried 65k, both boards locked up.
So as I understand it, the EEPROM write routine just goes and goes until it runs out of data. If it hits the end of EEPROM, crash. No safety, no checking, no warnings. Programmer is responsible for understanding what he's asking. You can put checking in, but I think it would slow it by a factor of 2 or something, and so be aware it might interfere with the fl (load text file into EEPROM as a temporary buffer for interpretation) word.
If you do the 'saveforth' word, you should see it print out a bunch of periods as it it 'saveforth'ing. Each period represents a (64 byte) EEPROM page write. So you should be able to calculate and verify using the 'free' word that the number of periods corresponds to the bytes written.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
cheers ... BBR
'' ==============================================
''
'' File....... sd_saveforth.spin (Brian Riley = 19 July 2010)
''
'' So you are using PropForth and you build up a good dictionary and use the
'' "saveforth" command to save it to the EEPROM. That's nice so long as you
'' are not working on anything else. Suppose you have a second piece of code,
'' completely different, how do you switch back and forth without extensive
'' cut and paste or file loads. This hack lets you dump the EEPROM to a file
'' on an SD card which can leter be reloaded to EEPROM from your desktop/laptop
''
'' SD_SaveForth is a hack adapting sdloader to read a forth image in lowEEPROM
'' and write a binary file to an SD card. THIS IS A QUICK HACK ... it works.
''
'' I plan to make it more elegant. I took the foundation code of sdloader,
'' commented out the main routine and put in sd_saveforth. So once again, kudos
'' to Mike Green and his great FemtoBasic SD/EEPROM routines
''
'' This hack requires an SD/uSD card adapter and an SD/uSD card. No SDHC
'' SD adapter pins may be non-sequential - see code
''
'' Load this program to RAM ONLY! Otherwise you will kill the EEPROM image
'' that you are trying to harvest.
''
'' Once again ... DO NOT LOAD THIS PROGRAM INTO EEPROM!!!!!!
''
'' Writes a file named FORTH.IMG to SD card. Take SD card to computer and copy
'' it over and rename it FORTH.binary. Then at some time later it can be restored
'' to EEPROM from BST or the Prop Tool.
''
'' ==================================================
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
The Shoppe at Wulfden
www.wulfden.org/TheShoppe/
www.wulfden.org/TheShoppe/prop/ - Propeller Products
www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear