PDA

View Full Version : PropForth 2.7



prof_braino
05-31-2010, 10:26 AM
Version 2.7 is no long the current release of PropForth
Please see the new thread for PropForth 3.2
http://forums.parallax.com/forums/default.aspx?f=25&m=468264

There is a new version of PropForth on google code http://code.google.com/p/propforth/

PropForth 2.7 has several changes:
fixed the error in the "saveforth" word
updates to documentation
instructions to generate new propforth.spin code

Additional updates to the documentation will be posted in the next week or so,
currently enough is present to get up and running.
Questions and comments are welcome.
Please point out anything that needs clarification.

Notice: PropForth is separate from propellerforth, which unfortunately has not been updated since 2008
and does not have any source available.
PropForth has the spin source posted and can be modified in the source in addition to or in combination with modifying the forth dictionary

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/18/2010 2:11:02 PM GMT

mwalimu
05-31-2010, 11:28 PM
Very nice.

I have a project that the interactivity of FORTH would be helpful, but I need another serial port, one port to monitor the prop, one to communicate with other hardware. Is that possible?

prof_braino
06-01-2010, 11:10 PM
With forth, everything is permitted. The serial driver built into propforth defaults to using cog7 for the default serial channel on pins 30 and 31. The extension serial driver (serial.f) can be loaded and configured to do whatever you want. The author's notes say that the default cog7 running serial communication has lots of power to spare. If you still need more, there is an assembler timeslicer (aslicer.f) that runs BETWEEN FORTH WORDS, while the standard forth round robin multitasker runs runs between task I/O calls. If the round robin multitasker isn't fast enough (although it probably is), the assembler multitasker ought to do it. There's serial monitor (serialmonitor.f) that goes with the other two, but I haven't gotten that far yet. Of course, I don't know what kind of data rate you are requiring of the serial port(s); and I have not done the Maximum Insane Data Rate Throughput Test (MIDRTPT(c)) yet, but if it can be done at all, there is a good chance that it can be done in forth at nearly assembler speed, and in a shorter time than using only assembler. (and any bottle necks can be optimized in assembler, but that's outside my area). If what you want can be done in SPIN, then of course it would be quickest to pull an object from the OBEX.

If you get a change to look at the documentation on the serial.f extension, please post comments and questions. The documentation is being re-written so that an average person other than the author (i.e. me) can understand it, and your questions will move a given topic towards the top of the list.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------
There are 10 types of people in the world,
This who understand binary, and those who don't

Phil Pilgrim (PhiPi)
06-02-2010, 12:26 AM
braino,

Just out of curiosity, why is the serial driver statically assigned to a specific cog? Typically, you do not want to make static cog assignments but, rather, let cognew do the assigning for you. cogstart coginit should almost never be used for starting cogs.

-Phil

Post Edited (Phil Pilgrim (PhiPi)) : 6/1/2010 8:37:59 PM GMT

prof_braino
06-02-2010, 03:10 AM
@Phil

That's a question for Sal Sanci. As far as I know from the comments, Spin starts in cog0, starts the serial driver in cog7, and starts cog6 as a forth cog. The other cogs are idle until you do something in cog 6 to start them as additional (forth) cogs.

I think its might be because this forth is closer to assembler than spin. Forth tends to be "close to the metal". Neither of the words cognew or cogstart appear in the in the source code. This makes sense since those are spin words, and this forth is based on the small section of assembler that precedes "ForthDictStart" in the propforth.spin file. The spin portion only uses coginit and cogstart, if my search tool is working.

All those words to do with controlling cogs from within propforth are implemented in propforth, near as I can tell.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------
There are 10 types of people in the world,
This who understand binary, and those who don't

Phil Pilgrim (PhiPi)
06-02-2010, 03:32 AM
'Sorry, I meant coginit, not cogstart. Being "close to the metal" is no reason to use it instead of cognew. A well-written program should be cog-agnostic, except for storing the cog numbers returned by cognew so that those cogs can be stopped later.

If everybody used coginit, chaos and conflict would reign. cognew prevents that.

-Phil

Post Edited (Phil Pilgrim (PhiPi)) : 6/1/2010 8:38:19 PM GMT

