Page 1 of 1
Non-6502: Forth on a 28-pin DIP LPC1114 (ARM)
Posted: Fri Sep 04, 2015 12:31 pm
by scotws
Not for the 6502, but possibly interesting to the other Forthwrights here: Foud a link on Reddit (where there is a forum for Forth) to a "Forth on a DIP" project (
http://jeelabs.org/2015/07/22/forth-on-a-dip/). This uses the LPC1114 chip, a 28-pin DIP ARM (
http://www.nxp.com/products/microcontro ... 4FN28.html), with Mecrisp Forth (
http://mecrisp.sourceforge.net/). The author has a moment of insight:
Forth code runs surprisingly fast. Here is a delay loop which does nothing:
: delay 0 do loop ; ok.
And this code:
10000000 delay ok.
… takes about 3.5 seconds before printing out the final “ok.” prompt. That’s some 3 million iterations per second. Not too shabby, if you consider that the LPC1114 runs at 12 MHz!
Well, duh.
Re: Non-6502: Forth on a 28-pin DIP LPC1114 (ARM)
Posted: Fri Sep 04, 2015 3:29 pm
by BigEd
Edit: Oops, I did misunderstand - there's no repeated function call, so this is a counted but empty loop taking 4 ticks for each time round. Still not much by way of overhead.
[Previously: Am I missing something? That seems quite impressive, for an interpreted language, to call a function in just 4 ticks - even if the function does nothing, doesn't it still have to do the nothing? In effect this Forth is running very close to native speed, which is about as good as it gets.]
Re: Non-6502: Forth on a 28-pin DIP LPC1114 (ARM)
Posted: Fri Sep 04, 2015 9:31 pm
by Brad R
Looks like Mecrisp compiles directly to native code (machine code), so yes, that is quite possible.
Re: Non-6502: Forth on a 28-pin DIP LPC1114 (ARM)
Posted: Mon Oct 26, 2015 2:22 am
by jmp(FFFA)
On a related note, there is FlashForth which will run on an 18-pin DIP (Microchip PIC18) among a number of other families.
http://www.flashforth.com/
P.S. Also a short article on FlashForth in the May, 2015 issue of Circuit Cellar.
Re: Non-6502: Forth on a 28-pin DIP LPC1114 (ARM)
Posted: Tue Oct 27, 2015 1:23 pm
by Martin_H
The Parallax Propeller chip has at least three Forth variants on it. The two most popular are PropForth and TachyonForth. PropForth is closer to standard Forths while Tachyon is much faster. I've done two projects in PropForth
Drawbot:
https://www.youtube.com/watch?v=1Z5kE-3XzS0
ScaraArm Mk I:
https://www.youtube.com/watch?v=14BX50aHDAk
There's also AmForth for several other microcontrollers:
http://amforth.sourceforge.net/