Group: comp.lang.forth · Group Profile
Author: spamspam Date: Jul 16, 2008 19:40
On Wed, 17 Jul 2008, DavidM wrote:
> Date: 17 Jul 2008 10:31:59 +1200
> From: DavidM nowhere.com>
> Newsgroups: comp.lang.forth
> Subject: ROM-able dictionary
>
> Hi,
>
> I've been looking at some of the issues involved in deploying a Forth on
> mid-range microcontrollers such as AVR ATMega.
>
> MCU chips such as these have:
> - ability to self-program their own flash ROM
> - much more flash ROM than RAM - often 8-64k ROM but only around 1-4k RAM
> - limited write cycles with ROM - usually around 10k to 100k - after
> which the chip needs to be replaced
> - Harvard architecture - separate ROM and RAM memory address spaces
>
> In these environments, it seems ideal if at least part of the dictionary
> could be stored in ROM. So far, some of the issues involved would be:
>
> - need to simulate a von Neumann architecture, where ROM and RAM are
> mapped into a single contiguous space, so that pointers can have a
> familiar look-n-feel, but be actioned internally according to what
> part of the logical memory map they're pointing in to.
>
> - for words which contain data, such as VALUE, and those created with
> CREATE, there would need to be an ability to locate the actual data
> outside the ROM area and in RAM. For instance, words in ROM could have
> data pointers pointing into RAM, and words like ',' and 'ALLOT' would
> consume RAM
>
> - part of the ROM image would be a RAM image, which gets loaded into RAM
> on system startup
>
> I'm sure there are a lot more issues to work through. The aim is that the
> environment should have as close to a familiar Forth environment as
> possible, but make best use of on-chip resources.
>
> Has anyone done work on ROM-based dictionaries?
>
> Cheers
> Dave
>
There exist at least a couple of AVR (Atmega/32/48/168) Forths, which have
overcome these issues ... Google is your friend. IIRC, boot loaders on
the Atmega must run from a certain section (there are apnotes available),
which allow onboard code to program the flash directly. An intelligent
forth would have colon take advantage of this to compile directly into
flash ... no?? I have a Butterfly or two which is just screaming out for
a nice forth ... good luck 8-)
Rob.
|