background image

ATmega32U4

pin name

Arduino

pin names

Zumo 32U4 functions

Notes/alternate functions

PB6

10, A10, 28 Left motor PWM

Analog input (ADC13)
Timer1 PWM output B (OC1B)
Timer4 PWM output B (OC4B)
Pin-change interrupt (PCINT6)

PB2

16, MOSI

Left motor direction

SPI Master Output/Slave Input (MOSI)
Pin-change interrupt (PCINT2)

PB5

9, A9, 27

Right motor PWM

Analog input (ADC12)
Timer1 PWM output A (OC1A)
Timer4 PWM output B (OC4B)
Pin-change interrupt (PCINT5)

PB1

15, SCK

Right motor direction

SPI Clock (SCK)
Pin-change interrupt (PCINT1)

PB4

8, A8, 26

Left encoder XORed input

Analog input (ADC11)
Pin-change interrupt (PCINT4)

PE2

-

Left encoder input

Hardware bootloader select (HWB)

PE6

7

Right encoder XORed input

Analog comparator negative input (AIN0)
External interrupt source (INT6)

PF0

A5, 23

Right encoder input

Analog input (ADC0)

PD0

3, SCL

I²C clock for inertial sensors

Timer0 PWM output B (OC0B)
External interrupt source (INT0)

PD1

2, SDA

I²C data for inertial sensors

External interrupt source (INT1)

RESET

-

Reset pushbutton

internally pulled high, active low

AREF

-

-

Analog reference

3.11. Adding electronics

This section gives tips for how the Zumo 32U4 can be expanded with additional electronics.

Freeing up I/O pins

If you want your additional electronics to send or receive information from the AVR, you will need to connect it
to one or more of the AVR’s I/O pins. Each I/O pin is already being used for some other purpose, as documented
in

Section 3.10

, so you might need to disable or disconnect one of the other features of the Zumo 32U4.

If are not using the proximity sensors and you do not care about turning off the infrared emitters for the line
sensors, you can cut the surface-mount jumper on the front sensor array labeled “LED”. This frees pin 11 (PB7)
for other uses. Pin 11 can be used for digital I/O and analog input. We do not recommend making this change if
you are using the proximity sensors, because then the line sensor infrared emitters would always be on, which
would interfere with the proximity sensors.

Pololu Zumo 32U4 Robot User’s Guide

© 2001–2015 Pololu Corporation

3. The Zumo 32U4 in detail

Page 28 of 76

Summary of Contents for Zumo 32U4

Page 1: ... pages https www pololu com docs 0J63 View this document as a printable PDF zumo_32u4_robot pdf https www pololu com docs pdf 0J63 zumo_32u4_robot pdf Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation https www pololu com docs 0J63 all Page 1 of 76 ...

Page 2: ... 3 10 Pin assignments 25 3 11 Adding electronics 28 3 12 AVR Timers 30 3 13 Schematics and dimensions 30 4 Assembling the Zumo 32U4 kit 32 5 Programming the Zumo 32U4 60 5 1 Installing Windows drivers 60 5 2 Programming using the Arduino IDE 62 5 3 Programming using avr gcc and AVRDUDE 65 6 Zumo 32U4 Arduino library 67 7 The Zumo 32U4 USB interface 68 8 The A Star 32U4 Bootloader 70 9 Reviving an ...

Page 3: ...nd gyro on the main board along with reflectance and proximity sensors on the front sensor array On board pushbuttons offer a convenient interface for user input and an LCD buzzer and indicator LEDs allow the robot to provide feedback Like our A Star 32U4 programmable controllers https www pololu com category 149 a star programmable controllers the Zumo 32U4 features a USB interface and ships prel...

Page 4: ...g robot to be even more compact However it remains just as easy to program as a standard Arduino thanks to its USB interface and preloaded Arduino compatible bootloader The Zumo 32U4 also adds many features that are not found on the Zumo Shield including encoders an LCD and proximity detection Some of the pin mappings and software libraries differ between the Zumo 32U4 and Zumo robot for Arduino s...

