Tiny Lisp Computer

Summary of Tiny Lisp Computer


This article describes a self-contained computer built on an ATmega328, featuring a monochrome OLED display and a miniature PS/2 keyboard. It runs uLisp, allowing users to interface with LEDs, buttons, and external devices via I/O pins, I2C, and SPI. The system supports analogue inputs/outputs, digital control, and persistent program storage in EEPROM.

Parts used in the Tiny Lisp Computer:

  • ATmega328 microcontroller
  • Monochrome OLED display (21 characters x 8 lines)
  • Miniature PS/2 keyboard
  • Analog input pins A0 to A5
  • Analog output pins 3, 9, 10, 11
  • Digital input/output pins 0, 1, 3, 9 to 13, A0 to A5
  • I2C interface pins A4 and A5
  • SPI interface pins 11, 12, 13
  • Built-in LED connected to pin 13

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

Quick Solutions to Questions related to Tiny Lisp Computer:

  • What language is used to program this computer?
    The computer is programmed in uLisp, a compact subset of Common Lisp.
  • How many characters per line does the display support?
    The display supports 21 characters per line across 8 lines.
  • Can programs be saved to retain data when power is disconnected?
    Yes, programs can be saved to EEPROM so they are retained when power is disconnected.
  • Which pins are used for the I2C interface?
    Pins A4 and A5 are used for the I2C interface.
  • Does the device include a garbage collector?
    Yes, it includes a mark and sweep garbage collector that takes under 1 msec.
  • What integer range is supported by the system?
    Integers can be between -32768 and 32767.
  • Can numbers be entered in hexadecimal or binary formats?
    Yes, you can enter numbers in hexadecimal, octal, or binary using notations like #x, #o, or #b.
  • Is there an LED connected to a specific pin?
    Yes, pin 13 is connected to an LED.

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
Scroll to Top