FORTH pre-loaded UNO or NANO?

Forth was developed in 1958 (!) back when system software was hard to come by. It was used a lot (especially in astronomy) since the '70's. It's a weird (and useful) mix of operating system and programming language that really makes sense on tiny machines.

I obtained an ATmega328 (non-p) DIP pre-programmed with FlashForth from the fellow whose address can be found at http://flashforth.sourceforge.net/ (U$ 10). Mail takes a little while from Finland.

Replacing the ATmega328p in Uno results in a working Forth system.

Playing with it, I managed to mess up the dictionary (The Uno's USB processor doesn't allow xon-xoff flowcontrol to work and it's easy to overrun the compiler, getting it confused... and it's writing to flash!).

I then used Nick Gammon's fabulous (You da' man, Nick!) hex uploader to burn a new version...

Nick's program gets a little upset that FlashForth doesn't start at its lowest address, just set the fuse for $7c00 (EFuse = $fc) and you're good to go.

I re-flashed the ATmega328 and also put FlashForth on a Pro Mini (ATmega328p, works better because USB-TTL converter allows xon-xoff).

Long story here, I run Linux, so used Crossover Linux to run the assembler from Atmel Studio (Studio doesn't work under Crossover, AVRASM does!) to build it. With a few edits, it can be assembled using Avra under Linux (or whatever), though I haven't tested the code yet.

Stacks cannot be in Flash, must be RAM. However Forth uses very little RAM. Variables and two stacks live in RAM. My sense, so far, is that C and C++ make much heavier use of RAM.

I am now in the process of writing analog and digital I/O routines in FlashForth. Glad to share with anyone who's interested. And I'd like to hear from you if you are working on Forth on AVR's.

And, yes, it does mean abandoning the Arduino IDE and all those user provided libraries. I do very much like the idea of a tiny operating system on the microcontroller that allows assembly and compilation. (Somehow the Mini is most impressive, being about the size of a large postage stamp!) Making it do anything non-trivial may take a great while, however.

Two other Forth variants for AVR's are pForth and AmForth. I have the source and haven't done much with them..... yet.

Cheers!