Page 5: ...rs to the main board two magnetic encoder discs https www pololu com product 2599 12 CPR Zumo 32U4 front sensor array and associated hardware 2 12 female header and 2 12 extended male header for sensor array two 1 3 right angle male headers and two shorting blocks jumpers for sensor array Zumo chassis kit https www pololu com product 1418 which includes Zumo chassis main body two drive sprockets t...

Page 6: ...Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 1 Overview Page 6 of 76 ...

Page 7: ...Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 1 Overview Page 7 of 76 ...

Page 8: ...built from the same components found in the Zumo 32U4 Robot Kit no soldering or assembly is required A choice of three motor gear ratios offer different combinations of torque and speed Different versions of the assembled Zumo 32U4 robots can be identified with a sticker on the underside of the main board visible inside the battery compartment of the Zumo without batteries installed The color of t...

Page 9: ...istics and most of our example code was developed and tested with these motors 50 1 HP https www pololu com product 2213 and 100 1 HP https www pololu com product 2215 motors also generally work well These three motor types are the ones we offer in assembled Zumo 32U4 robots The following table summarizes the key specifications of the recommended 50 1 HP 75 1 HP and 100 1 HP motors The first four ...

Page 10: ... proximity sensors but additional sensors can be incorporated for increased range or detection area Connectors and jumper wires https www pololu com category 19 connectors for connecting additional sensors and components Battery charger if you are using rechargeable batteries since the Zumo just uses ordinary AA batteries we recommend basic AA chargers into which you stick the individual cells ava...

Page 11: ...would like to share you can contact us https www pololu com contact directly or post on our forum http forum pololu com viewforum php f 29 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 Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 2 Contacting Pololu Page 11 of 76 ...

Page 12: ...he A Star 32U4 which allows it to be easily programmed using the Arduino IDE For more information about programming the Zumo 32U4 see Section 5 The ATmega32U4 might also come preloaded with a simple program that blinks the yellow LED and writes Zumo 32U4 to the LCD 3 2 User interface LEDs The Zumo 32U4 has eight indicator LEDs A yellow user LED is connected to Arduino digital pin 13 or PC7 You can...

Page 13: ...and C are on Arduino pin 14 PB3 PD5 and Arduino pin 17 PB0 respectively Pressing one of these buttons pulls the associated I O pin to ground through a resistor The three buttons I O lines are also used for other purposes pin 14 is MISO on the SPI interface PD5 and pin 17 control the green and red user LEDs and all three pins are LCD data lines Although these uses require the pins to be driven by t...

Page 14: ...al pin 16 or PB2 controls the left motor direction Digital pin 9 or PB5 controls the right motor speed with PWM pulse width modulation generated by the ATmega32U4 s Timer1 Digital pin 10 or PB6 controls the left motor speed with PWM For more information about the drivers see the DRV8838 datasheet https www pololu com file download drv8838 pdf file_id 0J806 1MB pdf We also sell a carrier board http...

Page 15: ...ied as 75 81 1 are used the encoders provide 75 81 12 909 7 CPR Quadrature encoder transitions are often detected by monitoring both encoder channels directly However since transitions on the Zumo s encoders can occur at high frequencies several thousand per second when its motors are running it is necessary to use the AVR s pin change interrupts or external interrupts to read the encoders To redu...

Page 16: ...direction that is A rises before B rises and A falls before B falls The waveforms in the diagram above would be produced by forward rotation The Zumo 32U4 library https www pololu com docs 0J63 6 provides appropriate interrupt service routines and functions for reading the encoders and keeping track of their counts Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 3 The Zumo 32U4 in...

Page 17: ... objects They can also be used to detect commands from typical IR remote controls The proximity sensors like the line sensors detect reflected IR light but they are designed to only detect light that is turned on and off quickly at a frequency of 38 kHz To read a proximity sensor the AVR can enable the internal pull up on the corresponding I O line When the sensor is active it will drive the line ...

