Thread: [Flashforth-devel] Elements of FlashForth tutorial
Brought to you by:
oh2aun
From: Peter J. <p.j...@uq...> - 2013-06-04 14:37:55
|
Michael, Peter Z, I have another tutorial document ready for review. http://dropbox.eait.uq.edu.au/e4pjacob/flash-forth/eoff.pdf I couldn't find a tutorial on the language that a beginner might use without having to deal with the differences between a PC environment and the FlashForth-on-a-PIC-microcontroller environment. So I have built a new one, starting from J.V. Noble's primer that is available on line. It has been written with mechatronics students in mind, but it should be suitable for anyone starting with FlashForth. Although a colleague has already provided comments, it could do with further review from experts such as yourselves, if you have time. Cheers, Peter Jacobs. |
From: Pete Z. <pza...@pz...> - 2013-06-08 16:10:48
|
Hi Peter, Not sure I am able to see your new version yet. Only found a few spelling typos in the original. Here are 2 words I find very helpful exploring the usefulness of FlashForth and PIC18 microcontrollers: : .mem ( -- ) \ print current memory locations base @ hex cr ." flash " flash here #4 u.r cr ." eeprom " eeprom here #4 u.r cr ." ram " ram here #4 u.r base ! ; : c?% ( addr -- ) \ print byte contents at addr in binary 2 spaces base @ swap c@ 8 bin u.r base ! ; c?% is useful to look at SFRs. .mem is useful to examine further what Mikael was saying about FORGET vs EMPTY . Side note: I still prefer the original FORTH word COLD to Mikael's EMPTY. Don't leave out DUMP, especially when learning to create arrays and jump tables. Pete Pete Zawasky PZEF Co. 361 Mills RD Oriental, NC 28571 www.pzef.net pza...@pz... 1-252-249-3393 (voice and fax) 1-252-670-6940 (cell) |
From: Peter J. <p.j...@uq...> - 2013-06-11 11:17:01
|
A fresh version is up, using some of your suggestions. http://dropbox.eait.uq.edu.au/e4pjacob/flash-forth/eoff-2013-jun-11.pdf I have to admit to not getting around to fixing the typos, yet. PJ ________________________________________ From: Pete Zawasky [pza...@pz...] Sent: Sunday, June 09, 2013 2:11 AM To: FF mailing list Subject: [Flashforth-devel] Elements of FlashForth tutorial Hi Peter, Not sure I am able to see your new version yet. Only found a few spelling typos in the original. Here are 2 words I find very helpful exploring the usefulness of FlashForth and PIC18 microcontrollers: : .mem ( -- ) \ print current memory locations base @ hex cr ." flash " flash here #4 u.r cr ." eeprom " eeprom here #4 u.r cr ." ram " ram here #4 u.r base ! ; : c?% ( addr -- ) \ print byte contents at addr in binary 2 spaces base @ swap c@ 8 bin u.r base ! ; c?% is useful to look at SFRs. .mem is useful to examine further what Mikael was saying about FORGET vs EMPTY . Side note: I still prefer the original FORTH word COLD to Mikael's EMPTY. Don't leave out DUMP, especially when learning to create arrays and jump tables. Pete Pete Zawasky PZEF Co. 361 Mills RD Oriental, NC 28571 www.pzef.net pza...@pz... 1-252-249-3393 (voice and fax) 1-252-670-6940 (cell) ------------------------------------------------------------------------------ How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j _______________________________________________ Flashforth-devel mailing list Fla...@li... https://lists.sourceforge.net/lists/listinfo/flashforth-devel |
From: Peter J. <p.j...@uq...> - 2013-06-12 14:56:45
|
Pete, Mike, I've put up a (slightly) more polished version. Fixed up some typographical errors and improved (hopefully) the discussion of defining words. I'm happy with it at this point. http://dropbox.eait.uq.edu.au/e4pjacob/flash-forth/eoff-2013-jun-12.pdf Cheers, Peter J. ________________________________________ From: Peter Jacobs [p.j...@uq...] Sent: Tuesday, June 11, 2013 9:16 PM To: Pete Zawasky; FF mailing list Subject: Re: [Flashforth-devel] Elements of FlashForth tutorial A fresh version is up, using some of your suggestions. http://dropbox.eait.uq.edu.au/e4pjacob/flash-forth/eoff-2013-jun-11.pdf I have to admit to not getting around to fixing the typos, yet. PJ ________________________________________ From: Pete Zawasky [pza...@pz...] Sent: Sunday, June 09, 2013 2:11 AM To: FF mailing list Subject: [Flashforth-devel] Elements of FlashForth tutorial Hi Peter, Not sure I am able to see your new version yet. Only found a few spelling typos in the original. Here are 2 words I find very helpful exploring the usefulness of FlashForth and PIC18 microcontrollers: : .mem ( -- ) \ print current memory locations base @ hex cr ." flash " flash here #4 u.r cr ." eeprom " eeprom here #4 u.r cr ." ram " ram here #4 u.r base ! ; : c?% ( addr -- ) \ print byte contents at addr in binary 2 spaces base @ swap c@ 8 bin u.r base ! ; c?% is useful to look at SFRs. .mem is useful to examine further what Mikael was saying about FORGET vs EMPTY . Side note: I still prefer the original FORTH word COLD to Mikael's EMPTY. Don't leave out DUMP, especially when learning to create arrays and jump tables. Pete Pete Zawasky PZEF Co. 361 Mills RD Oriental, NC 28571 www.pzef.net pza...@pz... 1-252-249-3393 (voice and fax) 1-252-670-6940 (cell) ------------------------------------------------------------------------------ How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j _______________________________________________ Flashforth-devel mailing list Fla...@li... https://lists.sourceforge.net/lists/listinfo/flashforth-devel ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Flashforth-devel mailing list Fla...@li... https://lists.sourceforge.net/lists/listinfo/flashforth-devel |
From: Mikael N. <mik...@pp...> - 2013-06-12 17:28:30
|
Some minor comments. Chapter 8 The word ( a left parenthesis followed by a space says disregard all following text until the next right parenthesis OR END OF LINE in the input stream" Table2 leave sets the loop counter to zero, not r@ Chapter12 The compiler word create makes a new dictionary entry using the next name in the input stream and compiles the pointer value of the first free data space location of the current data space context. When executed, the new dictionary entry returns the pointer value. Is that clear or can it be said simpler ? /Mike Chapter 12.3 The word 'of' is missing. Thanks Peter for a really good basic tutorial. I wonder if it could be converted to html and make it readable directly on the web. BR Mike On 06/12/2013 05:56 PM, Peter Jacobs wrote: > Pete, Mike, > I've put up a (slightly) more polished version. Fixed up some typographical errors and improved (hopefully) the discussion of defining words. I'm happy with it at this point. > > http://dropbox.eait.uq.edu.au/e4pjacob/flash-forth/eoff-2013-jun-12.pdf > > Cheers, > Peter J. > > ________________________________________ > From: Peter Jacobs [p.j...@uq...] > Sent: Tuesday, June 11, 2013 9:16 PM > To: Pete Zawasky; FF mailing list > Subject: Re: [Flashforth-devel] Elements of FlashForth tutorial > > A fresh version is up, using some of your suggestions. > > http://dropbox.eait.uq.edu.au/e4pjacob/flash-forth/eoff-2013-jun-11.pdf > > I have to admit to not getting around to fixing the typos, yet. > PJ > > ________________________________________ > From: Pete Zawasky [pza...@pz...] > Sent: Sunday, June 09, 2013 2:11 AM > To: FF mailing list > Subject: [Flashforth-devel] Elements of FlashForth tutorial > > Hi Peter, > > Not sure I am able to see your new version yet. > Only found a few spelling typos in the original. > > Here are 2 words I find very helpful exploring the usefulness of > FlashForth and PIC18 microcontrollers: > > : .mem ( -- ) \ print current memory locations > base @ hex > cr ." flash " flash here #4 u.r > cr ." eeprom " eeprom here #4 u.r > cr ." ram " ram here #4 u.r > base ! ; > > : c?% ( addr -- ) \ print byte contents at addr in binary > 2 spaces base @ swap > c@ 8 bin u.r > base ! ; > > c?% is useful to look at SFRs. > > .mem is useful to examine further what Mikael was saying about FORGET vs > EMPTY . > > Side note: I still prefer the original FORTH word COLD to > Mikael's EMPTY. > > Don't leave out DUMP, especially when learning to create arrays and jump > tables. > > Pete > > Pete Zawasky > PZEF Co. > 361 Mills RD > Oriental, NC 28571 > www.pzef.net > pza...@pz... > 1-252-249-3393 (voice and fax) > 1-252-670-6940 (cell) > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > Flashforth-devel mailing list > Fla...@li... > https://lists.sourceforge.net/lists/listinfo/flashforth-devel > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Flashforth-devel mailing list > Fla...@li... > https://lists.sourceforge.net/lists/listinfo/flashforth-devel > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Flashforth-devel mailing list > Fla...@li... > https://lists.sourceforge.net/lists/listinfo/flashforth-devel > |
From: Pete Z. <pza...@pz...> - 2013-06-12 18:01:32
|
Peter, I think you have put together an excellent tutorial for the students to get started with FlashForth. Mikael's comments are ,as usual, 'spot on'. Hopefully, with a set of well defined labs, they will be able to use the tools of FlashForth and PICs to learn the basics of Mechatronics quickly and clearly. Please let me know if you get this as my SourceForce Mailing List is still not updating properly. Pete On 6/12/2013 10:56 AM, Peter Jacobs wrote: > Pete, Mike, > I've put up a (slightly) more polished version. Fixed up some typographical errors and improved (hopefully) the discussion of defining words. I'm happy with it at this point. > > http://dropbox.eait.uq.edu.au/e4pjacob/flash-forth/eoff-2013-jun-12.pdf > > Cheers, > Peter J. > > _ |
From: Peter J. <p.j...@uq...> - 2013-06-12 21:47:50
|
Thanks Pete. The latest version (June-13) includes Mike's suggestions. Mike, I've also tried the latex2html button in Kile and the resultant HTML files are in the directory eoff/ I don't much like the result but I guess it could be cleaned up. For web-delivered documentation, I usually use Sphinx but it's very Python-oriented. Anyway, these days, I like using the PDF viewer built into Firefox. http://dropbox.eait.uq.edu.au/e4pjacob/flash-forth/ Cheers, Peter J. ________________________________________ From: Pete Zawasky [pza...@pz...] Sent: Thursday, June 13, 2013 4:02 AM To: FF mailing list Subject: Re: [Flashforth-devel] Elements of FlashForth tutorial Peter, I think you have put together an excellent tutorial for the students to get started with FlashForth. Mikael's comments are ,as usual, 'spot on'. Hopefully, with a set of well defined labs, they will be able to use the tools of FlashForth and PICs to learn the basics of Mechatronics quickly and clearly. Please let me know if you get this as my SourceForce Mailing List is still not updating properly. Pete On 6/12/2013 10:56 AM, Peter Jacobs wrote: > Pete, Mike, > I've put up a (slightly) more polished version. Fixed up some typographical errors and improved (hopefully) the discussion of defining words. I'm happy with it at this point. > > http://dropbox.eait.uq.edu.au/e4pjacob/flash-forth/eoff-2013-jun-12.pdf > > Cheers, > Peter J. > > _ ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Flashforth-devel mailing list Fla...@li... https://lists.sourceforge.net/lists/listinfo/flashforth-devel |
From: <hi...@ao...> - 2013-07-13 23:58:39
|
I am working with the servo example at http://flashforth.sourceforge.net/servo.txt and using a PIC 18F4620 running at ~18 Mhz, 9600 BAUD. Does the example assume a given clock rate? If so how can I calculate these for my crystal? Is the part of the code I should be adjusting? Fcy #1000 / con clk/us 0 #1500 clk/us * - con midhi 0 #500 clk/us * - con midlo 0 #12000 clk/us * - con endlo 0 #2000 clk/us * - con stime Many thanks for any direction.. |
From: Mikael N. <mik...@pp...> - 2013-07-15 06:04:09
|
Hi, There is no need to recalculate anything. Fcy has the value Fosc/4. BR Mike On 07/14/2013 02:58 AM, hi...@ao... wrote: > I am working with the servo example at > http://flashforth.sourceforge.net/servo.txt > and using a PIC 18F4620 running at ~18 Mhz, 9600 BAUD. > Does the example assume a given clock rate? If so how can I calculate > these for my crystal? > Is the part of the code I should be adjusting? > Fcy #1000 / con clk/us > 0 #1500 clk/us * - con midhi > 0 #500 clk/us * - con midlo > 0 #12000 clk/us * - con endlo > 0 #2000 clk/us * - con stime > > Many thanks for any direction.. > > > ------------------------------------------------------------------------------ > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > > > _______________________________________________ > Flashforth-devel mailing list > Fla...@li... > https://lists.sourceforge.net/lists/listinfo/flashforth-devel |
From: Mikael N. <mik...@pp...> - 2013-06-05 09:32:06
|
On 06/04/2013 05:37 PM, Peter Jacobs wrote: > Michael, Peter Z, > I have another tutorial document ready for review. > http://dropbox.eait.uq.edu.au/e4pjacob/flash-forth/eoff.pdf > > Although a colleague has already provided comments, it could do with > further review from experts such as yourselves, if you have time. > Cheers, > Peter Jacobs. First of all, thanks for sharing your work, very valuable. One major thing I noticed is how you describe the forget and marker. You have their roles swapped in the document. Marker is best for shrinking the dictionary if you have defined words that allot ram or eeprom memory. For the novice, it is simplest to assume this is always the case. Forget is best used when you know that all the words your are forgetting have only alloted flash memory. It would be best to just leave out forget completely from the tutorial and use marker in all examples. Another thing is the jump table. It is better to store the jump table in flash. Then it works also after a power break. That is also the normal intended usage. It also shows how elegantly FlashForth handles dataspaces in different memory types. This is perhaps the major distinguishing feature of FlashForth and important to understand. \ Set the data space allot context to flash memory flash ok<#,flash> \ Store the execution tokens in a table in flash memory. create actions ' ring , ' open , ' laugh , ' cry , ok<#,flash> \ Set the data space allot context back to ram memory ram ok<#,ram> I'll read further and maybe have some more comments. Best Regards Mikael |
From: Peter J. <p.j...@uq...> - 2013-06-08 11:37:04
|
Mikael, Thanks for the comments and corrections. I've just put a fresh version up. Peter J. ________________________________ From: Mikael Nordman [mik...@pp...] Sent: Wednesday, June 05, 2013 7:12 PM To: fla...@li... Subject: Re: [Flashforth-devel] Elements of FlashForth tutorial On 06/04/2013 05:37 PM, Peter Jacobs wrote: Michael, Peter Z, I have another tutorial document ready for review. http://dropbox.eait.uq.edu.au/e4pjacob/flash-forth/eoff.pdf Although a colleague has already provided comments, it could do with further review from experts such as yourselves, if you have time. Cheers, Peter Jacobs. First of all, thanks for sharing your work, very valuable. One major thing I noticed is how you describe the forget and marker. You have their roles swapped in the document. Marker is best for shrinking the dictionary if you have defined words that allot ram or eeprom memory. For the novice, it is simplest to assume this is always the case. Forget is best used when you know that all the words your are forgetting have only alloted flash memory. It would be best to just leave out forget completely from the tutorial and use marker in all examples. Another thing is the jump table. It is better to store the jump table in flash. Then it works also after a power break. That is also the normal intended usage. It also shows how elegantly FlashForth handles dataspaces in different memory types. This is perhaps the major distinguishing feature of FlashForth and important to understand. \ Set the data space allot context to flash memory flash ok<#,flash> \ Store the execution tokens in a table in flash memory. create actions ' ring , ' open , ' laugh , ' cry , ok<#,flash> \ Set the data space allot context back to ram memory ram ok<#,ram> I'll read further and maybe have some more comments. Best Regards Mikael |
From: Pete Z. <pza...@pz...> - 2013-06-05 13:44:24
|
Hi Peter, Thanks for the link...I will review the tutorial. Having met Julian and Stephen Pelc years ago, I agree they have produced good info on FORTH but I try to recommend other sources also.....Haskell, Ting, figFORTH, eFORTH, etc -- applicable for the microcontroller beginnings and, of course, Kelly and Spies "/FORTH: A Text/ And /Reference/" which I keep handy when working on FORTH stuff. Hope the students are enjoying the interactivity that FlashForth allows. Pete Pete Zawasky PZEF Co. 361 Mills RD Oriental, NC 28571 www.pzef.net pza...@pz... 1-252-249-3393 (voice and fax) 1-252-670-6940 (cell) |
From: Peter J. <p.j...@uq...> - 2013-06-08 11:34:51
|
Peter Z. Thanks for the pointers to other tutorial material. I wasn't aware of Richard Haskell's work. I've found a copy of "The Forth Course" on www.forth.org.<http://www.forth.org.> Unfortunately, Kelly and Spies text is a bit difficult to find. It seems not to be in the libraries that I can easily access. Peter J. ________________________________ From: Pete Zawasky [pza...@pz...] Sent: Wednesday, June 05, 2013 11:32 PM To: FF mailing list Subject: Re: [Flashforth-devel] Elements of FlashForth tutorial Hi Peter, Thanks for the link...I will review the tutorial. Having met Julian and Stephen Pelc years ago, I agree they have produced good info on FORTH but I try to recommend other sources also.....Haskell, Ting, figFORTH, eFORTH, etc -- applicable for the microcontroller beginnings and, of course, Kelly and Spies "FORTH: A Text And Reference" which I keep handy when working on FORTH stuff. Hope the students are enjoying the interactivity that FlashForth allows. Pete Pete Zawasky PZEF Co. 361 Mills RD Oriental, NC 28571 www.pzef.net<http://www.pzef.net> pza...@pz...<mailto:pza...@pz...> 1-252-249-3393 (voice and fax) 1-252-670-6940 (cell) |
From: Pete Z. <pza...@pz...> - 2013-10-17 18:45:12
|
Hi all, I have added some utility files with helpful words (for us) for FF3.81 and FF4.81 on the Wiki. Let me know if they are of any use to you and please add to the Wiki. Pete Pete Zawasky PZEF Co. 361 Mills RD Oriental, NC 28571 www.pzef.net pza...@pz... 1-252-249-3393 (voice and fax) 1-252-670-6940 (cell) |