🛠 Premiers pas sur la Teensy 3.2 : Teensyduino, HalfKay et premier Blink

Teensy 3.2 · debutant · Schéma : IMG-teensy-32-debutant-1-teensy32-premiers-pas-teenyduino.svg — Teensy 3.2 vue de dessus sur une breadboard compacte, flèches sur la puce MK20DX256, le bouton Program, la LED orange de la broche 13 et le connecteur micro-USB ; en médaillon la fenêtre Teensy Loader affichant « Press Button ».

Objectives

Discover the Teensy 3.2, PJRC's (USA) most famous board: an NXP/Freescale MK20DX256VLH7 (ARM Cortex-M4 without hardware FPU) clocked at 72 MHz, officially overclockable to 96 MHz, with 256 KB of flash and 64 KB of RAM. This first tutorial sets up the environment — Arduino IDE + "Teensy boards" add-on — and uploads your first program, while understanding this board's unique programming architecture: the HalfKay bootloader lives in a physically separate chip (all main flash is free for your code and the bootloader cannot be destroyed by a failed flash), the program executes immediately upon power-up (no bootloader delay as on classic Arduinos), and flashing is driven by the Teensy Loader application, invoked automatically by the IDE.

Hardware

Environment Installation

  1. Install the Arduino IDE, then the Teensy add-on: via the IDE's Boards Manager, or by downloading Teensyduino from <https://www.pjrc.com/teensy/td_download.html>. The add-on includes a vast collection of libraries optimized for the Cortex-M4.
  2. Other supported environments: PlatformIO (cross-platform), Visual Micro (Visual Studio, commercial), or the command-line Makefiles shipped with Teensyduino in {Arduino}/hardware/teensy/avr/cores/teensy3/Makefile.
  3. In the IDE: Tools > Board > Teensy 3.2, then select the USB port.

Complete Code

// Blink version Teensy : la LED orange est sur la broche 13.
void setup {
  pinMode(13, OUTPUT);
}

void loop {
  digitalToggle(13);   // fonction propre à Teensy : inverse l'état de la broche
  delay(500);
}

Uploading

Click Upload: the IDE compiles, then Teensy Loader opens and requests entry into programming mode. If the board does not switch automatically, press the small Program button near the USB connector (or briefly connect the Program pin to GND). Since HalfKay is in a separate chip, a buggy sketch cannot destroy the bootloader: the button remains always available to regain control — this is your permanent safety net.

Expected Verification

The orange LED blinks every 500 ms upon power-up, with no startup delay. Unplug and replug: the program restarts instantly — the major difference from classic Arduinos. For the Serial Monitor, set Tools > USB Type: Serial and add a Serial.begin(9600) in setup.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials