Support » Pololu A-Star 32U4 Robot Controller User’s Guide » 3. A-Star 32U4 Robot Controller with Raspberry Pi Bridge »
3.10. Pin assignments
The table below lists the most important pin assignments for the ATmega32U4 on the A-Star 32U4 Robot Controller with Raspberry Pi Bridge. This table is helpful if you want to add your own electronics to the robot controller, write your own low-level code for interfacing with the hardware, or just want to understand better how the A-Star works. Each row represents a physical pin on the ATmega32U4.
The “ATmega32U4 pin name” column shows the official name of the pin according to the ATmega32U4 datasheet.
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, not pin 4. Also, due to hardware limitations, some functions only work on a limited set of pins.
The “A-Star 32U4 Robot Controller functions” column documents what the pin is used for on the A-Star 32U4 Robot Controller. 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 when it is an output.
The “Notes/alternate functions” column documents other features of the pin, although some of those features might be impractical to use.
ATmega32U4 pin name | Arduino pin names | A-Star 32U4 Robot Controller functions | Notes/alternate functions |
---|---|---|---|
PB3 | 14, MISO | User pushbutton A | SPI Master Input/Slave Output (MISO) Pin-change interrupt (PCINT3) ISP programming line (PDO) |
PB0 | 17, SS | Red LED (RX) User pushbutton C | SPI slave select (SS) Pin-change interrupt (PCINT0) |
PC7 | 13 | Yellow LED | Timer4 PWM output A (OC4A) Timer3 input capture pin (ICP3) Divided system clock output (CLKO) |
PD5 | - | Green LED (TX) User pushbutton B | UART external clock (XCK1) UART flow control (CTS) |
PD6 | 12, A11, 29 | Motor 1 direction | Analog input (ADC9) Timer4 PWM output D (OC4D) Timer1 counter source (T1) |
PB5 | 9, A9, 27 | Motor 1 PWM | Analog input (ADC12) Timer1 PWM output A (OC1A) Timer4 PWM output B (OC4B) Pin-change interrupt (PCINT5) |
PE2 | - | Motor 2 direction | Hardware bootloader select (HWB) |
PB6 | 10, A10, 28 | Motor 2 PWM | Analog input (ADC13) Timer1 PWM output B (OC1B) Timer4 PWM output B (OC4B) Pin-change interrupt (PCINT6) |
PD0 | 3, SCL | I²C clock for Raspberry Pi communication | Timer0 PWM output B (OC0B) External interrupt source (INT0) |
PD1 | 2, SDA | I²C data for Raspberry Pi communication | External interrupt source (INT1) |
PD7 | 6, A7, 25 | Free I/O Jumper to buzzer PWM | Analog input (ADC10) Timer4 PWM output D (OC4D) Timer0 counter source (T0) |
PF6 | A1, 19 | Free I/O Jumper to battery level input (VIN/3) | Analog input (ADC6) JTAG test data out (TDO) |
PD2 | 0 | Free I/O | UART receive pin (RXD1) External interrupt source (INT2) |
PD3 | 1 | Free I/O | UART transmit pin (TXD1) External interrupt source (INT3) |
PD4 | 4, A6, 24 | Free I/O | Analog input (ADC8) Timer1 input capture pin (ICP1) |
PC6 | 5 | Free I/O | Timer3 PWM output A (OC3A) Timer4 PWM output A (OC4A) |
PE6 | 7 | Free I/O | Analog comparator negative input (AIN0) External interrupt source (INT6) |
PB4 | 8, A8, 26 | Free I/O | Analog input (ADC11) Pin-change interrupt (PCINT4) |
PB7 | 11 | Free I/O |
Timer0 PWM output A (OC0A) Timer1 PWM output C (OC1C) UART flow control (RTS) Pin-change interrupt (PCINT7) |
PB1 | 15, SCK | Free I/O | SPI Clock (SCK) Pin-change interrupt (PCINT1) ISP programming line (SCK) |
PB2 | 16, MOSI | Free I/O | SPI Master Output/Slave Input (MOSI) Pin-change interrupt (PCINT2) ISP programming line (PDI) |
PF7 | A0, 18 | Free I/O | Analog input (ADC7) JTAG test data in (TDI) |
PF5 | A2, 20 | Free I/O |
Analog input (ADC5) JTAG test mode select (TMS) |
PF4 | A3, 21 | Free I/O | Analog input (ADC4) JTAG test clock (TCK) |
PF1 | A4, 22 | Free I/O | Analog input (ADC1) |
PF0 | A5, 23 | Free I/O | Analog input (ADC0) |
RESET | - | Reset pushbutton | internally pulled high, active low |
AREF | - | - | Analog reference |