flashforth-devel Mailing List for FlashForth: for PIC and Atmega (Page 40)
Brought to you by:
oh2aun
You can subscribe to this list here.
2011 |
Jan
|
Feb
(22) |
Mar
(3) |
Apr
(4) |
May
(6) |
Jun
(8) |
Jul
|
Aug
(6) |
Sep
|
Oct
(20) |
Nov
(9) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(4) |
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
(14) |
Nov
(1) |
Dec
|
2013 |
Jan
(4) |
Feb
(5) |
Mar
(4) |
Apr
(2) |
May
|
Jun
(29) |
Jul
(7) |
Aug
|
Sep
(20) |
Oct
(9) |
Nov
(2) |
Dec
(7) |
2014 |
Jan
|
Feb
(23) |
Mar
(113) |
Apr
(25) |
May
(31) |
Jun
(9) |
Jul
(47) |
Aug
(15) |
Sep
(1) |
Oct
(4) |
Nov
(8) |
Dec
(3) |
2015 |
Jan
(21) |
Feb
(1) |
Mar
(18) |
Apr
(16) |
May
(100) |
Jun
(33) |
Jul
|
Aug
(10) |
Sep
(8) |
Oct
(7) |
Nov
(5) |
Dec
|
2016 |
Jan
(12) |
Feb
(9) |
Mar
|
Apr
(7) |
May
(5) |
Jun
(9) |
Jul
(1) |
Aug
(2) |
Sep
(17) |
Oct
(3) |
Nov
|
Dec
|
2017 |
Jan
(6) |
Feb
(12) |
Mar
(9) |
Apr
(3) |
May
(7) |
Jun
|
Jul
(12) |
Aug
|
Sep
(13) |
Oct
|
Nov
|
Dec
(10) |
2018 |
Jan
(1) |
Feb
|
Mar
(7) |
Apr
(4) |
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(21) |
Oct
(3) |
Nov
|
Dec
|
2019 |
Jan
(5) |
Feb
(4) |
Mar
|
Apr
|
May
(3) |
Jun
(11) |
Jul
(4) |
Aug
(6) |
Sep
(3) |
Oct
|
Nov
(9) |
Dec
(7) |
2020 |
Jan
(2) |
Feb
(3) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(4) |
Dec
|
2021 |
Jan
|
Feb
|
Mar
(8) |
Apr
(40) |
May
(12) |
Jun
|
Jul
|
Aug
(3) |
Sep
(3) |
Oct
(4) |
Nov
(10) |
Dec
(4) |
2022 |
Jan
(29) |
Feb
(7) |
Mar
(10) |
Apr
|
May
(3) |
Jun
(3) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(6) |
2023 |
Jan
(8) |
Feb
|
Mar
(5) |
Apr
(9) |
May
(6) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
(9) |
Aug
(7) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Pete Z. <pza...@pz...> - 2013-06-11 12:40:12
|
I agree completely concerning the PIC18. The 8bit processors are the ones to use for starting the students in the world of embedded control. The price and capabilities of the PIC18 family coupled with FlashForth create a very impressive controller package with real-time development thrown in. FORTH has always had a bit of a steep introductory learning curve, but then the language becomes very easy to use and one can concentrate on the hardware. Your tutorial will help greatly to start to learn to use FF3.8 . One point to make here is how easy it is to then move to say a PIC30 (16bit) and FlashForth 4.8 after starting on a PIC18 and FlashForth 3.8 . Pete On 6/11/2013 4:22 AM, Peter Jacobs wrote: > I think that it would be good to add this definition of the scale operator to math.txt and to continue to develop FF3.8 (and its supporting documentation). The PIC18 is a nice family of microcontrollers. It's very easy to get started with them. > Peter J. > ________________________________________ > From: Pete Zawasky [pza...@pz...] > Sent: Tuesday, June 11, 2013 1:49 AM > To: FF mailing list > Subject: Re: [Flashforth-devel] */ missing? > |
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-11 08:22:54
|
I think that it would be good to add this definition of the scale operator to math.txt and to continue to develop FF3.8 (and its supporting documentation). The PIC18 is a nice family of microcontrollers. It's very easy to get started with them. Peter J. ________________________________________ From: Pete Zawasky [pza...@pz...] Sent: Tuesday, June 11, 2013 1:49 AM To: FF mailing list Subject: Re: [Flashforth-devel] */ missing? Hi Lowell, I have */mod in the math.txt distributed in FF3.8..... So: : */ ( n1 n2 n3 -- quotient ) */mod swap drop ; My choice lately is to move to FF4.8 (*/ and */mod are in it) and 16bit PICs. Pete On 6/10/2013 11:14 AM, Lowell Brunson wrote: > I am running version 3.8 on a PIC18. Although words.txt (and some of the > PDF documents) show the existance of */ and */mod I don't see it either > in the source code or in the dictionary. All I see is u*/mod. I need a > signed version. Any suggestions? > > Lowell > > > ------------------------------------------------------------------------------ > > > ------------------------------------------------------------------------------ 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: Pete Z. <pza...@pz...> - 2013-06-10 17:10:49
|
Hi Lowell, I have */mod in the math.txt distributed in FF3.8..... So: : */ ( n1 n2 n3 -- quotient ) */mod swap drop ; My choice lately is to move to FF4.8 (*/ and */mod are in it) and 16bit PICs. Pete On 6/10/2013 11:14 AM, Lowell Brunson wrote: > I am running version 3.8 on a PIC18. Although words.txt (and some of the > PDF documents) show the existance of */ and */mod I don't see it either > in the source code or in the dictionary. All I see is u*/mod. I need a > signed version. Any suggestions? > > Lowell > > > ------------------------------------------------------------------------------ > > > |
From: Pete Z. <pza...@pz...> - 2013-06-10 15:50:50
|
Hi Mikael, I was hoping you would comment...... Sounds like a very good idea to check out. Pete On 6/10/2013 10:04 AM, mik...@pp... wrote: > You could try to edit the FF wiki on sourceforge. > > I think all SF members have edit rights. > > That would be a goof place to have code examples. > > BR Mikael > > ----Original Message---- > From: pza...@pz... > Date: Jun 10, 2013 15:38 > To: "FF mailing list"<fla...@li...> > Subj: Re: [Flashforth-devel] FF and PIC processors > > Hi Lowell, > > Nice of you to offer....It would be nice if we had a place for > FlashForthers to easily post snippets of code to share. > In the mean time, at least we have the forum and discussion areas Mikael > has provided us here on SourceForge. > > Pete > > > On 6/8/2013 10:02 PM, Lowell wrote: >> If anyone is interested, my versions of arrays include an array length >> element and when I access the array I coerce the return value to come >> from the array. That way, if you are using the array for a jump >> table, you can't accidently jump to an illegal location by using a bad >> index. I use this for finite state machines. >> > |
From: Pete Z. <pza...@pz...> - 2013-06-10 15:48:48
|
Hi Lowell, I have */mod in the math.txt distributed in FF3.8..... So: : */ ( n1 n2 n3 -- quotient ) */mod swap drop ; My choice lately is to move to FF4.8 (*/ and */mod are in it) and 16bit PICs. Pete On 6/10/2013 11:14 AM, Lowell Brunson wrote: > I am running version 3.8 on a PIC18. Although words.txt (and some of the > PDF documents) show the existance of */ and */mod I don't see it either > in the source code or in the dictionary. All I see is u*/mod. I need a > signed version. Any suggestions? > > Lowell > > > ------------------------------------------------------------------------------ > > > |
From: Lowell B. <low...@gm...> - 2013-06-10 15:14:47
|
I am running version 3.8 on a PIC18. Although words.txt (and some of the PDF documents) show the existance of */ and */mod I don't see it either in the source code or in the dictionary. All I see is u*/mod. I need a signed version. Any suggestions? Lowell |
From: <mik...@pp...> - 2013-06-10 14:04:28
|
You could try to edit the FF wiki on sourceforge. I think all SF members have edit rights. That would be a goof place to have code examples. BR Mikael ----Original Message---- From: pza...@pz... Date: Jun 10, 2013 15:38 To: "FF mailing list"<fla...@li...> Subj: Re: [Flashforth-devel] FF and PIC processors Hi Lowell, Nice of you to offer....It would be nice if we had a place for FlashForthers to easily post snippets of code to share. In the mean time, at least we have the forum and discussion areas Mikael has provided us here on SourceForge. Pete On 6/8/2013 10:02 PM, Lowell wrote: > If anyone is interested, my versions of arrays include an array length > element and when I access the array I coerce the return value to come > from the array. That way, if you are using the array for a jump > table, you can't accidently jump to an illegal location by using a bad > index. I use this for finite state machines. > ------------------------------------------------------------------------------ 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: Pete Z. <pza...@pz...> - 2013-06-10 12:38:04
|
Hi Lowell, Nice of you to offer....It would be nice if we had a place for FlashForthers to easily post snippets of code to share. In the mean time, at least we have the forum and discussion areas Mikael has provided us here on SourceForge. Pete On 6/8/2013 10:02 PM, Lowell wrote: > If anyone is interested, my versions of arrays include an array length > element and when I access the array I coerce the return value to come > from the array. That way, if you are using the array for a jump > table, you can't accidently jump to an illegal location by using a bad > index. I use this for finite state machines. > |
From: Pete Z. <pza...@pz...> - 2013-06-09 01:18:06
|
Hi Peter, 1. DUMP in FF3.8 requires lengths in multiples of $10. e.g. here $0f dump nothing printed. here $10 dump for 1 line of print. 2. For the math words, look at Mikael's file 'math.txt' Double and mixed math words -------------------------------------------------------------------------------- math.txt --------- */ ( n1 n2 n3 -- quotient ) */mod swap drop Multiply n1 and n2 then divide by n3. 32 bit intermediate result. */mod ( n1 n2 n3 -- rem quot ) Multiply n1 and n2 then divide by n3. 32-bit intermediate result. /mod ( n1 n2 -- rem quot ) 16/16 -> 16-bit signed division. fm/mod (d n -- rem quot ) Floored 32/16 -> 16-bit division. m* ( n n -- d ) Signed 16*16->32 multiply. mod ( n1 n2 -- remainder ) Remainder of n1 divided by n2. sm/rem ( d n -- rem quot ) Symmetric 32/16 -> 16 bit division. 3. Most people who have used FORTH for a while will have a "toolkit" of words they developed over time and particular applications. Here is mine for FF 3.8 Utility words -------------------------------------------------------------------------------- util38.txt --------- forget <name> ( -- ) Forget name. .mem ( -- ) HEX print of current memory locations; FLASH, EEPROM, RAM. <= ( n1 n2 -- flag ) Leave true flag if n1 less than or equal to n2. ?dup ( x -- 0 | x x ) Conditionally duplicate the top item on the stack, if its value is non-zero. blanks ( c-addr u -- ) Fill u bytes with $20 starting at c-addr. fill ( c-addr u c -- ) Fill u bytes with c starting at c-addr. erase ( c-addr u -- ) Fill u bytes with $00 starting at c-addr. pick ( xu ... x0 u -- xu ... x0 xu ) Place a copy of the nthstack entry on top of the stack. 0 pick is equivalent to dup. ? ( addr -- ) Print unsigned contents at addr in the current base. c? ( addr -- ) Print byte contents at addr in the current base. c?% ( addr -- ) Print byte contents at addr in binary. array ( n -- ) Compile a word which creates n cell indexed arrays. compile-time n array <name> where n is size of array run-time i <name> where i is the array index and i is zero based (0...n) carray ( n -- ) Compile a word which creates n indexed character arrays. compile-time n carray <name> where n is size of array run-time i <name> where i is the array index and i is zero based (0...n) I will try to send you this file, but I may have to send it directly to you, not through SourceForge. 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) On 6/8/2013 1:53 PM, Peter Jacobs wrote: > Peter, > > I checked by downloading the file after I put it in place so my guess is that your browser is offering up a cached copy. To get around the browser being too smart, I've made a copy of the same file to eoff-2013-jun-08.pdf. That should appear new to your browser. > > I'll play with the words you sent below. Being fairly new to Forth, I am still being surprised by how neat these little utility words are. Is there a collection of such things that is generally available? > > I'm also still learning how much there is to cover in a tutorial. Although I have been trying to limit the document to about 20 pages (so it's not so daunting for the students) I'm open to being more inclusive for this document or for a follow-on document. > > As for dump, I was going to include it but I didn't get it to work as I expected > marker -play ok<$,ram> > $ff93 3 dump ok<$,ram> > create a-array 3 , 2 , 1 , 0 , ok<$,ram> > a-array 8 dump ok<$,ram> > a-array @ . 3 ok<$,ram> > I'm probably just doing it wrong but I also had trouble finding the words mod /mod */ */mod for the single signed numbers. Any hints? > > Peter J. > > |
From: Peter J. <p.j...@uq...> - 2013-06-08 17:53:56
|
Peter, I checked by downloading the file after I put it in place so my guess is that your browser is offering up a cached copy. To get around the browser being too smart, I've made a copy of the same file to eoff-2013-jun-08.pdf. That should appear new to your browser. I'll play with the words you sent below. Being fairly new to Forth, I am still being surprised by how neat these little utility words are. Is there a collection of such things that is generally available? I'm also still learning how much there is to cover in a tutorial. Although I have been trying to limit the document to about 20 pages (so it's not so daunting for the students) I'm open to being more inclusive for this document or for a follow-on document. As for dump, I was going to include it but I didn't get it to work as I expected marker -play ok<$,ram> $ff93 3 dump ok<$,ram> create a-array 3 , 2 , 1 , 0 , ok<$,ram> a-array 8 dump ok<$,ram> a-array @ . 3 ok<$,ram> I'm probably just doing it wrong but I also had trouble finding the words mod /mod */ */mod for the single signed numbers. Any hints? Peter J. ________________________________________ From: Pete Zawasky [pza...@pz...] Sent: Sunday, June 09, 2013 1:58 AM To: FF mailing list Subject: [Flashforth-devel] FF and PIC processors 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: 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: Pete Z. <pza...@pz...> - 2013-06-08 15:58:24
|
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-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: 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-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: 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-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: Mikael N. <mik...@pp...> - 2013-04-20 15:14:46
|
The problem is that that the return stack save buffer is too small (15 cells). The TYPE in OK executes PAUSE which writes the HW return stack to the user area return stack buffer, which overflows to the beginning of the parameter stack. If you change in p18f-main.cfg: #define RETURN_STACK_SAVE_SIZE d'30' ; 15 cells return stack save area to #define RETURN_STACK_SAVE_SIZE d'62' ; 31 cells return stack save area Have not tried it, but I think this should fix your problem. Mikael On Sat, 2013-04-20 at 17:59 +0300, Mikael Nordman wrote: > Finally I had some time to look at this problem. > > Your code works well on the PIC24 FF4.8 so it seems to be fault in the > FF3.8 for PIC18. > > I will check it further. > > BR Mikael > > > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > _______________________________________________ > Flashforth-devel mailing list > Fla...@li... > https://lists.sourceforge.net/lists/listinfo/flashforth-devel |
From: Mikael N. <mik...@pp...> - 2013-04-20 14:59:34
|
Finally I had some time to look at this problem. Your code works well on the PIC24 FF4.8 so it seems to be fault in the FF3.8 for PIC18. I will check it further. BR Mikael |
From: <mik...@pp...> - 2013-03-22 08:40:08
|
Hi, I would not use INTERPRET for handling text protocols. You will not get a robust solution. If an unknown word is received the interpreter will do an ABORT and QUIT so that your program is interrupted. I would instead parse the string and use N= or COMPARE to compare each received string and execute a corresponding word. BR Mikael ---------------------------------------------------------------------------------------------------------------------------------------------- Hello All ! Does anybody can help me with problem ? for the 18F4685 board with f3.8 uart the task is to communicate with modem , i ve wrote the word to process modem answers as words and execute them. the first word from modem answer have to be interpreted with addr and length of remaining string on stack for ex an answer : OK AAA have to be interpreted as : execute word OK with addr and length of string AAA on stack here the test code : ------------------------------------------------------------------------------------------------------ -simcom marker -simcom hex ram create fpd 2 allot create inbuf 128 allot create npd 2 allot create outbuf 128 allot \ xu ... x0 u -- xu ... x0 xu : pick 2* 3 + sp@ swap - @ ; \ \ process answer from modem first word interprets as command , \ and remaining string addr2 and length n2 on stack as parameters \ to command \ : A2> ( a n a1 n1 -- a n a2 n2 a1 n1 ) dup >r over >r tuck + ( a n a1 n1 -- ... ) swap 2 pick swap - ( ... -- a n a2 n2 ) r> r> ( ... -- a n a2 n2 a1 n1 ) ; : proc_answ ( a n -- a2 n2 ) \ save variables 'source 2@ >r >r >in @ >r over over ( a n -- a n a n ) 'source 2! 0 >in ! ( a n a n -- a n ) \ get first word $20 parse ( a n c -- a n a1 n1 ) A2> ( a n a1 n1 -- a n a2 n2 a1 n1 ) cr ." Start INTERPRET: ------- " sp@ u. ." --------- " .s interpret ( a n a2 n2 a1 n1 -- a n ) cr ." End INTERPRET: ------- " sp@ u. ." -------- " .s \ restore variables r> >in ! r> r> 'source 2! ; \ \ : eee 90 ms ." AT+CPIN?" inbuf dup 100 accept ( -- a n ) proc_answ ( a n -- a n ) cr ." TP1 AFTR PROC------------------- " cr .s cr ; -testw marker -testw : LOG cr ." LOG s:" .s ; : OK ( a n a2 n2 -- a n ) cr ." TP2 exec +CPIN? : " cr .s LOG 1 2 3 + ; : OK2 ( a n a2 n2 -- a n ) cr ." TP2 exec +CPIN? : " cr .s LOG ; ------------------------------------------------------------- the problem is : when OK executes from eee via interpret and do something with stack, it always change two bottom stack elements 0 0 0 0 0 eee prompt >AT answer >OK ........some debug output......... ok<$,ram>1952 e 0 0 0 f178 2 f17a 0 1 5 0 0 0 0 0 eee AT OK2 ........some debug output ..... ok<$,ram>0 0 0 0 0 f178 2 f17a 0 Thank you in advance |
From: Max S. <max...@gm...> - 2013-03-18 19:05:04
|
Hello All ! Does anybody can help me with problem ? for the 18F4685 board with f3.8 uart the task is to communicate with modem , i ve wrote the word to process modem answers as words and execute them. the first word from modem answer have to be interpreted with addr and length of remaining string on stack for ex an answer : OK AAA have to be interpreted as : execute word OK with addr and length of string AAA on stack here the test code : ------------------------------------------------------------------------------------------------------ -simcom marker -simcom hex ram create fpd 2 allot create inbuf 128 allot create npd 2 allot create outbuf 128 allot \ xu ... x0 u -- xu ... x0 xu : pick 2* 3 + sp@ swap - @ ; \ \ process answer from modem first word interprets as command , \ and remaining string addr2 and length n2 on stack as parameters \ to command \ : A2> ( a n a1 n1 -- a n a2 n2 a1 n1 ) dup >r over >r tuck + ( a n a1 n1 -- ... ) swap 2 pick swap - ( ... -- a n a2 n2 ) r> r> ( ... -- a n a2 n2 a1 n1 ) ; : proc_answ ( a n -- a2 n2 ) \ save variables 'source 2@ >r >r >in @ >r over over ( a n -- a n a n ) 'source 2! 0 >in ! ( a n a n -- a n ) \ get first word $20 parse ( a n c -- a n a1 n1 ) A2> ( a n a1 n1 -- a n a2 n2 a1 n1 ) cr ." Start INTERPRET: ------- " sp@ u. ." --------- " .s interpret ( a n a2 n2 a1 n1 -- a n ) cr ." End INTERPRET: ------- " sp@ u. ." -------- " .s \ restore variables r> >in ! r> r> 'source 2! ; \ \ : eee 90 ms ." AT+CPIN?" inbuf dup 100 accept ( -- a n ) proc_answ ( a n -- a n ) cr ." TP1 AFTR PROC------------------- " cr .s cr ; -testw marker -testw : LOG cr ." LOG s:" .s ; : OK ( a n a2 n2 -- a n ) cr ." TP2 exec +CPIN? : " cr .s LOG 1 2 3 + ; : OK2 ( a n a2 n2 -- a n ) cr ." TP2 exec +CPIN? : " cr .s LOG ; ------------------------------------------------------------- the problem is : when OK executes from eee via interpret and do something with stack, it always change two bottom stack elements 0 0 0 0 0 eee prompt >AT answer >OK ........some debug output......... ok<$,ram>1952 e 0 0 0 f178 2 f17a 0 1 5 0 0 0 0 0 eee AT OK2 ........some debug output ..... ok<$,ram>0 0 0 0 0 f178 2 f17a 0 Thank you in advance |
From: Mikael N. <mik...@pp...> - 2013-03-02 22:33:42
|
On Sat, 2013-03-02 at 16:00 +0000, Bob Edwards wrote: > Is it feasible to wrap the microchip dsp library for use with flashforth > on dspic? Anyone looked into this? > I have not checked but I don't see why not. A word for calling DSP routines that saves/restores the forth context and sets the DSP lib context could be made. One thing to align is the ram memory map. The MAC unit uses one part for data and one part for constants (X,Y ram). BR Mikael |
From: Bob E. <bob...@ti...> - 2013-03-02 16:34:57
|
Is it feasible to wrap the microchip dsp library for use with flashforth on dspic? Anyone looked into this? regards, bob g4bby |
From: Mikael N. <mik...@pp...> - 2013-02-05 20:20:08
|
These magnetic rotary encoders look quite promising. The mechanics is simple too. /Mike On Tue, 2013-02-05 at 10:40 +0000, Bob Edwards wrote: > see http://store.makerbot.com/magnetic-rotary-encoder.html. The chips > alone are very cheap > http://uk.farnell.com/jsp/search/browse.jsp?N=2031+203959&Ntk=gensearch&Ntt=magnetic+encoder&Ntx=mode+matchallpartial. > I'm thinking of buying some AS5040 > http://uk.farnell.com/ams/as5040-assu/encoder-magnetic-rotary-10bit-16ssop/dp/1630800 > and button magnets and just wiring my own using 'dead bug' construction. > OH2NLT uses that approach > http://www.kolumbus.fi/juha.niinikoski/Hall_encoder/Hall_encoder.htm. |