Arduino M0 boards
The Arduino Zero and Arduino MKRZero are based on the SAMD21 ARM Cortex-M0+ core and provide 256 Kbytes of flash and 32 Kbytes of RAM. They save images to the program flash.
Boards
Arduino Zero
The Arduino Zero is based on the Atmel SAMD21 ARM Cortex M0+ CPU, with 256 KB flash memory, 32 KB RAM, and a 48 MHz clock:
Connect to the Programming USB port to use uLisp, as this corresponds to Serial, or to use the Native USB port compile uLisp with the directive:
#define Serial SerialUSB
LEDs
Like the Arduino Due, the Arduino Zero has an orange LED connected to the digital pin 13 which you can flash with the following program:
(defun blink (&optional x) (pinmode 13 :output) (digitalwrite 13 x) (delay 1000) (blink (not x)))
Run it by typing:
(blink)
Pin 13 can also be used as an analogue pin, so you can pulsate the orange LED slowly on and off with the program:
(defun pulse () (let (down) (loop (dotimes (x 256) (delay 5) (analogwrite 13 (if down (- 255 x) x))) (setq down (not down)))))
Run it by typing:
(pulse)
Exit from either program by entering ~.
Analogue inputs
The Arduino Zero has analogue inputs on pins 15 (A0) to 19 (A5).
Analogue reference
The Arduino Zero provides the following options for analogreference:
Keyword | Description |
:ar-default | Default internal reference of 3.3 V |
:ar-internal1v0 | Internal reference of 1.0 V |
:ar-internal1v65 | Internal reference of 1.65 V |
:ar-internal2v23 | Internal reference of 2.23 V |
:ar-external | Voltage applied to the AREF pin |
Analogue outputs
The Arduino Zero provides PWM analogue output to pin numbers 3 to 6, 8 to 13, and 14 (DAC0).
Serial
The Arduino Zero provides Serial on pin numbers 31 (RX) and 30 (TX), and Serial1 on pin numbers 0 (RX) and 1 (TX).
SPI
The Arduino Zero has one accessible SPI port on pin numbers 22 (MISO), 23 (MOSI), and 24 (SCK). It can use a clock rate of between 100 kHz and 12 MHz.
I2C
The Arduino Zero provides I2C on pin numbers 20 (SDA) and 21 (SCL).
Wemos SAMD21 M0
The Wemos SAMD21 M0 board is compatible with the Arduino Zero M0 [1]:
To reduce cost it has only one programming port, and no debug port. I recommend using the Arduino MKRZERO board option to use this board.
Note that earlier versions of this board didn't seem to talk to the Arduino IDE correctly (and incidentally, had an annoyingly bright red power LED). Recent boards seem to work fine (and have a nice faint power LED).
Arduino MKRZero
The Arduino MKRZero is similar to the Arduino Zero, but in a smaller form-factor board. It also includes a micro-SD card socket, allowing an SD card to be used for saving and loading uLisp images:
LEDs
The Arduino MKRZero has an orange LED connected to the digital pin 32 which you can flash with the following program:
(defun blink (x) (pinmode 32 t) (digitalwrite 32 x) (delay 1000) (blink (not x)))
Run it by typing:
(blink t)
Exit from the program by entering ~.
Analogue inputs
The Arduino MKRZero has analogue inputs on pins 15 (A0) to 21 (A6).
Analogue reference
The Arduino MKRZero provides the following options for analogreference:
Keyword | Description |
:ar-default | Default internal reference of 3.3 V |
:ar-internal1v0 | Internal reference of 1.0 V |
:ar-internal1v65 | Internal reference of 1.65 V |
:ar-internal2v23 | Internal reference of 2.23 V |
:ar-external | Voltage applied to the AREF pin |
Analogue outputs
The Arduino MKRZero provides PWM analogue output to pin numbers 0 to 8, 10, 18, and 19.
Serial
The Arduino MKRZero provides Serial1 on pin numbers 13 (TX) and 14 (RX).
SPI
The Arduino MKRZero has one accessible SPI port on pin numbers 10 (MISO), 8 (MOSI), and 9 (SCK). It can use a clock rate of between 100 kHz and 12 MHz.
I2C
The Arduino MKRZero provides I2C on pin numbers 11 (SDA) and 12 (SCL).
Wemos SAMD21 M0-Mini
A similar compact ATSAMD21-based board is the Wemos SAMD21 M0-Mini Module [2]:
It works with the Arduino IDE; I got good results with the Boards Manager Arduino MKRZERO option, and the performance with uLisp is identical to the Arduino MKRZERO.
- ^ Wemos SAMD21 M0 board on Banggood.
- ^ Wemos SAMD21 M0-Mini Module on Banggood.