Page 18: ...responding jumper Example remapping using all the sensors If you want to use all five line sensors and all three proximity sensors in one application you can accomplish that by freeing up two I O lines and remapping two of the pins One way to accomplish this is by removing the Zumo s LCD to free up pins 0 and 1 Next configure the jumpers on the front sensor array to connect pin 4 to line sensor 4 ...

Page 19: ...ng reflected to the sensor which is influenced by the size reflectivity proximity and location of nearby objects However the presence of other sources of 38 kHz IR pulses e g from another robot can also affect the readings You can also just read the proximity sensors without turning on any LEDs This could allow the Zumo to detect the IR proximity sensors of other robots or to detect commands from ...

Page 20: ...e forward emitters with the LED holder IR LEDs with LED holder Shielding with heat shrink tubing You can make shrouds out of black heat shrink tubing to shield the forward emitters as an alternative to using the LED holder Without the LED holder the LEDs are less securely mounted but you can more easily adjust their positioning IR LEDs with heat shrink shielding You can test to see if your shieldi...

Page 21: ...st turns the motors in order to scan for nearby objects This could be a good starting point for a sumo robot that uses the front sensors to locate its opponent 3 7 Inertial sensors The Zumo 32U4 includes on board inertial sensors that can be used in advanced applications such as helping your Zumo detect collisions and determine its own orientation by implementing an inertial measurement unit IMU T...

Page 22: ...rtment for four AA batteries We recommend using rechargeable AA NiMH cells https www pololu com product 1003 which results in a nominal voltage of 4 8 V 1 2 V per cell You can also use alkaline cells which would nominally give you 6 V The negative battery voltage is connected to GND The positive battery voltage is designated VB VB feeds into a circuit that provides reverse protection and power swi...

Page 23: ...113a pdf file_id 0J771 1MB pdf 3 3V regulator The main board also has 3 3 V linear regulator The inertial sensors draw power from the 3 3 V line the remainder up to a few hundred milliamps is available for powering external circuits or devices Alternative power sources For users who want to experiment with alternative power sources like lithium batteries the Zumo 32U4 can accept a battery input vo...

Page 24: ...Zumo 32U4 top expansion pinout Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 3 The Zumo 32U4 in detail Page 24 of 76 ...

Page 25: ...shows the official name of the pin according to the ATmega32U4 datasheet http www atmel com devices atmega32u4 aspx The Arduino pin names column lists the names provided by the Arduino environment for the pin These names can generally be used as arguments to any function that takes a pin number However there are some exceptions For example passing the number 4 to analogRead actually reads pin A4 n...

Page 26: ...e functions column documents other features of the pin although some of those features might be impractical to use Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 3 The Zumo 32U4 in detail Page 26 of 76 ...

Page 27: ...C6 5 Proximity LED PWM Timer3 PWM output A OC3A Timer4 PWM output A OC4A PF6 A1 19 Proximity LED selection Battery level input VBAT 2 Analog input ADC6 JTAG test data out TDO PD2 0 LCD control line RS UART receive pin RXD1 External interrupt source INT2 PD3 1 LCD control line E UART transmit pin TXD1 External interrupt source INT3 PB3 14 MISO User pushbutton A LCD data line DB4 SPI Master Input Sl...

Page 28: ... interrupt source INT1 RESET Reset pushbutton internally pulled high active low AREF Analog reference 3 11 Adding electronics This section gives tips for how the Zumo 32U4 can be expanded with additional electronics Freeing up I O pins If you want your additional electronics to send or receive information from the AVR you will need to connect it to one or more of the AVR s I O pins Each I O pin is...

Page 29: ...annels from an RC receiver or for controlling two RC servos because they are arranged in a convenient way with respect to power and ground on the right side expansion header If you have removed the LCD and do not need to use button A this frees up pin 14 PB3 Pin 14 is is capable of digital input and output Removing the LCD frees up the LCD contrast potentiometer for other purposes The output of th...

Page 30: ...nnections You should refer to Section 3 9 to locate the access points in the Zumo 32U4 expansion areas for the pins you have chosen One option to make the connections to those pins is two get two 2 13 pin female headers https www pololu com product 2745 and solder them in to the left and right expansion areas Another option would be to break off pieces of a 2 40 pin male header https www pololu co...

