Matthias Koch
|

Mecrisp

Mecrisp is an implementation of a standalone native code Forth for MSP430 microcontrollers. Many chips and all current MSP430 based Launchpads are supported. It fits into 11 kb of flash or fram and runs with at least 512 bytes of ram. You can choose to compile to flash or to ram, and it generates native code with folding, inlining of short words and it opcodes common instructions. Note that it doesn't need to save any pointers, so it compiles directly into flash memory without the need for erase cycles. It is completely interrupt-save and you can hook your Forth definitions to interrupt vectors. Of course, you should not hook create to a timer interrupt, unless you want all your memory to be filled with random creatures :-) Although it is in spirit of ANS, there are a few differences: Be careful !

It is running on the following chips out of the box:

  • MSP430F2274 (9600 Baud, 8 MHz, TX on P3.4, RX on P3.5)
  • MSP430G2553 (9600 Baud, 8 MHz, TX on P1.2, RX on P1.1)
  • MSP430G2955 (9600 Baud, 8 MHz, TX on P3.4, RX on P3.5)
  • MSP430G2855 (9600 Baud, 8 MHz, TX on P3.4, RX on P3.5)
  • MSP430G2755 (9600 Baud, 8 MHz, TX on P3.4, RX on P3.5)
  • MSP430F5529 (115200 Baud, 8 MHz, TX on P4.4, RX on P4.5)
  • MSP430FR4133 (115200 Baud, 8 MHz, TX on P1.0, RX on P1.1)
  • MSP430FR5969 (115200 Baud, 8 MHz, TX on P2.0, RX on P2.1)
  • MSP430FR6989 (115200 Baud, 8 MHz, TX on P3.4, RX on P3.5)
  • Special Mecrisp for MSP430F1612 with initialisations for Launchpad hardware is included to conquer your Launchpad completely.

I am looking forward to find out how Mecrisp can serve you best. Examples are going to come, implementations for other chips of the MSP430 family shouldn't be too far away. Do you have a particular one in mind ? Do you have great code snipplets that show the abilities of Mecrisp well ? Write an E-Mail and you will be in touch !

You can get Mecrisp on its download page.

In memory of John "Sandy" Bumgarner, one of the earliest Forthwrights, who kindly shared his experiences and thoughts with me. Many of his bright design ideas found its way into Mecrisp and defined the shape of the implementation.

Mecrisp-Stellaris

Mecrisp-Stellaris is the younger sister of Mecrisp and runs on various ARM Cortex M chips. This is a big family of microcontrollers with a common processor architecture and very different peripheral capabilities. Despite the name, not only Stellaris chips are supported: It runs on a wide variety of chips of the four core flavours M0, M3, M4 and M7. Mecrisp-Stellaris fits into 16 kb of flash and runs with at least 1 kb of ram. If you wish your favourite chip to be in this list, just get in contact, and maybe there will be another port soon.

Stable features will be released in the mainstream packages you can find here, which are a good place to start. For cutting edge development, Jean-Claude Wippler is kindly maintaining an official Mecrisp-Stellaris Github repository and an huge collection of drivers and libraries.

Ready-to-fly builds are included for:

TI Stellaris/Tiva Launchpad LM4F120H5QR / TM4C123GH6PM
TI Tiva Connected Launchpad TM4C1294NCPDT
TI MSP432 Launchpad MSP432P401R
STM L053 Discovery STM32L053C8T6
STM Nucleo L152RE STM32L152RE
STM Nucleo F207ZG STM32F207ZG
STM Nucleo F303K8 STM32F303K8
STM Nucleo 401RE STM32F401RE
STM Nucleo 411RE STM32F411RET6
STM F0 Discovery STM32F051R8
STM VL Discovery STM32F100RB
Shenzhen LC Technology board STM32F103C8T6
STM F3 Discovery STM32F303VCT6
STM F4 Discovery STM32F407VGT6
STM F429 Discovery STM32F429ZIT6
Freescale Freedom FRDM-KL25Z KL25Z128VLK4
Freescale Freedom FRDM-KL46Z KL46Z256VLL4
Freescale Freedom FRDM-K64F MK64FN1M0
Infineon XMC2GO XMC1100Q024F0064
EFM32 Giant Gecko EFM32GG990F1024
EFM32 Happy Gecko EFM32HG322F64
Breadboard friendly, DIP packaged LPC1114FN28
LPC1114FBD48
LPC1115FBD48
Very small TSSOP20 packaged STM32F030F4
Teensy 3.1 MK20DX256VLH7
Chinese QF-LM4F232 LM4F232H5QC
nRFgo Starter Kit nRF51822
BBC Microbit nRF51822
STM L152 Discovery STM32L152RBT6
STM L476 Discovery STM32L476VG
STM F746 Discovery STM32F746NG

Mecrisp-Ice

Mecrisp-Ice is an enhanced version of Swapforth and the J1a stack processor by James Bowman, featuring three MSP430 style IO ports, a tick counter, constant folding, inlining and tail-call optimisations. As Mecrisp traditionally has been friendly to flash memory, you can save your Forth programs into the SPI flash on the Icestick, you can even make it run automatically on boot. Ready-to-fly bitstream for your Icestick is included !

Great things elsewhere:

Terry Porter took the effort to finally improve documentation ! Maybe his Mecrisp-Stellaris Unofficial User Documentation soon will become the official documentation ?

Jean-Claude Wippler, who likes to experiment with "computing stuff tied to the physical world", has a whole series of great articles in Jeelabs.org using Mecrisp-Stellaris, mostly on STM32F103 chips. If you wish for an introduction both to Jeelabs and Forth, this is your point to start: Forth in 7 easy steps

James Bowman, well known for his elegant J1 Forth CPU design, bundled his efforts with the first completely open source FPGA toolchain of the Icestorm project to create a J1 microcontroller on a Lattice iCE40HX1K FPGA !

Russell Merrick designed a beautiful FPGA board with many peripherals to experiment with the HX1K - the Nandland Go, which will move up to be an official target for Mecrisp-Ice soon !