-
Notifications
You must be signed in to change notification settings - Fork 66
Home
Welcome to the STM8 eForth Wiki!
A team of authors regularly updates the following topics:
- technical docs (see sidebar or pages)
- a gentle step-by-step introduction to STM8 eForth
- example code (demos, libraries and projects)
- supported boards, e.g. thermostats, breakout boards (see sidebar)
- STM8 programming tips with a focus on SDCC (assembler, C-compiler and simulator)
- STM8 Low Density device families comparison
The issue tracker and the releases overview also contain a lot of useful information.
If you want to contribute a page or work on a topic, please create an issue.
TG9541/STM8EF is an improved version of Dr. C.H.Ting's STM8 eForth for the STM8S Discovery. With the kind permission of the original author it provides a permissive FOSS license.
Thanks to innovations and contributions from experienced and skilled members of the Forth community STM8 eForth has found its place as a tiny but very usable embedded Forth system. Thanks a lot :-)
STM8 eForth is a very lightweight interactive Forth for low-end STM8 µCs with a good "feature-to-binary-size" ratio:
The STM8 architecture is very well suited for interactive embedded Forth systems, and STM8S Low, Medium and High Density devices, and most STM8L devices are supported. STM8 eForth provides carefully designed embedded control features (e.g. Background and Idle Tasks, interrupts, RAM and Flash operation), e4thcom support, and a framework approach for board support. Interactive development is possible even with STM8S Low Density devices (e.g. W1209 data logging thermostat).
Experienced Forth practitioners found STM8 eForth very usable, even when compared with open-source µC Forth systems that have a richer feature set, or that target more powerful hardware. STM8 eForth favors a practical approach with respect to standardization: when gaps in the original eForth functionality have to be filled, inspiration is taken from Forth-79, Forth-83, FIG-Forth or ANS-Forth. Some solutions for embedded devices are cutting-edge (e.g. Manfred Marlow's VOC
extensions).
@Picatout adapted the original STM8EF for the NUCLEO-8S208RB: Picatout/stm8_eForth is certainly worth checking out!
This project has the following goals:
- share the fun of programming in Forth
- provide an easy to use Forth kit for STM8 µCs
- engage with the Forth community on core, development environment, libraries, and applications,
- support projects that apply STM8 eForth for embedded control
- provide board support for common low-cost Chinese control boards
- maximize the product features * free space (for fun and profit)
The GitHub repository has a sister project eForth for Cheap STM8S Gadgets on Hack-a-Day. There are other projects HaD projects and GitHub repositories that use STM8 eForth code (some or listed in STM8 eForth Example Code).
eForth is a well documented implementation of a basic Forth by Bill Muench and Dr. C.H. Ting.
eForth is based on a set of about 30 Forth core words written in assembly or C instead of using meta-compilation from another Forth system. Higher level words, e.g. for interpreter and compiler, are written in Forth. As eForth was designed with portability in mind there are implementations for many µCs and µPs.
Originally eForth used to be a DTC Forth (versions 1.x use an "inner interpreter") but some later implementation, like STM8 eForth, use the STC approach (versions 2.x use subroutine calls instead of an "inner interpreter").
Some eForth loop idioms, like FOR .. AFT .. THEN .. NEXT
are notoriously "under-documented" - the page eForth FOR .. NEXT provides the "missing docs".
ESP32forth is another actively supported eForth for a powerful µC.
Forth, the programming language that does things differently, is the work of Charles H. Moore and others.
Traditionally, Forth systems target PCs with mass storage, keyboard and display, which embedded Forth systems don't have. In some cases Forth is the OS, in other cases Forth runs on top of CP/M, MSDOS, or a later OS with a GUI. A good example for a modern Forth system is Gforth.
Examples for other embedded Forth systems are AmForth for AVR8 and MSP430, noForth for MSP430, Fast Forth for MSP430, Mecrisp for MSP430, or Mecrisp-Stellaris for Cortex-M.
Some CPUs use Forth words as their machine code. A good example is J1, or the extraordinary GA144.
There are many on-line Forth resources. Some of the most notable are:
- Leo Brodie's books Starting Forth, and Thinking Forth
- scans of the magazine Forth Dimensions (indexed)
- some issues of Forthwrite, the FIG UK Magazine
- publications by the German Forth-Gesellschaft e.V. (mostly German, some in English).