Teensy++ Installation

From setting the board on my desk to having a finished 'for' loop controlling the LED on the Teensy++ board: 60-90 minutes, and only because I insisted on installing the Fedora version of the arduino software first.

The Arduino world is an interesting one: the original product, both the hardware and software, was open-sourced, so now the world is teeming with knock-offs. And there are about a dozen "Genuino" boards (what they're calling them to distinguish them from the knock-offs) made by one of the original companies. And there's a dispute over who owns the name, or something like that.

For the project I'm working on, I wanted a board that was Arduino (knock-off was okay), small, and had more than 30 I/O pins. That led me to the PJRC Teensy++ 2.0, which is available through Adafruit, Sparkfun, and (the source I used) DigiKey.ca (where Adafruit was listed as the manufacturer).

The board is even smaller than I expected, essentially the width of my index finger and only about two knuckles long. The primary interface to the outside world is a rather old-fashioned USB-Mini connector.

Installing the needed software on Linux is a pain. Initially, I installed Fedora's own 'arduino' package (which dragged in a huge number of Java packages: it's ironic that a board programmed in a C/C++ variant uses an IDE written in Java ...) but that presented three significant problems: 1) it's outdated, being at version 1.6.4, 2) the PJRC Teensy software requires some other verion (you can see the specs on that page: they support one lower version, and several higher versions, but not 1.6.4), and 3) the PJRC software wants to be unpacked on top of the Arduino installation, and I have a major problem mixing OS-controlled software and non-OS-controlled software.

I grabbed the latest version of the official Arduino software for 64-bit Linux, and unpacked that in my home directory (it creates a directory called 'arduino-1.8.2'). You can delete the OS-supplied version if you want: I thought it might help to keep the OS version to help with dependencies, but the package seems to be totally self-contained. I followed the advice at Portable Arduino IDE to create a "portable/" folder under the new 'arduino-1.8.2/' folder, so everything is contained solely in that folder. I ran the software from its new folder, and confirmed in the 'Tools -> Boards:...' menu that it didn't know about the Teensy.

Copy https://www.pjrc.com/teensy/49-teensy.rules to /etc/udev/rules.d/. A reboot will cause these rules to be re-read, but you could also (as root) run udevadm control --reload-rules. If you don't do this, the board won't be recognized by your computer.

Run the "Linux Installer (X86 64 bit)" v1.3.6 from PJRC's Teensyduino software page and unpack it into the same directory as the Arduino software. With that installed, I can run the IDE and it now knows about several Teensy-variants, including the Teensy++ 2.0 that I have. The IDE itself prompted me to add my primary user to the 'dialout' and 'lock' groups (usermod -a -G dialout giles and usermod -a -G lock giles, run as root).

A last important step is, having started the arduino IDE, to select Tools -> Board ... -> Teensy++ 2.0.

So now I have a Teensy++ 2.0 hooked to my computer via a legacy USB cable, blinking its LED at longer and longer intervals - I wrote a script that increases the blink period by a few milliseconds each time on a huge loop).

Another interesting note is that if the Teensy++ is unplugged and then given power again, it starts my LED loop blink program again. This is as it should be, but it shows that in fact the "sketch" (which most people would call a "program" but Arduino doesn't) has been uploaded and permanently stored on the board, as promised.

Bibliography