prof_braino
06-02-2010, 05:50 AM
Like I said, that's a question for the author. It looks like coginit was chosen so that a specific cog could be selected. The cogs can be stopped and started using the words provided.

I'm a little hazy to how chaos and confusion reigns as a result of coginit. Do you mean a well written SPIN program should be cog-agnostic?
If this is in the context of running forth as an object under spin, or running spin object under forth, I don't think that is supported in this version.
So far, I've only seen it as "forth only" once propforth is running.

I remember a discussion about an 8 bit token threaded forth built on the spin ROM intended to run under spin and/or call spin object from forth. That would be a later version or even a separate project. Please see update 5 or so posts below

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------
There are 10 types of people in the world,
Those who understand binary, and those who don't

Post Edited (prof_braino) : 6/6/2010 8:36:00 PM GMT

caskaz
06-03-2010, 07:59 PM
Hi.

I'm going to install PropForth, but I'm confused.

On "Getting Started",
Download PropForth.spin
Load into eeprom
Start up TeraTerm

On "VerifyPropforth ",
Upload spinmakerPart1.f to the prop
Upload spinmakerPart2.f to the prop
spinmaker 'rebuilding the entire forth dictionary
copy the output from ForthDictStart to ForthMemoryEnd of spinmaker
output of spinmaker into PropForth-template.spin.



But on "RebuildingPropForth"
Upload PropForthPart1.f and PropForthPart2.f to prop.
load spinmaker
spinmaker


no upload PropForthPart1.f and PropForthPart2.f on "Getting Started",
upload spinmakerPart1.f and spinmakerPart2.f on "VerifyPropforth".

Which is correct way to install?

prof_braino
06-05-2010, 02:25 AM
Use VerifyPropForth

On the page
http://code.google.com/p/propforth/wiki/PropForth
links have been reviewed for the pages
PropForthStatus
GettingStarted
VerifyPropforth
DownloadSourceText
DownloadPropforthSource

Those pages should be clear, correct and accurate for the current version (let me know where they are not and I will fix them)

The remaining links on the page have not been reviewed and may or may not have useful information:

The following pages are under review:

* SavingPropForth
* RebuildingPropForth
* AddingSerialMonitor

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------
There are 10 types of people in the world,
This who understand binary, and those who don't

Post Edited (prof_braino) : 6/4/2010 8:17:32 PM GMT

prof_braino
06-05-2010, 03:12 AM
[A bit more explanation]

The word spinmaker generates the forth definitions that go at the end of the propforth.spin file.

It makes the forth definitions from the forth image that is currently running on the prop. This is what is happening in the VerifyPropForth page.

Here's what was different in the old version:
In the last version of the instructions, the author was trying to demonstrate how one would go about redefining the entire forth image in high level forth (rather than assembler, which the prototypes had been up to that point). This is what was being demonstrated in the RebuildingPropForth page. He just didn't say so. I didn't get it either. that's why we started rewriting the documentation. BUT you can still do it the RebuildingForth way. Anybody that can write a valid forth system can define a forth for the prop IN FORTH, load those definitions into propforth, use spinmaker to make spin code, and generate a eeprom-able image by putting that spin code into the spin code template and loading to the prop using Propeller Tool. We walked through it, and it worked, but figured out that this method is too confusing, so we made the VerifyPropForth page. But both are correct. The thing is, after RebuildingPropForth was done once successfully, there was no longer a need for switch from the assembler to forth, because the starting image is now in forth.

Propforthpart1.f and propforthpart2.f are the original forth definintions that were compiled by the minimal prototype forth kernel to produce the image that became propforth 2.7. After those definitions were compiled into the dictionary, the word "saveforth" was run to save the image into eeprom. Next, the device was rebooted and the definitions for spinmaker were loaded (compiled into the dictionary). The spinmaker word was executed to product a big chunk of text, which was captured from the terminal program screen, and copy and psted into propforth-template.spin, and this resulting file was saved as propforth.spin.

Now, if propforth.spin (downloaded from googlecode) is loaded into a propeller, and spinmaker is loaded and executed, it will produce the exact source text as found in the assembler section of propforth.spin between the ForthDictStart and the ForthMemoryEnd text. Also, these definitions are identical to the definitions in PropForthpart1.f and propforthpart2.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------
There are 10 types of people in the world,
Those who understand binary, and those who don't

