Tiny Lisp Computer

This article describes a self-contained computer with its own display and keyboard, based on an ATmega328, that you can program in Lisp. You can use it to run programs that interface to components such as LEDs and push-buttons via the I/O pins, read the analogue inputs, and operate external devices via the I2C and SPI interfaces. It has a small monochrome OLED display that gives 8 lines of 21 characters per line, and a miniature PS/2 keyboard:Tiny Lisp Computer

Tiny Lisp Computer – Specification

Display: 21 characters x 8 lines.
Memory available: 316 Lisp cells (1264 bytes).
EEPROM: 256 Lisp cells (1K bytes).
Language: uLisp, a subset of Common Lisp, with 122 Lisp functions and special forms. For a full definition see uLisp Language Reference.
Types supported: list, symbol, and integer.
An integer is a sequence of digits, optionally prefixed with β€œ+” or β€œ-β€œ. Integers can be between -32768 and 32767. You can enter numbers in hexadecimal, octal, or binary with the notations #x2A, #o52, or #b101010, all of which represent 42.
User-defined symbol names can have up to three characters consisting of a-z and 0-9. Any sequence that isn’t an integer can be used as a symbol; so, for example, 12a is a valid symbol.
There is one namespace for functions and variables; in other words, you cannot use the same name for a function and a variable.
Includes a mark and sweep garbage collector. Garbage collection takes under 1 msec.
Interfaces:

  • Analogue input using analogread: A0 to A5 (14 to 19)
  • Analogue output using analogwrite: 3, 9, 10, 11
  • Digital input and output using pinmode, digitalread, and digitalwrite: 0, 1, 3, 9 to 13, A0 to A5 (14 to 19)
  • I2C using with-i2c and restart-i2c: A4 and A5
  • SPI using with-spi: 11, 12, 13

As on an Arduino Uno, pin 13 is connected to an LED.

uLisp

The computer is programmed inΒ uLisp, my compact Lisp interpreter for the Arduino. This allows you to control the I/O ports directly, access I2C and SPI peripherals, and write small programs to automate functions. You can also save programs to EEPROM so they are retained when the power is disconnected, and they can be configured to run automatically on restart.
For more detail: Tiny Lisp Computer


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top