Adafruit M0 Trinkeys
The Adafruit Trinkey range of boards are USB key format boards that will plug directly into a USB-A socket on a computer. The two featured here are both based on ARM M0 SAMD21 processors running at 48 MHz, with 256 Kbytes of flash and 32 Kbytes of RAM, and they are among the smallest boards that will run uLisp.
Boards
Installing uLisp from the Arduino IDE
Install the Adafruit SAMD Boards core
- Add the following URL to the Additional Boards Manager URLs list in the Arduino IDE Preferences dialog box:
https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
- In the Arduino IDE search for the Adafruit SAMD Boards core in Boards Manager and install it. I used core version 1.7.16.
- Select Adafruit SAMD (32-bits ARM Cortex-M0+ and Cortex-M4) Boards from the Board menu, and Adafruit Pixel Trinkey M0 (SAMD21) from the submenu.
uLisp doesn't have a specific configuration for the Neo Trinkey board, but the one for the Pixel Trinkey is suitable.
You can leave all the other options at their defaults.
Upload uLisp
- Download release 4.8c or later of the ARM version of uLisp from the Download uLisp page.
- Select the board's USB port from the Port menu
- Upload uLisp to the board.
Putting the board into upload mode
If the upload fails you may need to put the board into upload mode first.
- Press the Reset button twice.
Using uLisp
- You may need to select the board's USB port from the Port menu again.
- Select Serial Monitor from the Tools menu.
- Enter Lisp commands.
ARM assembler
The ARM version of uLisp includes an ARM assembler that allows you to generate machine-code functions, integrated with Lisp, written in ARM thumb code. The assembler itself is written in Lisp to make it easy to extend it or add new instructions. For more information see ARM assembler overview.
Adafruit Neo Trinkey
The Adafruit Neo Trinkey [1] provides four on-board NeoPixels and two touch pins:
NeoPixel
To control the NeoPixel from uLisp see ARM NeoPixel driver using assembler.
Touch pins
The two touch pads at the end of the board are connected to I/O pins 1 and 2 respectively. You can also use them as analogue inputs.
Adafruit Pixel Trinkey
The Adafruit Pixel Trinkey [2] is a USB-A dongle sized board for driving NeoPixel and Dotstar displays, and with a single NeoPixel on the board:
NeoPixel
To control the NeoPixel from uLisp see ARM NeoPixel driver using assembler.
Terminal block
The terminal block gives access to the following pins: GND, Data on pin 4, Clock on pin 5, and +5V. The Data and Clock lines have level shifting to 5 V logic, for ideal interfacing to NeoPixels.
JST SH connector
The 3-pin JST SH connector gives access to GND, 3V, and pin 6.
Voltage monitor
There is a resistor divider across the 5V VBUS signal and GND to allow you to read the voltage with the analogue input on pin 0. The following program displays the voltage:
(defun voltage () (/ (* (analogread 0) 6.6) 1024))
For example:
> (voltage) 5.05313
- ^ Adafruit Neo Trinkey on Adafruit.
- ^ Adafruit Pixel Trinkey on Adafruit.