Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation Pololu A-Star 32U4 User’s Guide 1. Overview . . . . . . . . . . . . . . . . . . . . . . . 1.1. Supported operating systems . . . . . . . . . 2. Contacting Pololu . . . . . . . . . . . . . . . . . . . 3. A-Star 32U4 Micro . . . . . . . . . . . . . . . . . . 3.1. A-Star 32U4 Micro pinout and components . 3.2. A-Star 32U4 Micro schematic and dimensions 4. A-Star 32U4 Mini . . . . . . . . . . . . . . . . . . 4.1.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation 1. Overview The Pololu A-Star 32U4 family of products. The Pololu A-Star 32U4 microcontroller boards are general-purpose programmable modules based on Atmel’s ATmega32U4 AVR microcontroller, which has 32 KB of flash program memory, 2.5 KB of RAM, and builtin USB functionality. Each A-Star (abbreviated A*) adds onboard components and connectors that support the microcontroller and make it easier to use.
Pololu A-Star 32U4 User’s Guide A-Star 32U4 Micro Microcontroller: © 2001–2014 Pololu Corporation A-Star 32U4 Mini ULV A-Star 32U4 Mini LV ATmega32U4 A-Star 32U4 Mini SV ATmega32U4 1 User I/O lines: 15 26 PWM outputs: 7 7 Analog inputs: 8 12 User LEDs: 2 3 Reset button: Operating voltage: Regulator type: Regulated 2 current : Dimensions: 3 Weight : 1 5.5 V to 15 V 0.5 V to 5.5 V 2.7 V to 11.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation 2. Contacting Pololu We would be delighted to hear from you about any of your projects and about your experience with the Pololu A-Stars. You can contact us [http://www.pololu.com/contact] directly or post on our forum [http://forum.pololu.com/]. Tell us what we did well, what we could improve, what you would like to see in the future, or anything else you would like to say! 2.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation 3. A-Star 32U4 Micro 3.1. A-Star 32U4 Micro pinout and components Pinout The diagram above identifies the I/O and power pins on the A-Star 32U4 Micro; it is also available as a printable PDF [http://www.pololu.com/file/download/a-star-32u4-micro-pinout.pdf?file_id=0J796] (409k pdf). For more information about the ATmega32U4 microcontroller on this board, see Atmel’s ATmega32U4 documentation [http://www.atmel.com/ devices/atmega32u4.aspx].
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation and receive data from the computer, and a preloaded USB bootloader makes it possible to program the board over USB. The USB connection can also provide power to the A-Star. The board also has a 6-pin ISP header that allows it to be programmed with an external programmer, such as our USB AVR programmer [http://www.pololu.com/product/1300]. Pin 1 of the header is indicated with a small white dot and has an octagonal shape.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation 3.2. A-Star 32U4 Micro schematic and dimensions Schematic diagram Pololu A-Star 32U4 Micro schematic diagram. This schematic is also available as a PDF: A-Star 32U4 Micro schematic diagram [http://www.pololu.com/file/download/ pololu-a-star-32u4-micro-schematic-diagram.pdf?file_id=0J742] (253k pdf). 3.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation Dimension diagram A dimension diagram of the A-Star 32U4 Micro is available as a PDF: A-Star 32U4 Micro dimension diagram [http://www.pololu.com/file/download/pololu-a-star-32u4-micro-dimension-diagram.pdf?file_id=0J747] (255k pdf). 3.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation 4. A-Star 32U4 Mini 4.1. A-Star 32U4 Mini pinout and components Pinout This diagram identifies the I/O and power pins on the A-Star 32U4 Mini (ULV, LV, and SV versions); it is also available as a printable PDF [http://www.pololu.com/file/download/a-star-32u4-mini-pinout.pdf?file_id=0J784] (269k pdf). For more information about the ATmega32U4 microcontroller and its peripherals, see Atmel’s ATmega32U4 documentation.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation The red LED is connected to the pin labeled RXL, or PB0, and lights when the pin is driven low. While the board is running the A-Star 32U4 Bootloader or a program compiled in the Arduino environment, it will flash this LED when it is receiving data via the USB connection. Connectors The A-Star 32U4 includes a USB Micro-B connector that can be used to connect to a computer’s USB port via a USB A to Micro-B cable [http://www.pololu.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation some of the available current on the 5 V line is used by the board itself (typically about 30 mA) or used to provide current for the GPIO pins or 3.3 V power output (see below). 3V3 power output: This pin gives access to the output of the internal 3.3 V regulator inside the ATmega32U4. The microcontroller uses this regulated voltage for USB signaling, but up to about 50 mA is available for powering external circuits or devices.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation over-temperature protection typically kicks in after a few seconds. These currents represent the limit of the regulator’s capability and cannot be sustained for long periods; a good estimate for the maximum continuous regulator output current is 60% to 70% of the values shown in the graph. 4.3. A-Star 32U4 Mini LV regulator The A-Star Mini LV can be powered from a 2.7 V to 11.8 V external source.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation 4.4. A-Star 32U4 Mini SV regulator The A-Star Mini SV can be powered from a 5 V to 36 V external source. The input voltage is regulated to 5 V by a 500 mA ISL85415 switching step-down (buck) converter from Intersil. (We also make a standalone regulator [http://www.pololu.com/product/2843] based on this integrated circuit.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation Dimension diagrams Dimension diagrams for the A-Star 32U4 Minis are available as PDFs: • A-Star 32U4 Mini ULV (274k pdf) dimension diagram [http://www.pololu.com/file/download/ac02a- dimensions.pdf?file_id=0J781] • A-Star 32U4 Mini LV dimension diagram [http://www.pololu.com/file/download/ac02b-dimensions.pdf?file_id=0J782] (292k pdf) • A-Star 32U4 Mini SV dimension diagram [http://www.pololu.com/file/download/ac02c-dimensions.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation 5. Getting started 5.1. Installing Windows drivers If you use Windows XP, you will need to have either Service Pack 3 [http://www.microsoft.com/downloads/ details.aspx?FamilyId=68C48DAD-BC34-40BE-8D85-6BB4F56F5110] or Hotfix KB918365 installed before installing the A-Star drivers. Some users who installed the hotfix have reported problems which were solved by upgrading to Service Pack 3, so we recommend Service Pack 3 over the hotfix.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation you connect an A-Star to your computer, Windows will take several seconds to recognize the device and configure itself properly. The first time you program the A-Star, Windows will again take several seconds to recognize the AStar’s USB bootloader, and this could cause the programming operation to fail the first time.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation 4. In the Tools > Board menu, select the “Pololu A-Star 32U4” entry. If you do not see the A-Star listed in the Board menu, then the add-on is probably not installed correctly. Try doing step 2 again and restarting the Arduino IDE. Selecting the Pololu A-Star 32U4 in the Boards menu. 5. In the Tools > Port menu, select the port for the A-Star.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation Selecting the Blink example in the Arduino IDE. 7. Press the “Upload” button to compile the sketch and upload it to the A-Star. If everything goes correctly, you will see the message “Done uploading” appear near the bottom of the window. If you are using Windows and you have not previously programmed an A-Star on this USB port, then Windows might take several seconds to recognize the A-Star bootloader.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation Uploading a sketch to the A-Star using the Arduino IDE. 8. If you uploaded the Blink sketch, then the A-Star’s yellow LED should be blinking once every two seconds. However, we ship the A-Stars with that same example already programmed onto it, so you might not be convinced that anything has changed. Try changing the delay values in the sketch to something else and uploading again to see if you can change the speed of the LED.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation 5.3. Programming using avr-gcc and AVRDUDE This section explains how to program the A-Star boards using the avr-gcc toolchain and AVRDUDE. This section is intended for advanced users who do not want to use the Arduino IDE as described in Section 5.2. Getting the prerequisites If you are using Windows, we recommend downloading WinAVR [http://winavr.sourceforge.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation all: $(TARGET).hex clean: rm -f *.o *.hex *.obj *.hex %.hex: %.obj avr-objcopy -R .eeprom -O ihex $< $@ %.obj: $(OBJECT_FILES) $(CC) $(CFLAGS) $(OBJECT_FILES) $(LDFLAGS) -o $@ program: $(TARGET).hex avrdude -p $(MCU) -c avr109 -P $(PORT) -U flash:w:$(TARGET).hex Make sure that the PORT variable in the Makefile is set to the name of the A-Star’s virtual serial port. In Windows, \\\\.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation 6. The A-Star 32U4 USB interface The A-Star 32U4 boards are based on a single AVR ATmega32U4 microcontroller that runs the user program and also handles the USB connection to the computer. The AVR has a full-speed USB transceiver built into it and can be programmed to present almost any type of USB device interface to the computer. USB is an asymmetric system that consists of a single “host” connected to multiple “devices”.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation The Windows 8 Device Manager in “Devices by connection” mode, showing that the A-Star is a composite device. On a Linux computer, you can see details about the A-Star’s USB interface by running lsusb Terminal. The virtual serial port can be found by running ls /dev/ttyACM* in a Terminal. On a Mac OS X computer, the virtual serial port can be found by running ls -v -d 1ffb: /dev/tty.usbmodem* in a in a Terminal.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation 7. The A-Star 32U4 Bootloader The A-Star 32U4 boards come with a USB bootloader that can be used in conjunction with the Arduino IDE or AVRDUDE to load new programs onto an A-Star. This section documents some technical details of the bootloader for advanced users who want to better understand how it works. If you just want to get started using your A-Star, it is fine to skip this section.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation The startup logic for the A-Star 32U4 bootloader. Brown-out detection Unlike many other ATmega32U4 boards, the A-Stars have brown-out detection enabled. The brown-out threshold is 4.3 V, and if the voltage on VCC goes below this then the AVR will reset. The bootloader was designed so that the user program can detect brown-out resets. To do so, check to see if the BORF bit in the MCUSR register is set, and then clear it later.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation pinMode(13, OUTPUT); if (MCUSR & (1 << BORF)) { // A brownout reset occurred. Blink the LED // quickly for 2 seconds. for(uint8_t i = 0; i < 10; i++) { digitalWrite(13, HIGH); delay(100); digitalWrite(13, LOW); delay(100); } } MCUSR = 0; 7.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation 8. Reviving an unresponsive A-Star In order to load a new program onto your A-Star, you will need to get it into bootloader mode and send programming commands to it over its virtual serial port using appropriate software.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation 5. After 8 seconds, the bootloader will exit and attempt to run the sketch again. Wait for the bootloader to exit. Verify that either the “Port” menu is grayed out or no ports in it are selected. 6. Click the Upload button. The Arduino IDE will compile your sketch and start uploading it. 7. As soon as the large status bar near the bottom of the IDE says “Uploading…”, press reset the board twice to get into bootloader mode.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation 8.2. Reviving using AVRDUDE This section explains a special method for reviving an A-Star using the command-line utility AVRDUDE [http://www.nongnu.org/avrdude/] in case your usual method of programming is not working. AVRDUDE stands for “AVR Downloader/UploaDEr”, and it is compatible with the A-Star bootloader. If you have an A-Star 32U4 Micro, you should connect a momentary pushbutton [http://www.pololu.
Pololu A-Star 32U4 User’s Guide © 2001–2014 Pololu Corporation 9. Related Resources To learn more about using the Pololu A-Star boards, see the following list of resources: • The Arduino IDE has many examples [http://arduino.cc/en/Tutorial/HomePage] that can run on the A-Stars. • The Arduino website has a Language Reference [http://arduino.cc/en/Reference/HomePage], a wiki called the The Arduino Playground [http://playground.arduino.cc/], and other resources.