Page 31: ...ine along with the sizes and locations of all of the holes on the board Zumo 32U4 main board drill guide https www pololu com file download zum02a01 drill dxf file_id 0J948 231k dxf The following pictures show the approximate dimensions of the Zumo chassis https www pololu com product 1418 used by the Zumo 32U4 robot Pololu Zumo chassis assembled top view with dimensions shown with motors Pololu Z...

Page 32: ...urface mount components that are already soldered to the board but there are a few through hole parts that you need to solder yourself 1 Solder the buzzer to the top of the main board matching its orientation to the printed outline then trim the excess length from the buzzer leads underneath the board 2 Solder the two 1 2 machine pin sockets to the top of the board in the front corners 3 Optional ...

Page 33: ...ame time as the idler sprockets If the white drive sprockets were attached now their shape would make the motors chassis and main board difficult to assemble 4 Press the output shafts of the motors into the drive sprockets with the teeth of the sprockets facing the motor The end of the gearbox shaft should end up flush with the outside of the sprocket A good way to do this is to set the wheel on f...

Page 34: ...ff the ends that are covered in adhesive the adhesive could interfere with making a good electrical connection to the motor These wire segments will be used as motor leads Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 34 of 76 ...

Page 35: ... terminal is indicated by a plus sign in the black plastic end of the motor If you are using one of our recommended micro metal gearmotors 50 1 75 1 or 100 1 or any lower gear ratio the motors should be soldered into the main board with the positive terminal closest to the front so you should attach the leads to allow the motors to be oriented this way However if you are using a motor with a 150 1...

Page 36: ...e the disc is sitting on a flat surface pushing until the shaft makes contact with that surface Chassis 8 Place the motors into the channel in the front of the chassis aligning the gearbox with the grooves in the channel The outer plate of the gearbox should be even with the edge of the chassis Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 36 ...

Page 37: ...nd motors with the main board The motor leads should be inserted into the through holes next to the motor drivers Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 37 of 76 ...

Page 38: ... insert a 2 56 machine screw through the main board and chassis and tighten it against a nut under the chassis It is usually easier to place the nut into the recess first and hold it there with a finger or piece of tape while inserting the screw Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 38 of 76 ...

Page 39: ...ccommodated While you can add the blade before screwing the robot together for the first time we suggest waiting until after you have soldered in the 2 12 connector for the front sensor array so that you have more room to work 11 Solder each motor lead to the main board then trim off the excess length of wire Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32...

Page 40: ...front sensor array connector to the bottom of the front expansion area on the main board It should be flush with the chassis Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 40 of 76 ...

Page 41: ...idual contacts should be inserted into the battery compartment so that their solder tabs protrude through the holes in the top of the chassis you might want to temporarily tape or clamp these two individual contacts in place until they have been soldered to the main board as described in the next step or you can use a battery to temporarily hold them in place Pololu Zumo 32U4 Robot User s Guide 20...

Page 42: ...Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 42 of 76 ...

Page 43: ... filled with solder Idler sprockets and tracks 15 Place an M3 nut in each of the two side slots near the rear of the chassis The slots are sized so that nuts will not be able to rotate within them 16 Place an idler sprocket on each shoulder bolt followed by a washer The side of the sprocket with teeth should face the same direction as the threaded end of the bolt so that the teeth end up pointing ...

Page 44: ...can bend the washers Note Be careful if you use threadlocking adhesives like Loctite as these can corrode the chassis You should first test any such adhesives on a concealed part of the chassis to ensure they will not damage it 18 Install the silicone tracks by stretching them around the sprockets on each side of the chassis Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assemb...

Page 45: ...main board to the chassis 21 Place the blade s mounting tabs on top of the main board so that the holes line up with the two front mounting holes and the two screws through the blade main board and chassis Replace the nuts underneath the chassis and tighten the screws Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 45 of 76 ...

