http://armpit.sourceforge.net/

A Scheme Interpreter for ARM Microcontrollers

SourceForge.net Logo

ARMPIT SCHEME is an interpreter for the Scheme language (lexically-scoped dialect of Lisp) that runs on RISC microcontrollers with ARM core. It is based on the description in the Revised^5 Report on the Algorithmic Language Scheme (r5rs), with some extensions (for I/O) and some omissions (to fit within MCU memory). It is further designed to support multitasking and multiprocessing. Armpit Scheme is expected to be well suited to educational settings, including student projects in courses on control and instrumentation, or capstone design courses where microcontrollers are needed. It is meant to enrich the spectrum of interpreted languages available for MCUs (eg. BASIC and FORTH) and can be an alternative to MCU-based bytecode interpreters (eg. for Scheme or Java) and to compiled languages (eg. C).

The name "Armpit" was selected for this project because it includes "ARM" (as in ARM core MCU) and "pit" (as in kernel, noyau, the core of an Operating System (OS)). Armpit Scheme, once loaded, governs the operation of the MCU, and is "Scheme to the metal" in the sense of running without any other OS. It may be thought of as turning the MCU into a rudimentary Scheme machine. The screenshot below shows the system running on a NewMicros Tiny2106 board. Minicom is used to communicate with the board which reads, evaluates and prints the result of the entered expressions. The number in front of the "armpit>" prompt indicates the number of bytes of heap space that remain available.


Figure 1: Sample Interaction with Armpit Scheme

The latest development snapshot of Armpit Scheme is 00.0215 and the current stable version is 00.0160. Both are distributed under the MIT License and are beta releases with both known bugs and unknown bugs. The source code, and pre-assembled (ready-to-upload) Intel Hex and binary image files, can be downloaded from the armpit project summary page or the download site at SourceForge. Alternatively, you can view and download the source code from your web browser. The system is documented in several web pages: 

It is designed to run on the following boards:

Table 1: Armpit Scheme Development MCU Board Specifications

BOARD MANUFACTURER MCU CORE MHZ RAM FLASH USB LCD (*)
LPC-H2103 Olimex LPC2103 ARM7TDMI 60 8 KB 32 KB - -
Tiny2106 Newmicros LPC2106 ARM7TDMI 60 64 KB 128 KB - -
Tiny2131 Newmicros LPC2131 ARM7TDMI 60 8 KB 32 KB - -
Tiny2138 Newmicros LPC2138 ARM7TDMI 60 32 KB 512 KB - -
Logomatic V1.0 SparkFun LPC2138 ARM7TDMI 60 32 KB 512 KB - -
Logomatic V2.0 SparkFun LPC2148 ARM7TDMI 60 32 KB 512 KB Native -
LPC-H2148 Olimex LPC2148 ARM7TDMI 60 32 KB 512 KB Native -
LCDDemo-LPC2158 Future Designs LPC2158 ARM7TDMI 60 32 KB 512 KB Native Text
SAM7-H256 Olimex AT91SAM7 ARM7TDMI 48 64 KB 256 KB Native -
STR-H711 Olimex STR711 ARM7TDMI 48 64 KB 256 KB Native -
LPC-H2214 Olimex LPC2214 ARM7TDMI 60 1 MB 1 MB FTDI -
LPC-H2294 Olimex LPC2294 ARM7TDMI 60 1 MB 4 MB FTDI -
LPC2478-STK Olimex LPC2478 ARM7TDMI 72 64 MB 512 KB Native Color
LPC-H2888 Olimex LPC2888 ARM7TDMI 48/60 32 MB 2 MB Native -
CS-E9302 Olimex EP9302 ARM920T 166 32 MB 16 MB Yes (*) -
Hammer TinCan Tools S3C2410 ARM920T 200 32 MB 16 MB Yes (*) -
STM32-H103 Olimex STM32 Cortex-M3 72 20 KB 128 KB Yes (*) -
IDM-L35-RDK TI LM3S1958 Cortex-M3 50 64 KB 256 KB (cable) Color
LM3S1968 Eval TI LM3S1968 Cortex-M3 50 64 KB 256 KB FTDI OLED
LM3S6965 Eval TI LM3S6965 Cortex-M3 50 64 KB 256 KB FTDI OLED
BeagleBoard (B7) TI OMAP3530 Cortex-A8 500 96 MB 32 MB(*) Yes (*) -

(*) USB is not implemented in the Armpit Scheme core for these 4 MCUs. On-board LCDs / OLEDs are programmed from within user space (not in the core). The BeagleBoard has 256MB of Flash but only 32MB are used for Armpit Scheme user files (the file Flash is shadowed by 32MB of SDRAM).


External links of potential interest include:

  • Discussions on the potential of Scheme/Lisp for Microcontrollers: A brief essay on embedded lisps and schemes by Matt Knox. A colorful project on wearable lisp and unsorted discussions or comments about the potential for Lisp/Scheme to run on MCUs (1), (2), (3), (4), (5), (6) (search for LISP or Scheme in those pages). A Scheme byte-code interpreter that runs on PIC MCUs (named BIT and PICBIT by Danny Dube and Marc Feeley of the University of Montreal. The LegoScheme project at Indiana University. XS LISP for the LEGO RCX by Taiichi Yuasa.
  • Implementations of Scheme/Lisp on the metal, in assembly or small: The movitz project that targets Lisp "on the metal" (x86). Dream scheme written in PPC/x86 assembly language by David Joseph Stith. A scheme in forth by Mark Probst. TinyScheme by Dimitrios Souflis and Jonathan S. Shapiro (with versions for ARM processors). pocket scheme (for PDAs) by Ben Goetter. Hedgehog embedded LISP by Lars Wirzenius and Kenneth Oksanen.
  • Other interesting functional language systems running on the metal: The Python-on-a-Chip project where the PyMite VM is implemented on microcontrollers. The eLua project where Lua is implemented on microcontrollers. The lispm project where LISP is implemented in an FPGA.
  • Multiprocessing Scheme systems: Termite Scheme, a distributed scheme using Erlang-like communication (paper). Kali Scheme, a distributed implementation based on Scheme48, that is undergoing a revival. The Tube, a system for Flexible Distributed Programming using Mobile Code, in scheme.
  • Web Sites Discussing Scheme in Action, Research and Education: The website of schemers.org. A bibliography of scheme research. A list of schools that use Scheme in their curricula (from Schemers Inc.).
  • Online Books on Scheme: Teach Yourself Scheme in Fixnum Days by Dorai Sitaram. The Scheme Programming Language by R. Kent Dybvig. Structure and Interpretation of Computer Programs by Harold Abelson, Gerald Jay Sussman and Julie Sussman. How to Design Programs by Matthias Felleisen, Robert B. Findler, Matthew Flatt and Shriram Krishnamurthi.
 

Acknowledgment and Disclaimer


Armpit Scheme is presently developed at the Fischell Department of Bioengineering of the A.J. Clark School of Engineering at the University of Maryland at College Park. Part of its development (until 02/07) was based upon work supported by the National Science Foundation under Grant No. 0134424. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Department, School, University or of the National Science Foundation.  

Last updated December 28, 2009

bioe-hubert-at-sourceforge.net

Reply via email to