Post Edited (prof_braino) : 6/6/2010 8:38:02 PM GMT

jazzed
06-05-2010, 03:44 AM
Phil Pilgrim (PhiPi) said...
A well-written program should be cog-agnostic ...

Hmm....

"Cognostic" - One of a sect of propeller followers who lived near the gushing oil sea in pre-turboprop antiquity in whose writings we find the belief that it is not possible for the creator (of instructions) to produce a perfect system with an affinity to any given cog and such systems tend toward chaos for users more than cogs selected from a pool (just one definition).

Forgive me .... I hope all Forth users find great happiness with PropForth.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Pages: Propeller JVM (http://www.brouhaha.com/~sdenson/PropellerJVM/index.html)

prof_braino
06-07-2010, 03:31 AM
Hi all

Turns out I was mistaken in my previous post, I spoke with the author and have the following corrections:

There is no technical reason why the cogstart command cannot be used rather than the coginit command. For the purpose of propforth 2.7 the author wanted to control exactly which specific cog was performing each specific function, but this need not always be the case.

There is no technical reason why spin cannot call forth, and forth run as any other spin object. The author is defining the method to communicate with forth from spin. These will be posted and documented shortly.

There is no technical reason why forth cannot call spin routines. The author designed propforth to suit his specific need, which could not easily be addressed in spin due to size and timing constraints (or something else). In situations where these constraints are not an issue, it would not cause problems for forth to pass parameters to a spin object, run the spin object and get the results. The author is defining words for this purpose, and they will also be posted and documented shortly.

Propforth 2.8 (or so) should support calling forth from spin, and calling spin from forth. A new thread will be posted when this happens.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------
There are 10 types of people in the world,
Those who understand binary, and those who don't

caskaz
06-13-2010, 11:06 AM
Hi.

I have question.




Cog6 ok
16 16 st?
ST: 00000016 00000016
Cog6 ok
+ st?
ST: 0000002C
32 32 st?
ST: 0000002C 00000032 00000032
+ st?
ST: 0000002C 00000064
+ st?
ST: 00000090
Cog6 ok




16 + 16 = 2C
32 + 32 = 64

Display for result is decimal or hex?
Is this bug?
Or another reason?

caskaz

kuroneko
06-13-2010, 11:44 AM
16 + 16 = 2C
32 + 32 = 64


The first is only true for hex, the latter is true for both decimal and hex. Provided the base isn't changed behind the scenes and/or without user interaction you end up with hex as the common denominator.

Not sure if it's implemented (it should) but try



base .


and see what it says.

caskaz
06-13-2010, 12:12 PM
Hi, Thanks.




base .
UNDEFINED WORD base
Cog6 ok

caskaz
06-13-2010, 03:07 PM
decimal
Cog6 ok
16 16 st?
ST: 00000010 00000010
Cog6 ok
+ st?
ST: 00000020
Cog6 ok

hex
Cog6 ok
16 16 st?
ST: 00000016 00000016
Cog6 ok
+ st?
ST: 0000002C
Cog6 ok




I check word.
: hex 10 mcwBase w! ;
: decimal A mcwBase w! ;
I seem to be word"decimal" operate like to be "hex".
Operation of word"hex" is strange.

kuroneko
06-13-2010, 06:02 PM
caskaz said...
I check word.
: hex 10 mcwBase w! ;
: decimal A mcwBase w! ;
I seem to be word"decimal" operate like to be "hex".
Operation of word"hex" is strange.

Looks fine to me. mcwBase holds the current numeric base (10 for decimal, 16 for hex etc). If you switch to decimal then all I/O is treated as decimal. st? uses .long internally which always outputs in hex. So entering 16 16 st? will display 00000010 00000010 which is expected. Maybe you should start using dup . instead of st? (I'm aware that st? prints the whole stack, point is that . honours the current base).

In the second example you switch to hex so the st? output matches your input more closely. HTH

caskaz
06-13-2010, 07:32 PM
Thanks, kuroneko.
Sorry, it's my misunderstanding.

prof_braino
06-13-2010, 08:23 PM
The strange looking names for some (most) of the standard words, like "BASE" being:

mcwBase

are an artifact of design considerations of the previous propject, spinforth. In that project, the author intended to have each forth running an independent dictionary in each cog. The naming convention selected for that purpose is more or less decribed in the comments at the beginning of

Propforth.spin

The experience form the spinforth project indicated that a more efficeint method would be to have a common dictionary, and any special words that need to be optimized or reduced in size be implemented in assembler (which is how this is usually done in forth) and these optimized assembler definitions could then reside only in the cogs where they are needed. This simplifies the overall structure of the new version propforth, and still allows special words in each cog as needed.

The next version of propforth (3.0 possibly) is to have different names such that it will be closer to a standard forth, where "mcwBase" will be renamed BASE, cog memory access will be @ and ! as these are long only; HUB memory access will be something like C@ C! W@ W! L@ L! for byte, word and long access, and only prop-specific words to support standard words will be in lowercase.

At this time, this work is not complete. In addition to the items described, there are other issues due to the unique nature of the prop that need to be worked through.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------
There are 10 types of people in the world,
Those who understand binary, and those who don't

Post Edited (prof_braino) : 6/13/2010 1:57:41 PM GMT

prof_braino
06-13-2010, 08:39 PM
The word "st?" displays the current stack in hex, formatted to 8 digits.
This forth defaults in hex, and the code expects the base to be set to hex at this point.

One of the planned changes for version 3.0(?) is to implement more standard words like
.S etc

If you are interesting in helping with the work on the "standard forth" version of PropForth, please send me a message.
Your inputs would be appreciated.

Tasukarimasu Arigato

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------
There are 10 types of people in the world,
Those who understand binary, and those who don't

caskaz
06-15-2010, 01:18 PM
Hi.
I checked about mcwBase.
But same as hex and decimal.
What's wrong about my idea?





hex
Cog6 ok
mcwBase w@ . cr
10
Cog6 ok

decimal
Cog6 ok
mcwBase w@ . cr
10
Cog6 ok

kuroneko
06-15-2010, 01:30 PM
caskaz said...
I checked about mcwBase.
But same as hex and decimal.
What's wrong about my idea?

Nothing wrong with it, well, depends on what you expect. The fact is that the numeric base printed in said base is always 10, i.e. 16 (hex) printed in hex is ($)10, 10 (decimal) printed in decimal is 10, 2 (binary) printed in binary is (%)10 etc. Try this word (untested):



: current_base mcwBase dup w@ dup decimal . swap w! ;

Post Edited (kuroneko) : 6/15/2010 6:37:01 AM GMT

caskaz
06-15-2010, 01:55 PM
Kuroneko-san, Thanks.
I see reading your explanation.
Your word works.

I checked below;



hex
Cog6 ok
mcwBase w@ st? cr
ST: 00000010

Cog6 ok
decimal
Cog6 ok
mcwBase w@ st? cr
ST: 00000010 0000000A

Cog6 ok

caskaz
06-15-2010, 06:42 PM
Hi.
I try to blink LED.
But LED not blink.
After word "blink", Forth cogs 4 - 6. 1 cog used?

And I made blink.f to adding "FL". But loaded it, message was "UNDEFINED WORD".
What's wrong?




Forth cogs: 5 - 6
PropForth v2.7 2010MAY26 14:50 1
Cog6 ok

wvariable T
Cog6 ok
wvariable dT
Cog6 ok
wvariable value
Cog6 ok
: blink decimal 1 value ! 40000000 dT ! 1 dira ! value outa ! cnt T !
7 0 do
value invert outa !
waitcnt T @ dT @
loop ;
Cog6 ok
blink
Forth cogs: 4 - 6
PropForth v2.7 2010MAY26 14:50 1
Cog6 ok




caskaz

Post Edited (caskaz) : 6/15/2010 11:47:17 AM GMT

kuroneko
06-15-2010, 09:44 PM
Your main problem are addresses and/or their values. Try this (demoboard pin 16):



: blink hex 10000 dup outa ! dira !
cnt @ 0 m@ +
7 0 do
0 m@ waitcnt
outa dup @ invert swap !
loop drop ;

prof_braino
06-15-2010, 10:31 PM
caskaz said...
Hi.
I checked about mcwBase.
But same as hex and decimal.
What's wrong about my idea?





hex
Cog6 ok
mcwBase w@ . cr
10
Cog6 ok

decimal
Cog6 ok
mcwBase w@ . cr
10
Cog6 ok






Something like this might go in "developer extensions" if you have such a thing

"Period" character in the front of a word means "print ..."



: .BASE mcwBase w@ hex ." Base is " \ get current base, switch to hex
dup 10 = if ." Hex " else
dup A = if ." Decimal " else
dup 2 = if ." Binary " else
." unusual " then then then
mcwBase w! ; \ restore original base


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------
There are 10 types of people in the world,
Those who understand binary, and those who don't

caskaz
06-18-2010, 06:40 AM
Thanks kuroneko-san, prof_braino.

caskaz
06-19-2010, 01:56 PM
Hi.
I try to make lcd-driver.
Although success to send cammnad for lcd, parameter not yet.

I tested below: (trying to write data[$77] to v-ram[42768bytes])



lcd_initial
Cog6 ok
: test 5C command A710 0 do 77 dup parameter loop ;
Cog6 ok
test
Forth cogs: 4 - 6
PropForth v2.7 2010 May26 14:50 1
Cog6 ok




Why PropForth is reset?
And using cog increase from cog:5-6 to cog:4-6.

LCD is displyes initial v-ram's status(red/blue/green's dot).
I think command-sending is success because command(display on/off, display invert/normal) is good.




FL

: command
2 mpxl 4 mpxl \ A0 = L WRX = L
3 lshift outa @ or outa ! \ outa <-- data
4 mpxh 2 mpxh \ WRX = H A0 = H
FFFFF807 outa @ and outa ! \ D0 - D7(P3 - P10) clear
;

: parameter
4 mpxl \ WRX = L
3 lshift outa @ or outa ! \ outa <-- data
4 mpxh \ WRX = H
FFFFF807 outa @ and outa ! \ D0 - D7(P3 - P10) clear
;

: lcd_initial 0 b 0 do dup pxo 1+ loop drop \ P0 - P10 output set
1 dup mpxh mpxl \ RESX P0 = H to L
2 mpxh \ A0 P1 = H
4 mpxh \ WRX P2 = H
1 del_ms
1 mpxh \ RESX P0 = L
1 del_ms
94 command \ Sleep Disable
AF command \ Display On
;




caskaz

Post Edited (caskaz) : 6/19/2010 7:04:12 AM GMT

kuroneko
06-19-2010, 02:11 PM
: test 5C command A710 0 do 77 dup parameter loop ;


As far as I can tell parameter consumes a single parameter from the stack. Given that you duplicate the 77 inside the loop you're probably running out of stack. Just get rid of the dup.

prof_braino
06-19-2010, 08:43 PM
caskaz said...
Hi.



test
Forth cogs: 4 - 6
PropForth v2.7 2010 May26 14:50 1
Cog6 ok




Why PropForth is reset?
And using cog increase from cog:5-6 to cog:4-6.


[/code]

caskaz


When a word executes and causes a stack underflow or overflow, and affects more than the first stack item, the cog is reset.
reset also actives the next cog as a forth cog. There are other conditions that cause resets, but not all are documented.

This looks like one of your words has an error.

The messages indicate the severity or result of the error. However, the MEANING of the messages is not yet documented.
But here's what I think it means:
The entire propeller might not have reset. Resting the entire propeller would not have displayed cogs 4-6, it would have displayed 5-6
So just the cog reset, but word that had an issue had some bad effect beyond that one cog, and recovery involved a bit more than resetting the single cog.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------
There are 10 types of people in the world,
Those who understand binary, and those who don't

caskaz
06-20-2010, 09:54 AM
Hi.
Thanks kuroneko-san.



: test 5C command 77 A710 0 do dup parameter loop drop ;




Thanks prof_braino.
In case of executing wrong code, finally massage is " Forth cogs: 0 - 6".
Actually proceeding cogs: 0 - 6?




cog?
Forth cogs: 0 - 6
Cog6 ok








ffcog w@ wvariable ffcog ffcog w!



Definition of ffcog is different. no : and ;.
I cannot understand word-ffcog.
ffcog call onself by ffcog?

Post Edited (caskaz) : 6/20/2010 5:20:45 AM GMT

prof_braino
06-21-2010, 02:25 AM
caskaz said...
Hi.
In case of executing wrong code, finally massage is " Forth cogs: 0 - 6".
Actually proceeding cogs: 0 - 6?


The default propforth.spin starts with the spin interpreter in cog0. It loads an assembler routine which is that forth kernel running the serial driver in cog 7. It also starts a forth kernel on cog6. So you start out talking THROUGH the cog7 forth kernel running the serial driver TO the forth kernel running on cog6, although it appears as though you are talking directly to cog6.

If the running cog has an error, the forth kernel resets itself and starts another forth cog. Since you indicate that there are six forth cog running, I would guess that you have been running several words, and maybe there was an error, at least six times. So at this point there are actually cogs 0-6 running forth kernels that you can experiment with, and cog 7 handling the serial communications.

At this point, you might want to reboot the prop, and reload the words that you know are working correctly, and continue from that point.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------
There are 10 types of people in the world,
Those who understand binary, and those who don't

prof_braino
06-21-2010, 02:53 AM
caskaz said...
Hi.




ffcog w@ wvariable ffcog ffcog w!



Definition of ffcog is different. no : and ;.
I cannot understand word-ffcog.
ffcog call onself by ffcog?


Good question. This is an example of the chicken and egg problem when making a new version of forth using the running version of forth.
It is also an example of the author's personal coding style, and why we are reviewing and editing for clarity.

ffcog is a 2 byte variable that is a stoarge loaction for the number of the first forth cog. This variable will probably be renamed FirstForthCog
When the spinmaker runs, it makes code for the the currently running image. What you see here is part of the process of RE-DEFINING a new forth image on top of a running forth image.

In this case, I would re-format and comment it like this:



ffcog w@ \ get the current value stored in variable ffcog an put it on the stack
wvariable ffcog \ define a new variable ffcog to hold the number of the FirstForthCog in the new version of propforth
ffcog w! \ Store the number of the FirstForthCog of the currently running kernel that was left on the stack into
\ the new variable FirstForthCog that will exist in the next version, as generated by spinmaker




When all the definition of the new forth image are compiled and running, spinmaker is executed. IT gets all the (NEW) currently running words and makes code for them. It only sees the most recent definition of ffcog. This is what gets pasted into Propforth-template.spin

This is how the word ffcog is carried into the next iteration of the forth kernel in propforth

Now you might ask, "If spinmaker only sees the most recent definition, and ffcog is the same, why redefine it at all? Why not just leave the old version or ffcog and let spinmaker use that?" There could be a technical reason that this is necessary, or its possible this was done to account for the all words needed, or possibly it is simply unnecessary and can be removed. We will determine if it is needed and document why; or remove it, in the next review cycle.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------
There are 10 types of people in the world,
Those who understand binary, and those who don't

Post Edited (prof_braino) : 6/20/2010 8:07:55 PM GMT

prof_braino
06-21-2010, 03:04 AM
FYI - WE started the first pass of the next version of propforth. Propforth3.0 uses the standard names for the forth words implemented, as defined in DPANS94. The plan is to use long, descriptive names in the HAL (hardware application layer) words that implement the standard forth words on the prop. The plan also includes implementing a scheme such that the long names do not take up dictionary space on the prop.

So please bear with the cryptic names for a little bit longer. When the next version is done and documented, things should be much clearer.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------
There are 10 types of people in the world,
Those who understand binary, and those who don't

tmaynard
07-04-2010, 08:50 AM
While I'm pretty sure I have downloaded, compiled, and burned v2.7 of PropForth before ... I'm having problems now.

I downloaded a fresh copy (from code.google.com), compiled it with the Propeller Tool, and pressed F11 to burn the EEPROM.

When I connect to it with Tera Term (57600, 8-bit, 1-stop, no flow) it keeps saying:




PropForth v2.7 2010MAY26 14:50 0
Cog6 oŻForth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6




And doesn't respond to any keyboard input. What can possibly be wrong? It's a simple compile/burn step, and I have Tera Term configured properly (obviously, since it's talking to me) ... but it's not acting properly. Any ideas?

Tom.

[EDIT: This appears to be a power problem -- low battery on the PEKit -- I rewired the PEKit to a known good 9V supply and am getting good results. Add this info to the FAQ if you desire. This probably explains a number of other problems I've been having.]

Post Edited (tmaynard) : 7/4/2010 1:57:47 AM GMT

prof_braino
07-04-2010, 08:37 PM
I'm glad you found the cause of the problem.

The "Forth cogs: 5 - 6" message is displayed when cog7 (which is running the serial communications between the user terminal and a forth cog) starts and discovers which cogs are running forth. The default is that only cog6 is a forth cog. If there is an error, like a stack overrun/under-run, the cog with an error is reset and another cog is launched as a forth cog. The new forth cog is the diagnostic message that tells you something failed. This was done by the author as a convenience to whatever he was making at the time, and is still used to indicate something (unexpected) happened.

Your case is unusual in that it keeps repeating but does not add any more forth cogs. So it makes sense that it was a power issue. I will pass this on to Sal and put something in the FAQ.

So I also guess that you don't have a stock demo board nor a proto board. Can I log that propforth 2.7 has been successfully run on a properly assembled and powered PE kit?


tmaynard said...
While I'm pretty sure I have downloaded, compiled, and burned v2.7 of PropForth before ... I'm having problems now.

I downloaded a fresh copy (from code.google.com), compiled it with the Propeller Tool, and pressed F11 to burn the EEPROM.

When I connect to it with Tera Term (57600, 8-bit, 1-stop, no flow) it keeps saying:




PropForth v2.7 2010MAY26 14:50 0
Cog6 oŻForth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6
Forth cogs: 5 - 6




And doesn't respond to any keyboard input. What can possibly be wrong? It's a simple compile/burn step, and I have Tera Term configured properly (obviously, since it's talking to me) ... but it's not acting properly. Any ideas?

Tom.

[EDIT: This appears to be a power problem -- low battery on the PEKit -- I rewired the PEKit to a known good 9V supply and am getting good results. Add this info to the FAQ if you desire. This probably explains a number of other problems I've been having.]

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------
There are 10 types of people in the world,
Those who understand binary, and those who don't

tmaynard
07-04-2010, 09:01 PM
prof_braino said...
So I also guess that you don't have a stock demo board nor a proto board. Can I log that propforth 2.7 has been successfully run on a properly assembled and powered PE kit?

Yes. I have the Propeller Education Kit -- PropStick USB version (although it doesn't differ from the DIP-40 version in any significant way). With the PEKit you are free to connect anything anywhere you like, but after completing the PEKit Labs (if you don't undo anything) you'll have LEDs on P4..P9, pushbuttons on P21..P23, and several other components scattered about the protoboard (piezo speakers, IR LED, potentiometers, etc.).

The whole shebang is powered by an external 9V battery, and that was the source of my problem. While the battery had sufficient charge to illuminate the Power LED, it seems it didn't have enough to drive the Prop, um, "properly." Switching to a wall-wart supply solved this (and several other) problems that surfaced recently.

Thanks for your input -- I was intrigued by the messages I was getting -- and I look forward to experimenting with PropForth.

Tom.
P.S. FWIW, I have defined a new helper word



: |< ( n -- )
1 swap lshift
;



But I haven't had time to study all the existing words so this may be redundant.
[EDIT: It is. The existing word >m does this.]

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cat .sig > /dev/null

Post Edited (tmaynard) : 7/4/2010 10:07:02 PM GMT

prof_braino
07-11-2010, 02:44 AM
Version 2.7 is no longer the current PropForth

Please see the thread for PropForth 3.2
You can download the new version as a complete archive from google code

http://code.google.com/p/propforth/

I will unsubscribe to this thread, if you have any questions on version 2.7 please send me a message directly.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------
There are 10 types of people in the world,
Those who understand binary, and those who don't