Home | Tutorials | A ProMicro Installation and Arduino Briefing

A ProMicro Installation and Arduino Briefing
by Jimb0 | January 20, 2012 | 23 comments Skill Level: Beginner


Welcome to the new frontier of Arduino-compatible boards; all made possible by the ATmega32U4! No longer does your Arduino need to be harnessed by an FTDI Cable, or an ATmega8U2, or anything who's sole purpose is acting as an intermediary between your Arduino and your computer.

The SparkFun Pro Micro is a really cool, little development board. It's an Arduino-compatible microcontroller, micro-sized, and it accomplishes with one single chip what old Arduino Unos, Duemilanoves, and Diecimeilllas could never dream of: true USB functionality.

As exciting as early-adoption can be, there are bound to be some gotchas along the way. This tutorial is here to aid in avoiding the common pitfalls, and get your ProMicro up and running as swiftly as possible. So, without further ado...

Driver Installation

As with everything, it begins with installing drivers. I'm going to single out you Windows users here. Your driver installation is much more involved than the Mac people. iPeople can plug your board in and jump down to the next section, on using the ProMicro with Arduino.

Before we begin, we need to get you the driver. Click here to download the driver file. Unzip that zip file, and don't forget where you've left its contents. In that zip file, you should find a "SparkFun ProMicro.inf" file, which contains all the information Windows needs to install the ProMicro's driver.

If you haven't already, go ahead and connect the ProMicro to your computer. The "Found New Hardware" balloon should pop up. It should let you know it found the "SparkFun ProMicro bootloader". I'm going to use Windows XP screens here, but users of other Windows versions should be able to follow along closely.

Following that alert, you should be greeted with the "Found New Hardware Wizard". On the first screen here, select "No, not this time", and click "Next".

On the next screen, choose "Install from a list or specific location." Look at you, so "Advanced"! Click "Next".

On the next "Found New Hardware Wizard" window, select "Don't search. I will choose the driver to install." And hit Next.

On the next window select "Have Disk...". Which'll pop up the "Install From Disk" window. On that dialog, select "Browse...". And, finally, navigate to your unzipped driver file, select "SparkFun ProMicro.inf", and click "Open".

Click "OK" on the "Install From Disk" prompt. And you should be greeted by this screen:

Click "Next>". If your then prompted by a "Hardware Installation" alert, saying something about the SparkFun ProMicro not passing Windows Logo testing, go against their recommendation (once again) and click "Continue Anyway".

Now just give Windows a few moments to work its Wizard-magic, and you should be greeted with this wonderful Window:

If at this time, the Hardware Wizard returns, and asks you to do it all over again, follow the steps above to repeat driver installation. I promise you shouldn't have to do this install more than twice (for the SparkFun Driver at least muwahaha).

