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, nucleus, 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 BeagleBoard XM, powered by and communicating via USB. Minicom is used to communicate with the board which reads, evaluates and prints the result of the entered expressions.

Figure 1: Sample Interaction with Armpit Scheme

The latest development snapshot of Armpit Scheme is 070 (year 7, release 0) and the latest stable version is 050. They 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, either from in-house development (Table 1) or contributions from developers (Table 2), as of the latest release:

Table 1: Armpit Scheme Development MCU Board Specifications

LPC-H2103Olimex LPC2103 ARM7TDMI608 KB32 KB--
Tiny2106Newmicros LPC2106 ARM7TDMI6064 KB128 KB--
Tiny2131Newmicros LPC2131 ARM7TDMI608 KB32 KB--
Tiny2138Newmicros LPC2138 ARM7TDMI6032 KB512 KB--
Logomatic V1.0SparkFun LPC2138 ARM7TDMI6032 KB512 KB--
Logomatic V2.0SparkFun LPC2148 ARM7TDMI6032 KB512 KBNative-
LPC-H2148Olimex LPC2148 ARM7TDMI6032 KB512 KBNative-
LCDDemo-LPC2158Future Designs LPC2158 ARM7TDMI6032 KB512 KBNativeText
SAM7-H256Olimex AT91SAM7 ARM7TDMI4864 KB256 KBNative-
STR-H711Olimex STR711 ARM7TDMI4864 KB256 KBNative-
LPC-H2214Olimex LPC2214 ARM7TDMI601 MB1 MBFTDI-
LPC-H2294Olimex LPC2294 ARM7TDMI601 MB4 MBFTDI-
LPC2478-STKOlimex LPC2478 ARM7TDMI7264 MB512 KBNativeColor
LPC-H2888Olimex LPC2888 ARM7TDMI48/6032 MB2 MBNative-
LPC-P1343Olimex LPC1343 Cortex-M3728 KB32 KBNative-
Blueboard 1768HNGX Electronics LPC1768 Cortex-M39632 KB(*)512 KBNative-
SAM3-H256Olimex AT91SAM3S4B Cortex-M36448 KB256 KBNative-
STM32-H103Olimex STM32F103RBT6 Cortex-M37220 KB128 KBNative-
STM32-H107Olimex STM32F107VCT6 Cortex-M37264 KB256 KBNative-
STM32-LCDOlimex STM32F103ZET6 Cortex-M37264 KB512 KBNativeColor
STM32 Core ModuleInSem/Lodin STM32F103ZET6 Cortex-M37264 KB512 KBNative-
IDM-L35-RDKTI LM3S1958 Cortex-M35064 KB256 KB(cable)Color
LM3S1968 EvalTI LM3S1968 Cortex-M35064 KB256 KBFTDIOLED
LM3S6965 EvalTI LM3S6965 Cortex-M35064 KB256 KBFTDIOLED
TI EvalBotTI LM3S9B92 Cortex-M38096 KB256 KBNativeOLED
SAM4S-Xplained(*)Atmel/Embest AT91SAM4S16C Cortex-M4120128 KB512 KBNative-
SAMG53-XplainedAtmel/Embest ATSAMG53N19 Cortex-M4F4896 KB512 KB--
FRDM-K64FFreescale MK64FN1M0VLL12 Cortex-M4F120256 KB512 KBNative-
Nucleo-F401REST STM32F401RET6 Cortex-M4F8496 KB512 KB--
STM32F429 DiscoveryST STM32F429ZIT6U Cortex-M4F1688 MB1 MBNativeColor
LM4F120 LaunchpadTI LM4F120H5QR Cortex-M4F8032 KB256 KBNative-
EK-LM4F232TI LM4F232H5QD Cortex-M4F8032 KB256 KBNative-
EK-TM4C1294XLTI TM4C1294NCPDT Cortex-M4F120256 KB512 KBNative-
LPC4330-XplorerNGX Electronics LPC4330 Cortex-M4F204128 KB4 MBNative-
LPC4357-Xplorer(*)NGX Electronics LPC4357 Cortex-M4F120/20432 MB512 KB/4 MBNativeColor
STR91X-MInsem/Lodin STR911FAW44X6 ARM966E9696 KB512 KBNative-
CS-E9302Olimex EP9302 ARM920T16632 MB16 MB--
HammerTinCan Tools S3C2410 ARM920T20032 MB16 MBNative-
SAM9-L261Olimex AT91SAM9261 ARM926EJ20063 MB1 MB(*)NativeColor
BeagleBoard (B7)TI OMAP3530 Cortex-A8600128 MB0 MB(*)Native-
BeagleBoard-XM-(C2)TI DM3730 Cortex-A81000512 MB0 MBNative-
BeagleBone BlackTI AM3359 Cortex-A8900512 MB0 MBNative-
Overo TideGumstix OMAP3530 Cortex-A8720512 MB0 MBNative-
Duovero CrystalGumstix OMAP4430 Cortex-A99001 GB0 MBNative-

Table 2: Armpit Scheme Contributed Development MCU Boards

Robbie Dinn SAM7-P256Olimex AT91SAM7 ARM7TDMI4864 KB256 KBNative-
Robbie Dinn SAM7-1184-04Microbus UK AT91SAM7 ARM7TDMI4864 KB256 KB--
Tzirechnoy Fractal MCU32-1.12- STM32F103RBT6 Cortex-M37220 KB128 KB--
Ruslan Popov STM32-ARMka- STM32F103C8T6 Cortex-M37220 KB64 KB--
Kuba Tyszko MBED LPC1768MBED LPC1768 Cortex-M39632 KB(*)512 KBNative-
Petr Cermak STM32F4 DiscoveryST STM32F407VC Cortex-M4F168112 KB1 MBNative-

(*) On-board LCDs / OLEDs are programmed from within user or library space (not in the core). The BeagleBoard onboard flash is not used in the Live-SD version option (070, 060, 050). The Blueboard and MBED 1768 have 64KB of RAM but it is not contiguous, hence only 32KB is used. The SAM9-L9261 has 64 MB of SDRAM and 16 MB of flash but Armpit Scheme uses only up to 1 MB of flash (at the top of flash) on this board and it is shadowed by 1 MB of SDRAM. There are 2 versions of the code for LPC4357-Xplorer: one (small memory) that loads by DFU and uses SPIFI (4 MB) for files, and the other (normal) that loads by ISP and uses on-chip flash (512 KB). Also, for the LPC4357-Xplorer, the LCD is on a separate baseboard.

External links of potential interest include:


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 5, 2014