Page 46: ...LCD 22 Solder the 2 7 low profile male header to the bottom of the LCD Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 46 of 76 ...

Page 47: ...the LCD into the matching female header on top of the main board the display should cover the buzzer Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 47 of 76 ...

Page 48: ...ide of the board without components 25 Solder the 2 12 extended male header to the top of the sensor array Note these pins also go on the side of the board without components so that the sensors point at the ground when the board is plugged into the Zumo if you solder this header on the wrong side the sensor array will not work Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Ass...

Page 49: ...ect the sensor of your choice See Section 3 5 for details 27 Plug the sensor array into the matching female header on the bottom of the main board Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 49 of 76 ...

Page 50: ...cluded with the Zumo 32U4 The forward IR emitter LEDs can be installed using the plastic LED holder which we recommend using in most cases continue to step 29 Alternatively they can be installed without the LED holder using heat shrink tubing Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 50 of 76 ...

Page 51: ...he LED holder making sure that each LED s anode the longer lead that ends in the smaller post inside the case of the LED is on the bottom 30 Bend the LED leads outward so they rest along the channels in the LED holder then downward around the sides of the holder Using a pair of long nose pliers can help you make more precise bends Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 ...

Page 52: ...31 Trim the LED leads so that they extend slightly below the bottom of the LED holder Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 52 of 76 ...

Page 53: ...holder behind the blade by inserting the LED leads into the machine pin sockets in the front of the main board Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 53 of 76 ...

Page 54: ... blade Note that the screw heads will not be completely flush against the blade when properly tightened to avoid damaging the LED holder do not overtighten the screws Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 54 of 76 ...

Page 55: ...s to approximately match the shapes pictured making sure that each LED s anode the longer lead that ends in the smaller post inside the case of the LED is toward the rear 35 Trim the excess length from the leads and insert the LEDs into the machine pin sockets in the front of the main board Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 55 of 7...

Page 56: ... Flatten the tube and make a diagonal cut through it to produce two equal pieces Each piece should measure about 1 2 13 mm along the longer side 38 Slip one of these pieces of heat shrink tubing square end first over each forward emitter LED so that it extends past the case of the LED The diagonal opening of each tube should face forward and upward so that the longer side of the shroud blocks infr...

Page 57: ...es in the battery compartment We recommend using rechargeable AA NiMH cells https www pololu com product 1003 40 Replace the battery compartment cover Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 57 of 76 ...

Page 58: ...Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 58 of 76 ...

Page 59: ...he assembly of your Zumo 32U4 robot is now complete and it is ready to be programmed and run Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 4 Assembling the Zumo 32U4 kit Page 59 of 76 ...

Page 60: ...talling the A Star drivers Some users who installed the hotfix have reported problems that were solved by upgrading to Service Pack 3 so we recommend Service Pack 3 over the hotfix Before you connect your Pololu A Star 32U4 or A Star compatible Zumo 32U4 to a computer running Microsoft Windows you must install its drivers 1 Download the A Star Software and Drivers https www pololu com file downloa...

Page 61: ...t been connected to before Windows XP users After installing the drivers you will need to follow steps 5 9 for each new A Star device you connect to your computer You will also need to follow these steps the first time you attempt to program the device in order to make Windows recognize the bootloader and when you connect the device to a different USB port that it has not been connected to before ...

Page 62: ...star Copy the pololu folder from the downloaded add on folder into the sketchbook location hardware folder You can see the sketchbook location in the Arduino IDE Preferences dialog which is available from the File menu For a typical user the sketchbook location will be a folder named Arduino inside the Documents folder For a typical user running a recent version of Windows the pololu folder should...

Page 63: ...ample a new Arduino IDE window will open up It is OK to close the first window Selecting the Blink example in the Arduino IDE 7 Press the Upload button to compile the sketch and upload it to the device 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 device on this USB...

Page 64: ...lay values in the sketch to something else and uploading again to see if you can change the speed of the LED The A Star 32U4 boards are similar enough to the Arduino Leonardo that you do not actually have to install the add on If you want to you can just select the Arduino Leonardo board in the Arduino IDE Note that if you upload a sketch to the device this way your computer will then recognize it...