To verify that driver installation went well, go to your Device Manager (either Right click on "My Computer" > select "Properties" > "Hardware" tab > and click "Device Manager", or just run "devmgmt.msc" from the "Run..." dialog). The Device Manager should have two entries for the SparkFun ProMicro: one will be under the "Ports (COM & LPT)" tree, and another will be anonymously listed under the "Human Interface Devices" tree. Take note of which COM port the ProMicro has been assigned under the "Ports (COM & LPT)" tree (e.g. mine's 32).

Using the ProMicro in Arduino

We're still not completely ready for Arduino, but this is the final stretch. Before you can use the ProMicro in the Arduino IDE, you need to enable the "Arduino Leonardo" board. As Arduino has yet to officially release the Leonardo, they chose to keep the board disabled by default, but it's easy to enable.

First, go to the boards.txt file within your Arduino install. This will reside in the \hardware\arduino folder of your Arduino install. This is where Arduino defines every one of the boards that can be used within the IDE. It's an exhaustive list, and it's just getting longer and longer.

Scroll down to line 147, which should look like this:

#leonardo.name=Arduino Leonardo

The '#' there is a comment (just like "//"), which tells the Arduino IDE to ignore those lines. We just need to un-comment every one of those lines that begins with "#leonardo.", so delete all 15 of the "#"'s from lines 147-161. When you're done, it should look something like this:

SAVE boards.txt, and close it.

Finally you can open up Arduino 1.0. If you've had any Arduino windows open, while you were editing "boards.txt", close them and restart Arduino. You should see "Arduino Leonardo" under the "Tools > Board" menu. Select it.

You should also see your ProMicro's COM port under the "Tools > Serial Port" menu. Select it.

Upload Blink (File > Examples > 1.Basics > Blink) to the ProMicro, and get yourself ready for a big *sigh*. As you Windows XP users will be greeted by a familiar-looking bubble notification:

Time to install more drivers! But, didn't you already install these drviers...twice? Well you most certainly installed the SparkFun ProMicro drivers, but the sketch you just sent over to the ProMicro just installed Arduino USB stuff on top of the SparkFun USB stuff.

So, now you'll have to go through the same process, with one kink in the road. You'll now be pointing the "Found New Hardware Wizard" to Arduino's driver file, instead of SparkFun's. The "Arduino Leonardo.inf" file is located in the "drivers" folder of your Arduino 1.0 installation.

Aside from that blip, follow the same process you did earlier as you install your "Arduino Leonardo" driver. Now, if you go to the Device Manager, you should notice a few differences from earlier.

The name of your device under the "Ports (COM & LPT)" tree should have changed to "Arduino Leonardo (COM[N+1])". That's right, you should have another new COM port number. Usually it'll be one number above your SparkFun ProMicro (I've uninstalled, and reinstalled these drivers so many times, my computer doesn't know what to think anymore). From now on, you'll always use the Arduino Leonardo's COM number. I promise it won't change on you anymore. And you're done installing drivers!

Arduino Gotchas and the SparkFun ProMicro

Now that we've finally got the drivers under control, let's revist the Blink sketch you uploaded to your board. I expect your ProMicro is not actually blinking. There are two LEDs on the ProMicro - TX and RX indicators. You should notice them blink as you upload your sketch, but beyond that they'll only blink when there's USB communication.

Those RX and TX LEDs can still be controlled in your Arduino sketch, though. Give this example code a try:

	 
/* 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
}

You can control the RX LED just as you would any other digital pin. Set it as an output, and digitalWrite() it HIGH or LOW.

The TX LED was not provided an Arduino-defined pin, unfortunately. So you'll have to use a pair of macros to control it. TXLED1 turns the LED on, and TXLED0 turns the LED off.

In that sketch, you'll also notice a pair of Serial-type begin() statements: Serial.begin(9600), Serial1.begin(9600). That '1' makes a huge difference. Think of the ProMicro having two separate serial ports. One port is for communication to and from the computer (over USB, the Serial Monitor); that's the one without the '1'. And the other port is a real, hardware UART; that's the one with the '1'. That's where you could talk to another Arduino, or any hardware device that requires serial communication.

If you run the above sketch, and open up the Serial Monitor, you should only see "Hello world" printed. "Hello!" is being sent out over the hardware UART, where, presumably, nothing is listening. This begs the age-old question: "if a ProMicro is saying 'Hello!' over the hardware serial port, and nothing's there to hear it, does the ProMicro really say anything at all?"

When using the Serial Monitor with the Pro Micro, I'd caution you to be patient. Every time you upload a new sketch to the Pro Micro, Windows will need to work its driver magic before you can open up the COM port. This can take a few seconds after the code has finished uploading. If you try to open the serial monitor before Windows has setup the COM port, you'll probably be greeted with a Arduino error like this:

You won't be able to select your COM port, because it will have permanently disappeared from the "Tools > Serial Port" menu.

To solve this issue, you need to shut down all Arduino windows. Disconnect the Pro Micro, and then reconnect it. AFTER Windows has installed the driver, re-open Arduino, and you should be good to procede as normal from that point.

Conclusion

I hope that helps get you on your way towards using this magical little device. I think it's a great platform, and it opens up a new world of possibilities. It really is great only having to worry about a single chip in all this Arduino madness.

If you've got any questions, or comments, or need anything in this tutorial clarified, please don't hesitate to leave a comment here, on the ProMicro product page, or email our tech support team (techsupport@sparkfun.com).

Know that this bootloader is still very much in a beta-type phase, there are some kinks to work out. Still it's a really cool board, and loading your sketch directly over USB is way sweet.

Have fun and good luck (we're all counting on you)!

Comments 23 comments

  • “Completed found new hardware wizard… Winning!” :D

  • Is there linux support for this?

  • Nice tutorial! Any tips on the best way to connect one to an XBee?

  • Are the drivers digitally signed so that it works with Win 7?

    Can you use it with older Arduino environments (pre-1.0)?

    • Win 7 works a treat! (at least for the “official” Arduino bootloader, can’t absolutely speak to the SF version)

      Nope, Leonardo is completely specific to 1.0RC1 and above.

      The ATmega32U4 is a completely different architecture to any other ATmega used before, so it required new pin, I/O, and Timer definitions. Theoretically you could write support for v023, but why bother? ;)

  • Anyone got this working with Win7x64? First time round, it enumerated on USB as a SparkFun ProMicro and installed the .inf file. I then edited the boards.txt file to include leonardo and then launched arduino 1.0. It came up as a Leonardo board on COM4 so I created a blinky sketch for it and uploaded the code to the ProMicro. All seemed ok except when it re-enumerated on the USB, this time as an Arduino Leoardo on the Device Manager. When I point it at the previous .inf driver file it complains that it cannot find suitable driver software.

    From what I can see under Properties for this USB device, the VID and PID values are different (2341/0034) to what is listed in the .inf file.

  • Anyone got this working with Win7x64? First time round, it enumerated on USB as a SparkFun ProMicro and installed the .inf file. I then edited the boards.txt file to include leonardo and then launched arduino 1.0. It came up as a Leonardo board on COM4 so I created a blinky sketch for it and uploaded the code to the ProMicro. All seemed ok except when it re-enumerated on the USB, this time as an Arduino Leoardo on the Device Manager. When I point it at the previous .inf driver file it complains that it cannot find suitable driver software.

    From what I can see under Properties for this USB device, the VID and PID values are different (2341/0034) to what is listed in the .inf file.

  • Puzzled why you need a Sparkfun driver…

    If you’re using the Arduino Leonardo bootloader (seems to be a tweaked version of it…), then the drivers are already part of Arduino 1.0

    There are also quite a few caveats to Arduino Leonardo support (1.0) at the moment:

    • Analog inputs can’t be used as digital

    • Interrupts don’t work

    • Any code that assumes certain Timers are attached to specific pins, or they can be directly manipulated, will fail miserably! ;)

    • The HID mouse and keyboard examples have been removed in Arduino 1.0 (not so in RC2)

    All in all the Leonardo platform is super-cool, and an amazing bit of coding for the bootloader/runtime firmware!

  • Has anyone tried using the wire library?

  • Wow, this board is really tiny. Very nice! I managed to successfully install the drivers on Win7(64bit). Jim’s modified blink sketch works, too.

    But “TXLED0” seems to turn the TX-LED on, whereas “TXLED1” turns it off…?

    • Cool! Glad it all worked for you. I should have been more clear on the TXLED macros, but what you’re seeing is normal.

      Those macros assume that the LEDs are connected to VCC (they’re connected to ground on the Pro Micro). So TXLED0 pulls the pin high, and TXLED1 writes it low.

      Future versions of the Pro Micro will have the LEDs pulled to VCC, but for now swap everything I said about those around.

  • Hey Guys,

    I bought some days ago an older version of the pro micro (that one withe wrong-labeld pin…). My problem is that i get a blue screen after plugging it in. Are there some experiences with that kind of problem?

    Greeting from germany ;–)