{"id":14231,"date":"2023-09-28T10:41:18","date_gmt":"2023-09-28T15:41:18","guid":{"rendered":"https:\/\/blinkingrobots.com\/technoblogy-lisp-badge-le\/"},"modified":"2023-09-28T10:41:18","modified_gmt":"2023-09-28T15:41:18","slug":"technoblogy-lisp-badge-le","status":"publish","type":"post","link":"https:\/\/blinkingrobots.com\/technoblogy-lisp-badge-le\/","title":{"rendered":"Technoblogy – Lisp Badge LE"},"content":{"rendered":"\n2023-09-27 17:27:11 <\/p>\n
\n

Lisp Badge LE<\/h2>\n

twenty seventh September 2023<\/p>\n

It is a self-contained low-power laptop with its personal show and keyboard you can program in uLisp, a model of the high-level language Lisp for microcontrollers:<\/p>\n

\"LispBadgePulse.jpg\"<\/p>\n

The Lisp Badge LE, a low-power laptop programmed in Lisp
with a self-contained keyboard and show.<\/em><\/p>\n

It is primarily based on an AVR128DB48 which offers 128K bytes of flash reminiscence, and 16K bytes of RAM. There’s an built-in 45-key keyboard optimised for Lisp, utilizing reverse-mounted buttons giving room for giant key legends on the PCB.<\/p>\n

It has a low-power monochrome show, readable in daylight with no backlight, so it is preferrred for programming within the backyard or on the seashore! This offers 10 traces of 41 characters, or graphics with a decision of 250×122 pixels, supported by a number of graphics instructions.<\/p>\n

You should use it to run packages that interface to parts akin to LEDs and push-buttons through the I\/O pins, learn the analogue inputs, and function exterior units through the I2C and SPI interfaces.<\/p>\n

Introduction<\/h3>\n

A number of years in the past I designed the Lisp Badge<\/a>, a self-contained laptop with its personal show and keyboard, primarily based on an ATmega1284, that you may program in Lisp. Since then I have been fascinated with how I may enhance it, and made a listing of options I might like so as to add.<\/p>\n

On the one hand I wished it to have a greater keyboard, and be low energy, powered from a button cell, with an eInk show that you may see in daylight. However I wished it to have a color TFT graphics show, and use a quick 32-bit ARM processor, with help for floating-point arithmetic.<\/p>\n

I quickly realised that these necessities are incompatible in a single design, and so set about designing two completely different Lisp Badges to satisfy the 2 units of necessities. This Lisp Badge LE (low power) is the primary of these designs, and has the next new options:<\/p>\n

Processor and reminiscence<\/h4>\n

It\u2019s primarily based on an AVR128DB48 (or AVR128DA48) operating at 24MHz, and offers 2800 Lisp objects, about the identical as the unique Lisp Badge. It can save you all the workspace to flash.<\/p>\n

Present consumption<\/h4>\n

The Lisp Badge LE attracts solely 6mA from its CR2032 button cell, and so ought to have a lifetime of about 40 hours. There\u2019s a bodily on\/off swap too for lengthy durations of inactivity.<\/p>\n

Lisp language<\/h4>\n

The Lisp Badge LE runs the AVR model of uLisp which offers 16-bit integer arithmetic, arbitrary size symbols and strings, lists, multi-dimensional arrays, Arduino interface capabilities, debugging options, and built-in documentation.<\/p>\n

Show<\/h4>\n

The show is a low-power monochrome graphics show\u00a0[1]<\/a><\/sup> which I explored in an earlier article; see Monochrome Low-Power Display Library<\/a>. It has\u00a0a decision of 250×122 pixels, and a textual content decision of 10 traces of 41 characters per line. It helps studying again from the show, which makes it potential to help a full vary of graphics capabilities, together with plotting factors,\u00a0drawing traces, drawing define and crammed rectangles circles or triangles, and plotting characters and textual content at regular measurement or enlarged by any integer scale issue.<\/p>\n

Keyboard<\/h4>\n

The keyboard takes benefit of push buttons that mount on the reverse of the board, with the button caps protruding by holes within the PCB. This makes it a lot simpler to make use of than on the unique Lisp Badge as a result of it is simpler to press the keys, and there is house for bigger key legends. The push buttons can be found from Adafruit\u00a0[2]<\/a><\/sup>. or The Pi Hut within the UK\u00a0[3]<\/a><\/sup>.<\/p>\n

It makes use of the identical\u00a045-key format as the unique Lisp badge, with higher and lower-case characters, digits, and the symbols required by uLisp. Nonetheless, it now offers an addition\u00a0META<\/strong>\u00a0modifier key along with SHIFT<\/strong>, permitting you to enter characters that do not have a devoted key on the keyboard.<\/p>\n

Peripherals<\/h4>\n

There\u2019s a big piezo speaker that helps enjoying notes, and a reverse-mounting LED that shines by a gap on the entrance of the board.<\/p>\n

Here is the complete specification:<\/p>\n

\n

Lisp Badge \u2013 Specification<\/h3>\n

Dimension:<\/strong> 107mm x 61mm (4.2″ x 2.4″).<\/p>\n

Show<\/strong>: 41 characters x 10 traces, or 250 x 122 pixels.<\/p>\n

Keyboard:<\/strong>\u00a0Built-in 45-key keyboard offering higher and lower-case characters, digits, and the symbols required by uLisp.<\/p>\n

The META<\/strong> key pressed together with one other key provides entry to the next characters not accessible from the primary keyboard:<\/p>\n\n\n\n\n\n
META +<\/strong><\/td>\nA<\/td>\nC<\/td>\nD<\/td>\nE<\/td>\nP<\/td>\nQ<\/td>\nT<\/td>\nU<\/td>\nV<\/td>\n<<\/td>\n><\/td>\n<\/tr>\n<\/thead>\n
Character<\/strong><\/td>\n&<\/td>\n:<\/td>\n$<\/td>\n!<\/td>\n%<\/td>\n?<\/td>\n@<\/td>\n^<\/td>\n|<\/td>\n{<\/td>\n}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Reminiscence accessible<\/strong>: 2800 Lisp cells (11200 bytes).<\/p>\n

Flash<\/strong>: 16384 bytes of flash are reserved to be used to save lots of the Lisp workspace utilizing save-image<\/strong>.<\/p>\n

Processor:<\/strong> AVR128DB48<\/p>\n

Clock pace:<\/strong> 24 MHz.<\/p>\n

Present consumption:<\/strong> Approx. 6 mA. A CR2032 cell has a typical capability of 225 mAh, so this could give a lifetime of about 40 hours.<\/p>\n

Varieties supported<\/strong>: record, image, integer, character, string, stream, and array.<\/p>\n

An integer is a sequence of digits, optionally prefixed with “+” or “-“. Integers may be between -32768 and 32767. You may enter numbers in hexadecimal, octal, or binary with the notations #x2A, #o52, or #b101010, all of which characterize 42.<\/p>\n

Person-defined image names can have arbitrary names. Any sequence that is not an integer can be utilized as an emblem; so, for instance, 12a is a legitimate image.<\/p>\n

There may be one namespace for capabilities and variables; in different phrases, you can not use the identical identify for a operate and a variable.<\/p>\n

Features a mark and sweep rubbish collector. Rubbish assortment takes 5 msec.<\/p>\n

Language<\/strong><\/h4>\n

uLisp, a subset of Widespread Lisp, with the next 196 Lisp capabilities and particular kinds:<\/p>\n

* + – \/ \/= 1+ 1- < <= = > >= ? abs analogread analogreadresolution analogreference analogwrite and append apply apropos apropos-list aref array-dimensions arrayp ash assoc atom bit boundp break caaar caadr caar cadar caddr cadr automobile case cdaar cdadr cdar cddar cdddr cddr cdr char char-code characterp check-key closure cls code-char concatenate cond cons consp dacreference decf defcode defun defvar delay digitalread digitalwrite documentation dolist dotimes draw-char draw-circle draw-line draw-pixel draw-rect\u00a0<\/strong>draw-triangle\u00a0<\/strong>edit eq equal error eval evenp fill-circle fill-rect fill-screen\u00a0<\/strong>fill-triangle<\/strong>\u00a0first for-millis format funcall gc get-pixel globals glyph-pixel if ignore-errors incf integerp keyboard keywordp lambda size let let* record list-library listp load-image locals logand logbitp logior lognot logxor loop make-array makunbound mapc mapcan mapcar max member millis min minusp mod not notice nothing nth null numberp oddp or pinmode plot plot3d plusp pop pprint pprintall prin1 prin1-to-string princ princ-to-string print progn push quote random learn read-byte read-from-string read-line register require relaxation restart-i2c return reverse room save-image search second set set-cursor setf setq sleep kind streamp string string< string= string> stringp subseq symbolp t terpri third time hint truncate until untrace unwind-protect when with-i2c with-output-to-string with-sd-card with-serial with-spi write-byte write-line write-string zerop<\/strong><\/p>\n

It additionally offers 37 key phrases akin to :enter<\/strong>, :output<\/strong>, and :led-builtin<\/strong>, as a handy method of coming into Arduino constants.<\/p>\n

For a full definition see uLisp Language Reference<\/a>.<\/p>\n

Graphics extensions<\/h4>\n

The Lisp Badge LE features a graphics library to will let you do plotting on the show; for particulars see\u00a0Graphics extensions<\/a>. These work utilizing a coordinate system with the origin at high left:<\/p>\n

\"GraphicsDisplayCoords5.gif\"<\/p>\n

The next instance exhibits a plot of the fractal Dragon Curve; for this system see\u00a0Dragon curve<\/a>:<\/p>\n

\"LispBadgeLEDragon.jpg\"<\/p>\n

A fractal Dragon Curve drawn in Lisp on the Lisp Badge LE utilizing the graphics extensions.<\/em><\/p>\n

Assembler<\/h4>\n

The Lisp Badge LE additionally consists of an AVR assembler\u00a0which lets you generate and run machine-code capabilities, written in AVR mnemonics, utilizing an assembler written in Lisp. For particulars see AVR assembler overview<\/a>.<\/p>\n

The language consists of a number of extensions particularly for the Lisp Badge, together with plot<\/strong> and plot3d<\/strong>, for plotting graphs and 3d capabilities, and keyboard<\/strong> and check-key<\/strong> for studying the keyboard in actual time. For particulars see Lisp Badge LE extensions<\/a>.<\/p>\n

Interfaces<\/strong><\/h4>\n

These interfaces are dropped at headers on the fringe of the Lisp Badge LE board. The numbers in brackets confer with Arduino pin numbers:<\/p>\n