Page 65: ...using the Pololu version of GNU Make https github com pololu make releases If you are using Mac OS X we recommend downloading the CrossPack for AVR Development http www obdev at products crosspack If you are using Linux you will need to install avr gcc avr libc and AVRDUDE Ubuntu users can get the required software by running sudo apt get install gcc avr avr libc avrdude After you have installed t...

Page 66: ...of the COM port e g COM13 In a command prompt navigate to the directory with the Makefile and main c If you run the command make the code should get compiled and produce a file named main hex Programming To program the A Star device you will need to get it into bootloader mode first One way to do this is to reset the AVR twice within 750 ms Most A Stars and the Zumo 32U4 have a reset button that c...

Page 67: ...chbook location is typically in your Documents folder in a subfolder named Arduino You can see the sketchbook location in the Arduino IDE Preferences dialog which is available from the File menu For example if you are using Windows and you have not changed the sketchbook location the Zumo32U4 folder would be copied to C Users username Documents Arduino libraries Zumo32U4 If the Arduino or librarie...

Page 68: ...tion of the device On a Windows computer you can see the virtual serial port by going to your computer s Device Manager and expanding the Ports COM LPT list You should see a COM port labeled Pololu A Star 32U4 In parentheses after the name you will see the name of the port e g COM3 or COM4 Windows will assign a different COM port number to the device depending on what USB port you plug it into and...

Page 69: ...tual serial port using any terminal program that supports serial ports Some examples are the Serial Monitor in Arduino IDE the Pololu Serial Transmitter Utility https www pololu com docs 0J23 Br y Terminal http sites google com site terminalbpp PuTTY http www chiark greenend org uk sgtatham putty TeraTerm http ttssh2 sourceforge jp Kermit http www columbia edu kermit ck80 html and GNU Screen http ...

Page 70: ...rial port that accepts the programming commands defined in AVR109 http www atmel com images doc1644 pdf The bootloader always runs first immediately after the AVR is reset Startup logic The main difference between the A Star 32U4 Bootloader and Caterina is in the startup logic This is the part of the bootloader that runs immediately after the AVR is reset and it decides whether to run the user pro...

Page 71: ...n 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 Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 8 The A Star 32U4 Bootloader Page 71 of 76 ...

Page 72: ...cting brown out resets 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 Pololu Zumo 32U4 Robot User s Guide 2001 2015 Pololu Corporation 8 The A Star 32U4 Bootloader Page 72 of 76 ...

Page 73: ...you can use Alternatively you can use a wire to temporarily connect GND and RST together instead of using a reset button Resetting the board twice within 750 ms makes the board go into bootloader mode The bootloader will exit after 8 seconds and try to run the sketch again if it has not started receiving programming commands To revive the device you need to make sure you start sending it programmi...

Page 74: ...is part of the A Star add on 4 In the boards txt file that you opened find the lines at the bottom of the file that start with a star32U4bp Uncomment each of those lines by deleting the character and then save the file 5 Close the Arduino IDE and restart it 6 In the Tools menu open the Board sub menu and select Pololu A Star 32U4 bootloader port This entry is configured so that the Arduino IDE wil...

Page 75: ...l serial ports If you are using Windows this means you should open the Device Manager If you are on Linux or Mac OS X this means you should open a Terminal and type the command ls dev tty but do not press enter until the board is in bootloader mode in the next step 3 Press the reset button twice within 750 ms to make the AVR go into bootloader mode You should see the yellow LED fading in and out w...

Page 76: ...cubicle com LUFA php WinAVR http winavr sourceforge net Atmel Studio 6 http www atmel com microsite atmel_studio6 AVRDUDE http www nongnu org avrdude AVR Freaks http www avrfreaks net Datasheets for some of the components found on the Zumo 32U4 are available below ATmega32U4 documentation http www atmel com devices atmega32u4 aspx Texas Instruments DRV8838 motor driver datasheet https www pololu c...

Reviews: