Magzter GOLD ile Sınırsız Olun

Magzter GOLD ile Sınırsız Olun

Sadece 9.000'den fazla dergi, gazete ve Premium hikayeye sınırsız erişim elde edin

$149.99
 
$74.99/Yıl
The Perfect Holiday Gift Gift Now

Learn Lisp Programming Using MCUs - Part 2: Extending µLisp with Custom Functions

Circuit Cellar

|

February 2025

In the second installment of this series, Raul delves into the world of µLisp and shows how to extend capabilities by adding custom functions such as "pulsein" and "servo-create", enabling developers to interface with ultrasonic sensors and control servomotors. In Part 1, Raul presented µLisp concepts and syntax, and extensions specific to MCUs.

- Raul Alvarez-Torrico

Learn Lisp Programming Using MCUs - Part 2: Extending µLisp with Custom Functions

μLisp is a dialect of the Lisp programming language. It is tailored to microcontrollers having limited amounts of RAM, and can be run on various platforms—from the Arduino Uno based on the ATmega328, up to the Teensy 4.0/4.1 [1]. To follow the topics discussed here, you need to be acquainted with the Arduino platform and any programming language from the Lisp family. Please see Part 1 of this article series (“Crash Course Offers Insight into Pioneering Language,” Circuit Cellar 411, October, 2024) for a brief introduction to Lisp programming and the µLisp dialect [2].

With µLisp, it is possible to add your own extension functions, such that they appear as built into the language after re-compiling and flashing the µLisp interpreter to your Arduino board. There’s an excellent tutorial on how to do this on the µLisp website [3]. I will build on that tutorial to discuss how to add custom functions. For the examples presented here, I will continue to use Seeed Studio’s Wio Terminal MCU development board; but the information discussed also can be applied to other µLisp-supported Arduino boards.

EXTENDING µLISP

In general, any function not supported by default in µLisp can possibly be added as an extension to the language—for instance, hardware access functions for servomotor control. Let’s explore a simple example to help us understand how the language extension system works.

Listing 1 shows the Arduino C code for adding the pulsein extension to µLisp, which is not available by default. This extension will make it possible to measure digital pulse widths. Five sections of the listing show the µLisp extensions structure. Like the core µLisp interpreter, extensions are also written in Arduino C language. So, any extensions to the interpreter imply basically writing C code. That makes adding them straightforward, using the Arduino C language built-in functions and external libraries.

Circuit Cellar'den DAHA FAZLA HİKAYE

Circuit Cellar

Circuit Cellar

The Future of Sensors in Safety Systems Sensing the Stop

How Magnetic Sensors Are Enabling the Next Generation of Braking Systems

time to read

5 mins

December 2025

Circuit Cellar

Circuit Cellar

Alif Semiconductor Elevates Generative AI at the Edge with New Support for ExecuTorch Runtime in Its Ensemble MCUs

Alif Semiconductor, the leading global supplier of secure, connected, power efficient Artificial Intelligence and Machine Learning (AI/ML) microcontrollers (MCUs) and fusion processors, announced that developers can now use the ExecuTorch Runtime, a quantization extension of the popular PyTorch ML framework, for AI applications built to run on its Ensemble E4/E6/E8 series of MCUs and fusion processors.

time to read

1 min

December 2025

Circuit Cellar

Circuit Cellar

Encrypted MQTT Protocol for Critical Sectors

Mechanisms, Challenges, and Best Practices

time to read

3 mins

December 2025

Circuit Cellar

Circuit Cellar

Datasheet: Small Size, Big Power

Smaller Microcontrollers Bring New Possibilities

time to read

9 mins

December 2025

Circuit Cellar

Circuit Cellar

Analog Devices Launches ADI Power Studio and New Web-Based Tools

Analog Devices, Inc. (ADI), a global semiconductor leader, announced the launch of ADI Power Studio, a comprehensive family of products that offers advanced modeling, component recommendations, and efficiency analysis with simulation.

time to read

1 mins

December 2025

Circuit Cellar

Circuit Cellar

Compact IBR300 2.5" SBC Powered by NXP i.MX 93 from IBASE

IBASE Technology, Inc., a leading provider of rugged embedded computing platforms, announced the release of the IBR300, a 2.5\" RISC-based single board computer (SBC) powered by the NXP i.MX 93 processor with dualcore ARM Cortex-A55 (up to 1.7GHz) and a Cortex-M33 MCU.

time to read

1 min

December 2025

Circuit Cellar

Circuit Cellar

Sensors in the Spotlight

The Next Decade of Embedded Sensor Systems

time to read

12 mins

December 2025

Circuit Cellar

Circuit Cellar

Bob's Wrap Up

In Bob's last article with Circuit Cellar, he attempts to wrap up a career of more than 50 years as an embedded systems engineer and 14 years with Circuit Cellar. He looks at each of his 58 articles by category and provides some recommendations for his fellow engineers.

time to read

7 mins

December 2025

Circuit Cellar

Circuit Cellar

Designing Embedded Software Architectures That Last

I've reviewed hundreds of firmware projects over the years, and one thing always stands out: the most successful projects have a clear, deliberate architecture.

time to read

10 mins

December 2025

Circuit Cellar

Circuit Cellar

Broadcom Introduces Industry's First Wi-Fi 8 Silicon Ecosystem Powering the AI Era

Broadcom, Inc. unveiled the first Wi-Fi 8 silicon solutions for broadband wireless, targeting residential gateways, enterprise access points, and smart mobile clients.

time to read

1 mins

December 2025

Listen

Translate

Share

-
+

Change font size

Holiday offer front
Holiday offer back