3.10. Pin assignments

<p>The table below lists the most important pin assignments for the ATmega32U4 on the Zumo 32U4. This table is helpful if you want to add your own electronics to the Zumo 32U4, write your own low-level code for interfacing with the hardware, or just want to understand better how the Zumo 32U4 works. Each row represents a physical pin on the ATmega32U4.</p> <p>The &#8220;ATmega32U4 pin name&#8221; column shows the official name of the pin according to the <a href="https://www.microchip.com/en-us/product/ATmega32u4">ATmega32U4 datasheet</a>.</p> <p>The &#8220;Arduino pin names&#8221; 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 <code>analogRead</code> actually reads pin A4, not pin 4. Also, due to hardware limitations, some functions only work on a limited set of pins.</p> <p>The &#8220;Zumo 32U4 functions&#8221; column documents what the pin is used for on the Zumo 32U4. Many pins can serve multiple purposes concurrently by switching modes. For example, PB0 can read the state of button C when it is an input, and it can control the red LED and serve as a display data line when it is an output.</p> <p>The &#8220;Note/alternate functions&#8221; column documents other features of the pin, although some of those features might be impractical to use.</p> <table class="pin_assignment" style="border-collapse: collapse;"> <thead> <tr> <th>ATmega32U4<br>pin name <th>Arduino<br>pin names <th>Zumo 32U4 functions <th>Notes/alternate functions <tbody style="border-top: 7px solid white;"> <tr> <td>PB7 <td>11 <td>Line sensor IR LED control <td> Timer0 PWM output A (OC0A)<br> Timer1 PWM output C (OC1C)<br> UART flow control (<span style="text-decoration:overline;">RTS</span>)<br> Pin-change interrupt (PCINT7) <tr> <td>PF7 <td>A0, 18 <td>Line sensor 1 (leftmost) <td>Analog input (ADC7)<br> JTAG test data in (TDI) <tr> <td>PF5 <td>A2, 20 <td>Line sensor 2<br> Left proximity sensor<br> (function selected by jumper) <td> Analog input (ADC5)<br> JTAG test mode select (TMS) <tr> <td>PF4 <td>A3, 21</td> <td>Line sensor 3 (center)<br> <td>Analog input (ADC4)<br> JTAG test clock (TCK) <tr> <td>PD4 <td>4, A6, 24 <td>Line sensor 4<br> Right proximity sensor output<br> (function selected by jumper) <td> Analog input (ADC8)<br> Timer1 input capture pin (ICP1) <tr> <td>PD6 <td>12, A11, 29 <td>Line sensor 5 (rightmost) <td>Analog input (ADC9)<br> Timer4 PWM output D (<span style="text-decoration:overline;">OC4D</span>)<br> Timer1 counter source (T1) <tr> <td>PF1 <td>A4, 22 <td>Front proximity sensor <td>Analog input (ADC1) <tbody style="border-top: 7px solid white;"> <tr> <td>PC6 <td>5 <td>Proximity LED PWM <td>Timer3 PWM output A (OC3A)<br> Timer4 PWM output A (<span style="text-decoration:overline;">OC4A</span>) <tr> <td>PF6 <td>A1, 19 <td>Proximity LED selection<br> Battery level input (VBAT/2) <td>Analog input (ADC6)<br> JTAG test data out (TDO) <tbody style="border-top: 7px solid white;"> <tr> <td>PD2 <td>0 <td><em>OLED version:</em> Display reset (<span style="text-decoration:overline;">RESET</span>)<br> <em>LCD version:</em> LCD control line (RS) <td>UART receive pin (RXD1)<br> External interrupt source (<span style="text-decoration:overline;">INT2</span>) <tr> <td>PD3 <td>1 <td><em>OLED version:</em> Display SPI clock (SCK)<br> <em>LCD version:</em> LCD control line (E) <td>UART transmit pin (TXD1)<br> External interrupt source (<span style="text-decoration:overline;">INT3</span>) <tr> <td>PB3 <td>14, MISO <td>User pushbutton A<br> <em>LCD version:</em> LCD data line DB4 <td>SPI Master Input/Slave Output (MISO)<br> Pin-change interrupt (PCINT3) <tr> <td>PB0 <td>17, SS <td>Red LED (RX)<br> User pushbutton C<br> <em>OLED version:</em> Display data/command select (D/<span style="text-decoration:overline;">C</span>)<br> <em>LCD version:</em> LCD data line DB5 <td>SPI slave select (<span style="text-decoration:overline;">SS</span>)<br> Pin-change interrupt (PCINT0) <tr> <td>PC7 <td>13 <td>Yellow LED<br> <em>LCD version:</em> LCD data line DB6 <td>Timer4 PWM output A (OC4A)<br> Timer3 input capture pin (ICP3)<br> Divided system clock output (CLKO) <tr> <td>PD5 <td>- <td>Green LED (TX)<br> User pushbutton B<br> <em>OLED version:</em> Display data (MOSI)<br> <em>LCD version:</em> LCD data line DB7 <td>UART external clock (XCK1)<br> UART flow control (<span style="text-decoration:overline;">CTS</span>) <tr> <td>PD7 <td>6, A7, 25 <td>Buzzer PWM <td>Analog input (ADC10)<br> Timer4 PWM output D (OC4D)<br> Timer0 counter source (T0) <tbody style="border-top: 7px solid white;"> <tr> <td>PB6 <td>10, A10, 28 <td>Left motor PWM <td>Analog input (ADC13)<br> Timer1 PWM output B (OC1B)<br> Timer4 PWM output B (OC4B)<br> Pin-change interrupt (PCINT6) <tr> <td>PB2 <td>16, MOSI <td>Left motor direction <td>SPI Master Output/Slave Input (MOSI)<br> Pin-change interrupt (PCINT2) <tr> <td>PB5 <td>9, A9, 27 <td>Right motor PWM <td>Analog input (ADC12)<br> Timer1 PWM output A (OC1A)<br> Timer4 PWM output B (<span style="text-decoration:overline;">OC4B</span>)<br> Pin-change interrupt (PCINT5) <tr> <td>PB1 <td>15, SCK <td>Right motor direction <td>SPI Clock (SCK)<br> Pin-change interrupt (PCINT1) <tbody style="border-top: 7px solid white;"> <tr> <td>PB4 <td>8, A8, 26 <td>Left encoder XORed input <td>Analog input (ADC11)<br> Pin-change interrupt (PCINT4) <tr> <td>PE2 <td>- <td>Left encoder input <td>Hardware bootloader select (<span style="text-decoration:overline;">HWB</span>)<br> <tr> <td>PE6 <td>7 <td>Right encoder XORed input <td>Analog comparator negative input (AIN0)<br> External interrupt source (INT6) <tr> <td>PF0 <td>A5, 23 <td>Right encoder input <td>Analog input (ADC0) <tbody style="border-top: 7px solid white;"> <tr> <td>PD0 <td>3, SCL <td>I&sup2;C clock for inertial sensors <td>Timer0 PWM output B (OC0B)<br> External interrupt source (<span style="text-decoration:overline;">INT0</span>) <tr> <td>PD1 <td>2, SDA <td>I&sup2;C data for inertial sensors <td>External interrupt source (<span style="text-decoration:overline;">INT1</span>) <tbody style="border-top: 7px solid white;"> <tr> <td><span style="text-decoration:overline;">RESET</span> <td>- <td>Reset pushbutton <td>internally pulled high, active low <tr> <td>AREF <td>- <td>- <td>Analog reference </table>

Related Products

Zumo 32U4 Robot Kit (No Motors)
Zumo 32U4 OLED Robot (Assembled with 75:1 HP Motors)
Zumo 32U4 OLED Robot (Assembled with 50:1 HP Motors)
Zumo 32U4 OLED Robot Kit (No Motors)
Zumo 32U4 OLED Main Board
Zumo 32U4 Main Board v1.1
Zumo Windowed Blade (for 32U4/2040)
Zumo 32U4 Front Sensor Array
Zumo 32U4 Main Board v1.0
Zumo 32U4 Robot (Assembled with 100:1 HP Motors)
Zumo 32U4 Robot (Assembled with 75:1 HP Motors)
Zumo 32U4 Robot (Assembled with 50:1 HP Motors)
Zumo 32U4 OLED Robot (Assembled with 100:1 HP Motors)
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Menu
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors