ATmega4809 boards

The Arduino Nano Every and ATmega4809 Curiosity Nano are based on the Microchip ATmega4809, which is a slight upgrade to the popular ATmega328P used in the Arduino Uno.

It runs with a 20 MHz internal oscillator, and so is a bit faster than the ATmega328P, and provides a more generous 48 Kbytes of flash memory and 6 Kbytes of RAM. Unfortunately the ATmega4809 only provides 256 bytes of EEPROM, compared to the ATmega328P's 2 Kbytes, so save-image will only be usable for very short programs.

You should install the AVR-Nano version of uLisp, which excludes the documentation and array features which would otherwise prevent it from fitting within the program memory on the ATmega4809.


Arduino Nano Every

ATmega4809 Curiosity Nano

Arduino Nano Every


The Arduino Nano Every [1] is a low-cost board based on the ATmega4809. It's available with or without headers.

I didn't originally recommend the Arduino Nano Every for uLisp because there were issues with its serial interface support, but the latest Arduino megaAVR Boards core seems to have fixed the issues, so I can now recommend it. It's supported by AVR uLisp Version 3.2 onwards.


The Arduino Nano has a yellow LED connected to pin 13 which you can flash with the following program:

(defun blink (&optional x)
  (pinmode :led-builtin :output)
  (digitalwrite :led-builtin x)
  (delay 1000)
  (blink (not x)))

Run it by typing:


Exit from the program by entering ~.

ATmega4809 Curiosity Nano

Microchip's ATmega4809 Curiosity Nano evaluation board makes a very low-cost platform for running uLisp.

The ATmega4809 provides 48 Kbytes of flash memory, 6 Kbytes of RAM, and 256 bytes of EEPROM, and runs with a 20MHz internal oscillator. The board includes a debugger, providing a USB-to-serial interface:


It's available from suppliers such as Farnell [2].

Installing uLisp from the Arduino IDE

  • First download the latest AVR version of uLisp from the Download uLisp page.
  • Install MCUdude's MegaCoreX from GitHub, as described in MegaCoreX - How to install.
  • On the Board menu, under the heading MegaCoreX select Atmega4809.
  • Check that the subsequent options are set as follows (ignore any other options):

Clock: "20MHz"
Pinout: "48 pin standard"
Programmer: "Atmel nEDBG (ATSAMD21E18)"

  • Connect the board to the computer via USB.
  • Select the device corresponding to the USB port from the Port menu.
  • Upload uLisp to the board.

You should then be able to select Serial Monitor from the Tools menu, and enter Lisp commands.


The Curiosity Nano has a yellow LED connected to pin 39 which you can flash with the following program:

(defun blink (&optional x)
  (pinmode 39 :output)
  (digitalwrite 39 x)
  (delay 1000)
  (blink (not x)))

Run it by typing:


Exit from the program by entering ~.

Pin 39 can also be used as an analogue output pin, so you can pulsate the yellow LED slowly on and off with this pulse program:

(defun pulse ()
   (dotimes (x 512) 
     (delay 5) 
     (analogwrite 39 (if (> x 255) (- 511 x) x)))))

Run it by typing:


As before, exit from the program by entering ~.

You can save the Pulse program to EEPROM by typing the command:


You can now load it again after a reset by typing:


Note that there's very little EEPROM on the ATmega4809, so this is close to the largest program you will be able to save with (save-image).

  1. ^ Arduino Nano Every with headers on Arduino Store.
  2. ^ DM320115 - Evaluation Board, Curiosity Nano, ATmega4809 on Farnell.