Home > Arduino > Trying Arduino Leonardo with Arafruit 32U4 breakout board+

Trying Arduino Leonardo with Arafruit 32U4 breakout board+

Thursday September 22nd, 2011 morecat_lab


Last week a set of new Arduino is introduced at Open Hardware Summit.

I’m interested in Arduino Leonardo, which is the low end board with ATMega32U4 micro processor with USB. Although the schematic of Leonardo is not published at this point, the design of Leonrdo must be straight forward, except the assignment of digital and analog pins.

The firmware and core codes for Arduino Leonardo are already in Arduino 1.0 RC1, which was published in September 17.

I decide to try Leonardo with Arafruit 32U4 breakout board+, as it also uses ATmega32U4.

32U4 breakout board


3. Burning the boot loader

You need to burn boot loader from Arduino 1.0 RC1. I use ISP programmer with the following steps.

  • solder an ISP connector on 32U4 Breakout board. Connect ISP programmer with the connector.
  • On Arduino 1.0 RC1, choose ‘Tools’ ->’ Board’ -> ‘Arduino Leonardo’
  • Choose ‘Tools’ -> ‘Programmer’ -> ‘USBTinyISP’
  • Choose ‘Tools’ ->’BurnBootloader’, then wait a couple of minutes
Burn Bootloader 'Arduino Leonard' to 32U4 breakout board

Burn Bootloader 'Arduino Leonard' to 32U4 breakout board

4. Try Blink example

After burning firmware, I connected the breakout board to Mac with USB port.  From Mac, the board is recognized as ‘Arduino Leonardo’

I open an example sketch named blink, then download the program to Leonardo.

Connect a LED to Pin13 (PC7) for blink example

Connect a LED to Pin13 (PC7) for blink example

5.Human Interface Device (Mouse)

The most interesting feature of Arduino Leonardo is the emulation of Mouse and Keyboard. One can make USB-HID class device with Leonardo.

I tried one of example sketch named JoystickMouseControl for the next step.

The following hardware setting is used for my trial.

  • Connect two 10K Ohm pods to A1(PF6) and  A2(PF5).
  • Connect a tact switch to D6(PD7) and GND
  • Connect a LED and register to D5(PC6)

wires to run JoystickMouseControl example

wires to run JoystickMouseControl example

The following pins are assigned on Arduino Leonardo, according to the file (hardware/arduino/variants/leonardo/pins_arduino.h)

// D0                 PD2                    RXD1/INT2
// D1                 PD3                    TXD1/INT3
// D2                 PD1        SDA         SDA/INT1
// D3#                PD0        PWM8/SCL    OC0B/SCL/INT0
// D4        A6       PD4        ADC8
// D5#                PC6        ???         OC3A/#OC4A
// D6#       A7       PD7       FastPWM      #OC4D/ADC10
// D7                 PE6                    INT6/AIN0
// D8                 PB4                    ADC11/PCINT4
// D9#       A8       PB5       PWM16        OC1A/#OC4B/ADC13/PCINT5
// D10#      A9       PB6       PWM16        OC1B/0c4B/ADC12/PCINT6
// D11#               PB7       PWM8/16      0C0A/OC1C/#RTS/PCINT7
// D12       A10      PD6                    T1/#OC4D/ADC9
// D13#               PC7       PWM10        CLK0/OC4A
//           A0        PF7                    ADC7
//           A1        PF6                    ADC6
//           A2        PF5                    ADC5
//           A3        PF4                    ADC4
//           A4        PF1                    ADC1
//           A5        PF0                    ADC0
// New pins D14..D17 to map SPI port to digitial pins
// D14                 PB0                    RXLED,SS/PCINT0
// D15                 PB1                    SCK,PCINT1
// D16                 PB2                    MOSI,PCINT2
// D17                 PB3                    MISO,PCINT3
// TXLED               PD5
// RXLED               PB0
// HWB                 PE2                    HWB


Categories: Arduino Tags:
  1. Anonymous
    Thursday October 6th, 2011 at Thursday October 6th, 2011 | #1

    Thanks for documenting your findings! I’d like to make my own tiny Leonardo variant and I was having a little trouble finding pin mappings considering the schematic wasn’t published yet. Take care!

  2. Friday October 21st, 2011 at Friday October 21st, 2011 | #2

    How can I use Arduino Duemilanove or USBasp programmer instead of USBtinyISP to burn the boot-loader of Arduino Leonardo on to ATmega32U4 chip? Thanks


  3. Friday October 21st, 2011 at Friday October 21st, 2011 | #3

    Find a configuration file located at “hardware/arduino/programmers.txt” in arduino IDE.
    Add an entry for Usbasp described below;
    Now, you can choose Usbasp in Arduino IDE.


  4. Sunday October 23rd, 2011 at Sunday October 23rd, 2011 | #4

    Thanks for that awesome posting. Useful, and it saved MUCH time! :-)

  5. Bhags
    Monday October 24th, 2011 at Monday October 24th, 2011 | #5

    Thanks for USBasp tips.

    I have made my own ATmega32U4 board and downloaded Arduino L30N4RD0 bootable to it.
    When I connect the board to PC, it request driver/software for Arduino L30N4RD0 bootable!
    Where can I find the it?



  6. Monday October 24th, 2011 at Monday October 24th, 2011 | #6

    Although I didn’t try myself, the driver for Windows seems to be in Arduino 1.0 RC1 package. Find the file named “Arduino Leonardo.inf” in drivers folder.


  7. Bhags
    Monday October 24th, 2011 at Monday October 24th, 2011 | #7

    Thanks a lot!
    Yoshi あなたは天才です!

    The custom made ATmega32U4 board is detected as Arduino L30N4RD0!
    But when I try to upload the program: It uploads only about 90% and doesn’t reach 100%.
    Why? (HWB pin set to ground via 100 Ohm resistor)
    Also if I connect USBasp I can program the board through it but I want to program directly through Arduino L30N4RD0.

  8. Bhags
    Monday October 24th, 2011 at Monday October 24th, 2011 | #8



  9. Bhags
    Monday October 24th, 2011 at Monday October 24th, 2011 | #9

    After it stuck there for a minute, Ihave pressed RESET and ここでの写真です
    got this error:
    avrdude: ser_send(): write error: sorry no info avail ??

  10. Bhags
    Tuesday October 25th, 2011 at Tuesday October 25th, 2011 | #10

    私は問題を修正しました。それは、HWBに関係しています。それは滑らかなwithArduino L30N4RD0のソフトウェアを動作します!


  11. Wednesday October 26th, 2011 at Wednesday October 26th, 2011 | #11

    I’m grad to hear you had succeeded. Enjoy your new toy. -Yoshi

  12. Tuesday November 15th, 2011 at Tuesday November 15th, 2011 | #12

    Thanks :-)
    Do you know if Arduino Leonardo supports USB serial?
    For example Teensy supports upto 12Mbits/sec

    I’ve tried with Leonardo and I’m getting only 690Kbits/sec! Too slow.. :-( (

  13. Sandro
    Saturday February 25th, 2012 at Saturday February 25th, 2012 | #13


    Bhags :
    私は問題を修正しました。それは、HWBに関係しています。それは滑らかなwithArduino L30N4RD0のソフトウェアを動作します!

    I have the same problem, what is the solution?. I don’ t understand about HWB.

Comments are closed.