AmForth is an easily extendible command interpreter for the Atmel AVR8 Atmega micro controller family and some variants of the TI MSP430. It has a turnkey feature for embedded use too.

AmForth is published under the GNU Public License v3 (GPL). A commercial use is possible but for traditional commercial uses there are commercial Forths — amForth just is not one of them.

AmForth runs completely on the controller. It does not need additional hardware. It makes no restrictions for hardware extensions that can be connected to the controller. The default command prompt is in a serial terminal.

The command language is Forth. AmForth implements an almost compatible Forth 2012 indirect threading 16bit Forth.

AmForth for the AVR8 needs 8 to 12 KB Flash memory, 80 bytes EEPROM, and 200 bytes RAM for the core system. A similar code for the MSP430 fits into 8KB flash. The MSP430 info flash is used for similar purposes as the EEPROM for the AVR8 platform.

Work In Progress

Here you’ll find things that are not yet released but will be part of the next release. See the code section at Sourceforge to get the most recent sources

  • core(ALL): Update to Recognizer v4 keyword set.
  • doc(ALL): Using Gerald Wodni’s module for LCD HD44780.
  • core(ALL): new deferred prompt word .input. Prompts
  • core(AVR8): More work in interrupt reliability.
  • core(ALL): factor (create-in) (addr len wid – ) to make a new wordlist entry in a given wordlist without XT and data area.

30.4.2017: release 6.5

  • core(AVR8): redesigned interrupt handling to improve reliability. Thanks to Erich.
  • core(MSP430): highly experimental support for interrupt service routines in Forth for MSP430 2553. Manually enable it if your’re brave the same way the AVR’s work. Interrupts on the MSP430 and Interrupt Service Routines.

31.3.2017: release 6.4

  • lib(ALL): (( for multiline comments. Comments end with )). Uses recognizers for that from rec-double-paren.frt.
  • lib(AVR8): Implement I2C Slave. Renamed i2c.>n to i2c.n@ and i2c.n> to i2c.n!. I2C Generic
  • lib(ALL): Recognizer for the Forth 2012 'c' Syntax to replace char c and [char] c. Just load the rec-char.frt file.
  • core(AVR8): add >rx-buf (c -- ) that appends a character to the ring buffer that uses the usart receive interrupt.

24.8.2016: release 6.3

  • core(AVR8): Use the standard Interrupt Service Routine for terminal input too. Makes re-definable with int!. Thanks to Erich for his longanimity on this and the prompt defers.
  • core(MSP430): Use the hardware multiplier if available. Add n>r and nr>.
  • lib(ALL): Chains: Lists of execution tokens.
  • core(ALL): The three prompt words are now system USER based defers: .ready for the >, .error if an error occured and .ok if everything was fine. See Prompts for more.

4.7.2016: release 6.2

  • core+lib(MSP430): New optional assembly (compile-time) words d2* and d2/.
  • core(ALL): renamed find-name ( addr len -- xt +/-1 | 0) to find-xt, compare to find-name ( addr len -- nt|0) to deal with name tokens.
  • core(MSP430): add pause to the usart IO words.
  • core(ALL): complete recognizer Rev. 3 adaption.

17.10.2015: release 6.1

  • core(ALL): Adapt postpone action of the recognizers to comply with Rev. 3. Change your recognizers accordingly.
  • core(MSP430): New devices MSP430 F5529 (Flash) and FR5969 (FRAM). See Texas Instruments LaunchPad 430.
  • core(MSP430): Extended VM Register A. See Extended VM
  • lib(ALL): Fix regressions in Rdefer and does>. Make quotations more robust in corner cases.

6.9.2015: release 6.0

  • core(ALL): Fix a few regressions like the TAB handling in accept.
  • core(AVR8): Fix forth-wordlist to return a valid wordlist id.
  • core(MSP430): many small changes to bring it closer to the AVR8. Still fits into 8KB flash.
    • global variables like DP (HERE), STATE, HLD etc instead of USER variables-
    • Same USER area layout. Including deferred words for terminal IO.
    • complete wordlist support including search order and current.
    • Emulate AVR EEPROM configuration with a info flash segment. Needs save to store the data permantly.
    • Lots of common code, optimized versions of standard words if applicable.
    • preparing for more MSP430 device types.