How about a 'Forth Stamp'?
Kotobuki
Posts: 82
I was wondering if it would be possible to create a Stamp format PIC with embedded FORTH? Sorta like a BASIC Stamp 2 only it would be a 'FORTH Stamp'.
Just a thought... (Of course it is early in the morning, and I am not yet properly caffeinated :-)
Best,
Joe
Just a thought... (Of course it is early in the morning, and I am not yet properly caffeinated :-)
Best,
Joe
Comments
Why ask us about Forth for a PIC? Isn't there a forum or two for PIC people?
Sounds like these guys are on the same path:
https://groups.google.com/forum/#!topic/comp.lang.forth/voQiGZ5vo7Q
If, for whatever reason, the target has to be PIC (or for that matter AVR), then FlashForth is -- by far -- your best bet.
FlashForth started out, I believe, as a Forth for PICs (PIC18s). But the AVR version follows closely and has some features (eg, multitasking) for doing real-world embedded work that AmForth does not. I have an UNO board running FlashForth on my desk now; so far I've been impressed.
Arduino having been mentioned, I should also add that FIGnition would be another example of something along these lines.
First.. the NOT.
Well, the BasicStamp or any old PIC won't work. Forth generally requires about 32K of dictionary space to work comportably. The Propeller provides 32K of RAM, and dictionaries can be extended into huge spaces via adding an SDmicro card interface.
Second.. why the Propeller.
While you can use an 8bit or 16bit processor with a 32bit RAM space, the Propeller has 8 parallel CPUs that are all 32bit, and an 80Mhz clock. It just fits better by offering more than the other Forth on a microcontroller at this point.
The real power of your use of Forth on a microprocessor comes into play when you you can have Forth words start another Cog, run a task to completion, and then free the Cog for other tasks as they come along. On a single CPU, you can't start two or three unrelated tasks without either waiting for one to finish before the next one, or having to figure out a rather complete threading support that will slow things down.
In sum, the Propeller just happens to be about the best fit for microcontroller Forth... a lot can happen, and fast.
I don't know if I'd go that far, the AmForth community has a very large and active population, if you can work with the ATmegs its a very good choice.
For multitasking, forth supports a software round-robin and works very well, and requires very little overhead; but the developer has to be aware of the mechanism for surrendering control. Its very simple and elegant and works well as long as we don't try to put 10 lbs or material into a 5 lb bag.
For size, the 8 bit forths typically needed 4k to make a "useful" kernel, depending on who you asked. For some folk 4k is fine, for others 4 gig seems to be too little.
The prop forths are more active because the prop is newer. The older forths on the older chips are less active because they are very well defined and well known, and -kernel- development has taper off. Once your forth gets "comfy" on your new favorite chip, the kernel development tends to slow down, as we concentrate on app development. Folks that use the 6502 or 6809 or whatever just use them, and stock forths for these and most any other chips are just out there.
Maybe a forth "stamp" simply isn't necessary per se, since any prop can run forth.
Google returns 28,500 results for Atmel AVR Forth
Google returns 39,500 results for Parallax Propeller Forth
I realize they are not definitive proof of anything (and contain much rubbish), but those results give some sense of how Forth support on Propeller stacks up (yes, pun!). All things considered, it compares disproportionately well.