Home > Arduino, Code > Arduino Leonardo (early) Resources

Arduino Leonardo (early) Resources

February 11, 2012 Leave a comment Go to comments

Update 4/5/12: More Interrupt resources. See interrupt section.

The Arduino Leonardo is not yet available for sale, but it seems it will become the most popular board as there are many other 32U4-based implementation appearing and/or claiming compatibility with the Arduino IDE.

I don’t think the Arduino team popularized this microprocessor, but their implementation in the Leonardo board is making everyone coalesce around the Arduino IDE.

You can read an earlier post on the differences and advantages with the “standard” Arduino board

Arduino IDE support for the Leonardo board is still under development. But here are some resources and compatible boards that you can use in the meantime:

The latest Arduino software: [link]

Burning the Leonardo bootloader with another Arduino board[link]

The process has been a bit complicated because of several “bugs”, but this seems the latest:

1- Download both the latest Arduino 1.0 software  [link]. Only Arduino 1.0 has built in s/w to burn bootloaders with an Arduino board.

2- In Arduino-1.0/Hardware/Arduino/boards.txt, uncomment the Leonardo lines (remove the “#”). This allows the Leonardo option to show up in the “Boards” menu. If you already see “Arduino Leonardo”, then you don’t have to do this step

3- Get the latest version of Arduino ISP: [link]. An earlier version required that you compile with Arduino 022, but this version compiles with Arduino 1.0. Copy the sketch and paste it into a blank sketch. Then compile and upload to the Arduino you are using as the programmer. Now you have the programmer ready to burn the bootloader into a destination board.

4- Make the connections [link] (bottom board is the programmer)

You can also use the ICSP header, which has the following pin assignments:

 

Note that the ICSP header perfectly matches the wiring for the destination board (because it assumes you will use an ISP programmer to program the chip). For the source board, the Reset pin is not used. Instead you must use Pin10 as shown in the connection diagram

Arduino®-Leonardo HID Keyboard & Mouse Tutorial and Advanced Examples [link]

This tutorial covers the Arduino “Leonardo” platform which uses the new USB-enabled ATmega 32U4 MCU, with a very powerful bootloader environment that emulates both a USB mouse and keyboard (standard HID devices, no drivers needed), as well as a virtual COM port!

Arduino®-Leonardo Interrupts

As of Arduino 1.0, interrupts are not supported on the Arduino Leonardo…Long story short, I ended up copying the macros for interrupt bitmasks/registers from the Teensyduino project, which has a mega32u4 target board. [link]

I used the vinciDuino in the Arduino IDE 1.0, the original Leonardo isn’t in stock, the IDE didn’t support the Board completly (it’s not nessesary at this piont). I have integrated the PCINT and Interrupt (attachinterrupt, detachinterrupt) functionality in the files from the IDE.  fm did me a great favor and look with me at the result, so here are the edited files. (need account to the forums to see the files) [link]

Serial communications with 32U4/Arduino

The 32U4 has two serial ports. One that communicates with the computer through USB to the serial monitor (the serial monitor in the Arduino software) and one that communicates through hardware pins in the board. Code example:

/* Pro Micro Test Code
   by: Nathan Seidle
   modified by: Jim Lindblom
   SparkFun Electronics
   date: January 20, 2012
   license: Public Domain - please use this code however you'd like.
   It's provided as a learning tool.
   
   This code is provided to show how to control the SparkFun
   ProMicro's TX and RX LEDs within a sketch. It also serves
   to explain the difference between Serial.print() and
   Serial1.print().
*/
int RXLED = 17;  // The RX LED has a defined Arduino pin
// The TX LED was not so lucky, we'll need to use pre-defined
// macros (TXLED1, TXLED0) to control that.

void setup()
{
 pinMode(RXLED, OUTPUT);  // Set RX LED as an output
 // TX LED is set as an output behind the scenes

 Serial.begin(9600); //This pipes to the serial monitor
 Serial1.begin(9600); //This is the UART, pipes to sensors attached to board
}

void loop()
{
 Serial.println("Hello world");  // Print "Hello World" to the Serial Monitor
 Serial1.println("Hello!");  // Print "Hello!" over hardware UART

 digitalWrite(RXLED, HIGH);   // set the LED on
 TXLED1; //TX LED is not tied to a normally controlled pin
 delay(1000);              // wait for a second
 digitalWrite(RXLED, LOW);    // set the LED off
 TXLED0;
 delay(1000);              // wait for a second
}

Leonardo clones/ATmega32U4-based boards

These boards are compatible with Arduino 1.0 software. Basic compatibility with Arduino s/w requires that the Arduino bootloader be loaded into the microprocessor.  Because Arduino s/w is still under development, expect re-loading the bootloader in the future. Some boards come with the more generic AVR bootloader.

Teensy 2.0 [link]. The Grandfather of 32U4 boards.

  • Not an Arduino clone
  • But compatible with Arduino s/w after installing the necessary files
  • The Arduino Leonarno board is not yet available and the s/w is still under development. Right now, theTeensy board and the associated software “Teensyduino” is the more mature environment for USB HID development.

Vinciduino [link] -Arduino Leonardo bootloader preinstalled

  • Same form factor and pin arrangement as Arduino Pro
  • Unlike Leonardo, the board has the second UART conveniently broken out from the board
  • Discussions here: [link]

Olimex T32u4 board [link]: T-shaped Leonardo derivative

  • Designed for proto-board integration

Adafruit Atmega32u4 Breakout Board [link] and [link] -ARV109 bootloader preinstalled

Paperduino Leonardo [link] -100% Do it Yourself

Leostick [link] -Arduino Leonardo bootloader preinstalled

SparkFun Arduino Pro Micro [link] -Arduino Leonardo bootloader preinstalled

Strawberry Linux [link] and [link] -Arduino Leonardo bootloader preinstalled

MattairTech [link] CDC (Arduino/AVRDUDE) or DFU (FLIP) bootloader preinstalled

zoneCoffee [link]

  • ZonCoffee is an Arduino sketch (and board) created for the purpose of espresso machine temperature regulation. The sketch reads the temperature with a thermocouple, and uses the temperature to control the boiler temperature with a PID loop.

CalEng BreadBoarder-32U4 Arduino®-Leonardo Compatible Breakout-Prototyping Board [link]

  • A key feature of the BreadBoarder is how the pinout of the headers matches* the standard Arduino board pinout, making it much more intuitive to work with compared to other breadboard solutions.

MK90 Freeduino 32U4 [link]

C.I.R.E., 100% DIY [link]

Micropnedous2 [link]

  • Features a microSD connector in SPI Mode (in the back side).

? [link]

Leonard Pirate [link]

And here is the Arduino Leonardo for reference

  1. alt
    February 14, 2012 at 13:36
  2. Anonymous
    February 15, 2012 at 22:54

    So, if one were to start out today to use your code, what board would you recommend they buy?

  3. Anonymous
    February 16, 2012 at 18:57

    Thx, anything in the US? It costs more to ship it than to pay for it and the delivery is pretty long. TIA

    • BlogGeanDo
      February 16, 2012 at 21:24

      In US, there are many: NCKelectronics, Sparkfun, Adafruit, etc…

      • Nkc
        June 11, 2012 at 20:05

        Correction: NKCelectronics

    • May 22, 2012 at 14:15

      There’s a new US board available. We saw the need for a Leonardo clone with a larger form factor, similar to the UNO. It’s got a few added features and is based on the Vinci. see them at http://www.olympiacircuits.com/leolympia.html. We’re in Olympia, WA, so the board has an Olympia theme. It’s using the Leonardo bootloader, so it’s simple to get going.

  4. Anonymous
    February 16, 2012 at 22:51

    So, should I just buy a Teensy then and will that work?

    • BlogGeanDo
      February 17, 2012 at 04:00

      In theory. But I have not tested it in the Teensy. If you are new to this, better buy a standard Arduino (UNO R3 is the latest)

  5. fefa
    August 31, 2012 at 14:49

    This excellent website certainly has all of the information and facts I wanted concerning this subject and didn’t know who to ask.

    • BlogGeanDo
      August 31, 2012 at 15:04

      I am glad you find the information useful. The official leonardo board has been recently released.

  6. August 31, 2012 at 15:03

    Way cool electronic! Some very valid points! I appreciate you writing this article and also the rest of the website is also very good.

  7. September 14, 2016 at 15:02

    mundial 2014 online

  8. September 14, 2016 at 15:55

    vergleich versicherung Maklerzentrum

  9. September 14, 2016 at 16:04

    argentina vs bosnia online

  10. September 14, 2016 at 16:35

    Network Marketing Comp Plans

  11. September 14, 2016 at 17:22

    duct cleaning houton

  12. September 14, 2016 at 17:30

    United States Press Release Distribution

  13. September 14, 2016 at 19:09

    legal highs

  14. February 4, 2020 at 22:40

    sites to find sex

  1. No trackbacks yet.

Leave a comment