# Staapl

## About

Staapl is a collection of abstractions for (meta)programming microcontrollers from within PLT Scheme. The core of the system is a programmable code generator structured around a functional concatenative macro language. On top of this it includes a syntax frontend for creating Forth style languages, a backend code generator for the Microchip PIC18 microcontroller architecture, and interaction tools for shortening the edit-compile-run cycle.

## Status

The phase I goal - to build a practical, well-factored, easily extensible base system - is completed and put in maintenance mode. It will serve as the basis for phase II: further experiments with domain specific languages for DSP and embedded control.

## Documentation

For the general idea, see the introduction. The Forth dialect is is documented in two (DRAFT) papers: one specifically about Forth and the other about the test suite with an attitude, the Sheep sound synthesizer. Since this is a developer-oriented project with a lot of effort put into clean organization, I suggest looking at the source code to pierce through the top-layer of workflow glue. For the latest news, there is a moderated blog. Send comments to the mailing list. For an introduction to PLT Scheme, have a look at the exellent documentation.

## Projects

I am currently looking for projects that apply Staapl to practical problems in the embedded DSP/control field. I am particularly interested in adding backends for other architectures. Note that version 0.1 did include a backend for the PIC12 and PIC16 cores which is not difficult to port, and I've been looking into porting to dsPIC and ARM7TDMI. For more information please contact me directly or through my LinkedIn profile.

The PIC18 Forth language has been used in:

- The Sheep sound synthesizer software which has been the main Staapl test suite since the start of the project (april 2005). Originally written for the PIC12F625, it now runs on the PIC18 architecture (PIC18F1220).
- The ForthTV B/W composite video generator running on the USBPicStamp board made by Johannes Taelman.
- The CATkit and KRIkit boards developed for projects in collaboration with GOTO10.
- Several hands-on workshops.

## Download

Staapl is part of Planet. To compile the test suite (the the Sheep sound synth) type

      mzscheme -p zwizwa/staapl/examples/build-synth

This will produce a `synth.hex` and `synth.dict` in the local directory.

The same version is also available as staapl-0.5.2.tar.gz. For the latest changes track the darcs archive. The Staapl source code, including that of its subprojects, is released to the public under the terms of the GPL v2. Staapl is written by Tom Schouten.

    Thu Jul 24 12:57:17 CEST 2008