Skip to content

STM8 eForth Example Code

Thomas edited this page Aug 26, 2021 · 38 revisions

Example Code and Projects

The following list is incomplete. Please make it grow by adding your code!

Projects

Projects contains work that provides some "real world features".

Note that the W1209 data logging thermostat also is a showcase project that demonstrates the code density that can be achieved with embedded Forth.

Title Author Type Hardware
Solar Water Heating w/ wireless transmission tg9541 project MINDEV board, nRF24L01, W1209 NTC, SSR
W1209 data logging thermostat tg9541 project, demo W1209 with modular-build
Morse Beacon VK6TT project PLL
STM8S connected to WiFi hexagon5un project ESP-14
MODBUS Server tg9541 library, demo C0135, MINDEV STM8S001J3M3 board
FM Broadcast Tx VK6TT project STM8S003 driving a QN8027 FM stereo modulator
UVLT01 Danya0x07 project UV lamp with timer using an STM8S103, also on Hack-a-Day

Libraries

This section contains building blocks for applications. Eelkhoorn's Stm8 peripherals library really is worth checking out.

Note that an alternative version of the nRF24L01 library is here.

Title Author Type Hardware
Stm8 peripherals Eelkhoorn library, demo generic I/O, I2C, SDcard with FAT, RTC, nRF24L01+, SSD1306 (OLED display), STM8L and STM8S
LCD Character Displays VK6TT project Character LCD's e.g. 16 characters x 2 lines
STM8S with Nokia 3110 LCD tg9541 library PD8544 LCD
STM8 connected to nRF24L01+ VK6TT library nRF24L01+
GCODE interpreter in eForth RigTig library generic

Mods

Mods are code that modify or enhance core features of the STM8 eForth kernel.

Title Author Type Note
VOC M. Mahlow mod Namespace-like extension based on the CURRENT wordlist feature (more here)
INTRX tg9541 mod Buffered UART receive for the Forth console

Demos

Examples in docs, prove-of-concept code, and solution snippets go here. Some of the demos are quite elaborate and can be used as starting points for projects (e.g. the CN2596 power supply or the W1209/HC-SR04 distance measurements).

Title Author Type Hardware
1-Wire primitives tg9541 demo DS18S20
W1209 examples tg9541 demo W1209
W1209 ultrasonic sensor display tg9541 demo W1209, HC-SR04
CN2596 power supply tg9541 demo CN2596
STM8S103F3 RC servo control tg9541 demo generic, RC-servo
C0135 example tg9541 demo C0135
Compiler and Assembly tg9541 docs generic
WS2812 with nominal timing tg9541 demo PCB w/ 8xWS2812B, MINDEV
Modular Build tg9541 demo Complete board code with the modular-build approach
XY-LPWM Demo tg9541 demo, project Complete modular-build code for a cheap PWM generator board with LCD
STM8L RTC tg9541 demo STM8L051F3: Experimenting with LSE, BEEP and RTC
STM8L Low Power Console tg9541 demo STM8L051F3: an illustrated guide a low power Forth console that explores features like pin-change interrupt
STM8 I2C Master tg9541 demo I2C Scanner and Master code for 24C64, DS1621 and SSD1306 using the I2CMA driver
STM8S NEC-IR RC tg9541 demo IR Remote Controlled for an RGBW LED Bulb with STM8 eForth