Blue Pill USB HID game controller connection guide
Blue Pill USB HID game controller STM32F103C8T6 Blue Pill wiring guide with power, signal assignments, and bench checks.
STM32F103C8T6 Blue Pill
49 contacts Current packagePower the board from USB
RequiredUse a single USB cable to power the board through its native connector. Leave external power headers disconnected. Check the 3.3 V rail before attaching the debug probe.
- USB power input
- USB host VBUS
- VBUS (H4-1)
- USB return
- USB host ground
- GND (H4-5)
- Board logic rail
- 3V3 (H3-1)
- 3.3 V measurement point
Bench checks
- Identify the USB power input and ground in the board schematic.
- Measure roughly 3.3 V between the board logic rail and ground. Check for a short or wrong connector if the rail is low.
STM32F103C8T6 Blue Pill connector map
Connection scenarios
Connect and test one button
Configure PA0 as an input. Fit a 10 kΩ pull-up to 3.3 V and a normally-open switch from PA0 to ground. Connect the native USB port to a host and report the active-low button state through the joystick interface.
- Logic supply
- 3V3 (H3-1)
- R1.1
- Button sense
- A0 (H1-5)
- R1.2
- Switch terminal 1
- Return
- G (H2-2)
- Switch terminal 2
Bench checks
- Confirm that the host enumerates a joystick. If it does not, verify USB clock, cable and D+ pull-up first.
- Check that the host shows button press and release once for each switch cycle. Add debounce in firmware if needed.
USBComposite_stm32f1 joystick example and Blue Pill board schematic.
STM32F103C8T6 Blue Pill wiring map
H2-13 · A11
Routes to MCU PA11. Choose the applicable GPIO or peripheral function in the MCU documentation.
Models and documents
The companion shows a one-button bench circuit with the joystick class. The button GPIO and resistor are choices for this example.
- STM32F103C8T6 Blue Pill
- The documented blue PCB has two 20-contact headers, SWD and Micro USB. Its PC13 user LED is active low. The USB D+ pull-up varies across production boards.
- Original Spark Logic project discussion· Author’s hardware, firmware and bench notes.
- STMicroelectronics RM0008 reference manual· Timer modes, DMA request mapping and USB registers.
- USBComposite_stm32f1 source· HID joystick class, descriptors and examples.
- STM32-base · STM32F103C8T6 Blue Pill· Board identification, connector numbering and documented net destinations.
- STMicroelectronics MCU datasheet· MCU electrical specifications and package pin functions.
- STM32F103C8T6 Blue Pill schematic· PCB power, debug, connector and peripheral wiring.
