Pinout
Every peripheral sits on a hardware block, so the CPU does no bit-banging: PWM for the motors, QEI for the encoders, the ADC for the battery, I2C for the IMU and display. Pin functions are from the TM4C123GH6PM datasheet.
The headers
The robot's pins
| Function | Pin | Peripheral | Step | Note |
|---|---|---|---|---|
| Status LEDs | PF1, PF2, PF3 | GPIO | 1 | On the board |
| Start and mode buttons | PF4 (SW1), PF0 (SW2) | GPIO | 1 | PF0 is locked |
| USB log | PA0 / PA1 | UART0 | 2 | Through the debug USB port |
| Left motor PWMA | PB6 | M0PWM0 | 4 | Remove R9: it shorts PB6 to PD0 |
| Right motor PWMB | PB7 | M0PWM1 | 4 | Remove R10: it shorts PB7 to PD1 |
| Left AIN1 / AIN2 | PA6 / PA7 | GPIO | 4 | Direction |
| Right BIN1 / BIN2 | PC4 / PC7 | GPIO | 4 | Direction |
| TB6612 STBY | PD2 | GPIO | 4 | Low turns both motors off |
| Left encoder A / B | PD6 / PD7 | QEI0 PhA0 / PhB0 | 5 | PD7 is locked |
| Right encoder A / B | PC5 / PC6 | QEI1 PhA1 / PhB1 | 5 | |
| Battery divider | PD3 | AIN4 | 3 | |
| IMU and display SCL / SDA | PB2 / PB3 | I2C0 | 6 | One bus, two addresses. Pull-ups on the modules |
| Bluetooth RX / TX | PB0 / PB1 | UART1 | 12 |
Remove R9 and R10 before Step 4
The LaunchPad ties PB6 to PD0 and PB7 to PD1 through 0 Ω resistors R9 and R10. With them in place, whatever PD0 and PD1 do fights the motor PWM.