Summary of Contents for sparkfun Qwiic Pro Micro USB-C
Page 1
Qwiic Pro Micro USB-C (ATmega32U4) Hookup Guide Introduction Heads up! This is for the Qwiic Pro Micro USB-C (ATmega32U4) version. If you are looking for information about hardware on the Pro Micros with the micro-b USB connector, make sure to check out the older Pro Micro &...
Page 2
To follow along with this tutorial, you will need the following materials at a minimum. You may not need everything though depending on what you have. Add it to your cart, read through the guide, and adjust the cart as necessary. SparkFun Qwiic Pro Micro - USB-C Reversible USB A to C Cable - 0.8m (ATmega32U4) ...
Page 3
Photon Stackable Header - 12 Pin CAB-09741 PRT-14322 For those that want to take advantage of the Qwiic enabled devices, you'll want to grab a Qwiic cable. SparkFun Qwiic Cable Kit Qwiic Cable - 100mm KIT-15081 PRT-14427...
Page 4
Qwiic Cable - Breadboard Jumper (4-pin) Qwiic Cable - 500mm PRT-14425 PRT-14429 Suggested Reading If you aren't familiar with the Qwiic system, we recommend reading here for an overview if you decide to take advantage of the Qwiic connector. Qwiic Connect System We would also recommend taking a look at the following tutorials if you aren't familiar with them.
Hardware Overview Before we get into installing and using the Qwiic Pro Micro, let's quickly look at the board -- examine its inputs, outputs, and other hardware quirks. Old School to New School The Qwiic Pro Micro USBC is a revision of the original Pro Micro. Overall, it is functionally the same as the previous version.
Page 6
For more information about the differences between the boards, make sure to pull up the schematic for both boards and read further below! The Pinout All of the Qwiic Pro Micro's I/O and power pins are broken out to two, parallel headers. Some pins are for power input or output, other pins are dedicated I/O pins.
Page 7
board is powered externally, through this pin, the applied voltage can be up to 6V. 5V is the voltage supplied to the on-board ATmega32U4. This voltage will depend on whether you have the jumper set to 5V (by default) or 3.3V. When the jumper is set to 5V, it is the voltage applied to the RAW pin.
Page 8
The Pro Micro has five external interrupts, which allow you to instantly trigger a function when a pin goes either high or low (or both). If you attach an interrupt to an interrupt-enabled pin, you'll need to know the specific interrupt that pin triggers: pin 3 maps to interrupt 0 (INT0), pin 2 is interrupt 1 (INT1), pin 0 is interrupt 2 (INT2), pin 1 is interrupt 3 (INT3), and pin 7 is interrupt 4 (INT6).
Page 9
The board measures 1.30" x 0.70". Not included in the image below is the PCB thickness, which is 0.8mm. This is thinner than a majority of the PCBs used for SparkFun original designs. How to Power the Qwiic Pro Micro USB C As the Pro Micro's main feature is its innate USB functionality, the most common way to power it is via USB.
Page 10
How to Power a Project FEBRUARY 7, 2013 A tutorial to help figure out the power requirements of your project. Hardware Hookup Header pins were left off the Qwiic Pro Micro to allow users the flexibility of connecting any type of 0.1" header to the board.
Page 11
Pro Micro Eagle footprint should you decide to make a keyboard using the Cherry MX Switch! GITHUB SPARKFUN EAGLE LIBRARY: SPARKFUN-BOARDS.LBR In order to power and upload to the board, you will simply need a USB C cable connected to your computer. For...
Page 12
To take advantage of the board's HID, we recommend some sort of input. The analog joystick provides a few inputs to test our the keyboard and mouse in example 2. Qwiic Enabled Device You can also easily connect a Qwiic enabled device to the Qwiic connector. Below is an example of a distance sensor connected to the Qwiic Pro Micro.
Page 13
Unzip that zip file, and don't forget where you've left its contents. In that zip file, you should find the .inf and .cat files, which contains all the information Windows needs to install the Pro Micro's driver. The sparkfun.inf driver and sparkfun.cat digitally signed catalog file will be found in ...Arduino_Boards-master/sparkfun/avr/signed_driver .
Page 14
In the Device Manager, expand the 'Other devices' tree, where you should find a 'USB IO Board' with a yellow warning sign over its icon. Right-click the 'USB IO Board' and select Update Driver Software..This should spawn an 'Update Driver Software - USB IO Board' window. Step 4: Finding the Driver In the first window that pops up, click 'Browse my computer for driver software'.
Page 15
After watching the progress bar beam by a few times, you should get a happy 'Windows has successfully updated your driver software' window. And the 'Device Manager' should have a new entry for the 'SparkFun Pro Micro (COM ##)' if you have one of those) under the 'Ports (COM & LPT)' tree.
Page 16
Click OK. Then open the Board Manager by clicking Tools, then hovering over the Board selection tab and clicking Board Manager. Search for 'sparkfun' in the Board Manager. You should see the SparkFun AVR Boards package appear. Click install, wait a few moments, and all the *.brd files you'll need should be installed, indicated by the blue 'Installed'...
Page 17
You should now be able to upload code to a number of SparkFun Arduino-compatible products, including the SparkFun Pro Micro. Notice there are two options for the Pro Micro - 8MHz and 16MHz. It's very important that you select the Pro Micro option that matches your board's voltage and speed.
Page 18
To double-check that the board definitions have been added to Arduino, open up Arduino, and check under the 'Tools > Board' menu. There should be some new entires for 'SparkFun Pro Micro', 'SparkFun FioV3', 'Qduino Mini', and other 32U4-based boards.
Page 19
Notice there are two options for the Pro Micro - 8MHz and 16MHz. It's very important that you select the Pro Micro option that matches your board's voltage and speed. This should be listed under the Tools > Processor. For the Qwiic Pro Micro, you will need to ensure that you select the ATmega32U4 (5V, 16MHz). You should also see your Pro Micro's COM port under the 'Tools >...
Page 20
Click OK. Then open the Board Manager by clicking Tools, then hovering over the Board selection tab and clicking Board Manager. Search for 'sparkfun' in the Board Manager. You should see the SparkFun AVR Boards package appear. Click install, wait a few moments, and all the *.brd files you'll need should be installed, indicated by the blue 'Installed' that is printed next to the package.
Page 21
Upload the RX/TX Blinky, Hello World Sketch Copy and paste the code below into the Arduino IDE. In the Tools, make sure to select Board > SparkFun Pro Micro and Processor > ATmega32U4 (5V, 16MHz). Also, don't forget to select the COM port that your board enumerated to.
Page 22
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().
Page 23
You can also open up the Arduino IDE's serial monitor (set to 9600 bps) and see every programmer's favorite two- word phrase. Understanding the Sketch RX LED The RX LED is tied to Arduino's pin 17. You can control it just as you would any other digital pin. Set it as an , and to turn the LED off or to turn the LED on.
Page 24
Serial.begin(9600); //This pipes to the serial monitor Serial.println("Initialize Serial Monitor"); Serial1.begin(9600); //This is the UART, pipes to sensors attached to board Serial1.println("Initialize Serial Hardware UART Pins"); That " " makes a huge difference. Think of the Qwiic Pro Micro having two separate serial ports. The one without the "...
Page 25
It's one of the many defined USB device classes. Every USB device is assigned a class, which defines what its general purpose is. There are loads of classes -- printers, hubs, speakers, and webcams to mention a few, but in this example we'll be emulating HID -- Human Interface Device.
Page 26
If you have a text editor (Notepad, Word, TextEdit, etc.) open and active, it'll print it out there. Or you can try using the textbox below to test. SparkFun Qwiic Pro Micro USB C Test Area SparkFun Electronics...
Page 27
That covers about half of USB HID library. How about we add a mouse to the mix now? Implementing a USB HID mouse requires a few more functions, but it's still crazy simple. There are five functions provided by Arduino's HID class that can be used to implement a mouse: tells the computer to move the mouse a certain number of pixels along either the Mouse.move(x, y, wheel)
Page 28
Reuse and share. This is very simplistic code that allows you to turn the SparkFun Thumb Joystick (http://www.sparkfun.com/products/9032) into an HID Mouse. The select button on the joystick is set up as the mouse left click.
Page 29
else if ((digitalRead(selPin)) && (mouseClickFlag)) // if the joystick button is not pressed mouseClickFlag = 0; Mouse.release(MOUSE_LEFT); // release the left button This sketch is set up so that an analog joystick connected to analog pins A0 and A1 can be used to move your mouse cursor.
Page 30
Qwiic Joystick Hookup Guide FEBRUARY 21, 2019 Looking for an easy way to implement a joystick to your next Arduino or Raspberry Pi project? This hookup guide will walk you through using the Qwiic Joystick with the Arduino IDE on a RedBoard Qwiic and in Python on a Raspberry Pi.
Page 31
/****************************************************************************** Example_3a_Qwiic_Joystick_HID_Mouse.ino Written by: Ho Yun "Bobby" Chan Date: January 13, 2020 Development Environment Specifics: Arduino IDE 1.8.9 Description: Based on the Jim's Pro Micro "HID Mouse" and Wes' Qwiic Joystick "basic reading" examples, this example moves your computer's mouse based on the joystick's position.
Page 32
Serial.println("Joystick does not appear to be connected. Please check wiring. Freezing..." #endif while (1); delay(1000); // short delay to let outputs settle vertZero = joystick.getVertical(); // get the initial values horzZero = joystick.getHorizontal(); // Joystick should be in neutral position when reading t hese Mouse.begin();...
Page 33
Example 3b: HID Keyboard with Qwiic Keypad For the scope of this tutorial example, we will be using the Qwiic Keypad so that we do not need to solder any pins. Make sure to check out the Qwiic Keypad Hookup Guide before continuing on with the examples below. Qwiic Keypad Hookup Guide APRIL 25, 2019 If you are tired of taking up GPIO pins, wiring a bunch of pull up resistors, and...
Page 34
/****************************************************************************** Example_3b_Qwiic_Keypad_HID_Keyboard.ino Written by: Ho Yun "Bobby" Chan Date: February 6, 2020 Development Environment Specifics: Arduino IDE 1.8.9 Description: Based on the Jim's Pro Micro "HID Mouse" and Pete' Qwiic Keypad "read button" examples, this example outputs keyboard presses associated with the keypad. Libraries: Keyboard.h (included with Arduino IDE) Wire.h (included with Arduino IDE)
Page 35
If you have a text editor (Notepad, Word, TextEdit, etc.) open and active from Example 2, press a button on the Qwiic Keypad. Or you can try using the textbox below to test. The outputs should be associated with each of the Qwiic keypad button press. SparkFun Qwiic Pro Micro USB C Test Area...
Page 36
SparkFun Electronics Start Something! SparkFun Qwiic Pro Micro USB C Testing Area Warning! Any text written in this textbox will be erased when you refresh this webpage! Example 3c: Qwiic HID Mouse and Keyboard Combined This example combines 3a and 3b into one sketch. Copy and paste the code below into the Arduino IDE. Make...
Page 37
/****************************************************************************** Example_3c_Qwiic_HID_Mouse_Keyboard_Combined.ino Written by: Ho Yun "Bobby" Chan Date: February 6, 2020 Development Environment Specifics: Arduino IDE 1.8.9 Description: Based on the following examples: - Jim's Pro Micro "HID Mouse/Keyboard" - Wes' Qwiic Joystick "basic reading" - Pete's Qwiic Keypad "read button" This example controls the mouse with the Qwiic Joystick and keyboard presses associated with the Qwiic Keypad.
Page 38
//for a single line comment ("//"): #define DEBUG 0 //0 = HID only //#define DEBUG 1 //1 = HID with serial output void setup() { #if DEBUG Serial.begin(9600); Serial.println("Qwiic KeyPad Example"); #endif if (joystick.begin() == false) { #if DEBUG Serial.println("Joystick does not appear to be connected. Please check wiring. Freezing..." #endif while (1);...
Page 40
else if (button == '7') { Keyboard.write('7'); else if (button == '8') { Keyboard.write('8'); else if (button == '9') { Keyboard.write('9'); else if (button == '#') { Keyboard.write('#'); else if (button == '*') { Keyboard.write('*'); //Do something else. Don't call your Keypad a ton otherwise you'll tie up the I2C bus //Uncomment this if necessary but since we check the Qwiic Joystick it does not // appear to be an issue //delay(25);...
Page 41
3. Wait a few seconds for the device to be detached. 4. Plug Qwiic Pro Micro back in. 5. Open Arduino back up, check the Serial Ports menu again. Reset to Bootloader We ship the Qwiic Pro Micro with a modified version of the Arduino Leonardo bootloader, with one major enhancement.
Page 42
Why would you need to enter bootloader mode in the first place. Glad you asked... How to Revive a "Bricked" Pro Micro Incorporating all of the USB tasks on a single chip is an awesome feature that makes the Pro Micro and boards like it truly unique.
Page 43
COM port is assigned to it, etc. All native USB devices have a VID/PID. All SparkFun ATmega32U4 boards share the same VID -- 0x1B4F, and they all have unique PIDs. 5V Pro Micros lay claim to PIDs 0x9205 and 0x9206 (one for the bootloader, one for the sketch). 3.3V Pro Micros will show up as 0x9203 and 0x9204 for bootloader and sketch, respectively.
Page 44
Graphical Datasheet (PDF) ATmega32U4 Firmware Notes (PDF) ATmega32U4 Datasheet (PDF) GitHub Repo Arduino Board Add-on Hardware Repo SFE Product Showcase Thanks for reading along with our Qwiic Pro Micro hookup guide! Hopefully now you're fully prepared to begin using the Pro Micro in a project of your own. Here are some tutorials that might be worth checking out as you continue down the rabbit hole: Connecting Arduino to Processing Cherry MX Switch Breakout Hookup Guide...
Page 45
Turning Your Pro Micro Into a Keyboard Enginursday: Pressing Our Buttons FEBRUARY 13, 2012 JUNE 15, 2017 A Qwiic Upgrade for a DIY Keyboard FEBRUARY 11, 2020...
Need help?
Do you have a question about the Qwiic Pro Micro USB-C and is the answer not in the manual?
Questions and answers