The PY32F003 is available in a compact TSSOP20 package — 20 pins that cover everything needed for a functional embedded system. This pinout guide covers the physical pin assignment, alternate functions, and practical notes for circuit design and firmware development.
PY32F003-F1xPx TSSOP20 Pinout
The PY32F003 in TSSOP20 package has 20 pins in a dual in-line arrangement.
Physical Pin Diagram (Low-Level, TSSOP20F1 Package)
PY32F003F1xPx TSSOP20F1 (Top View)
+---------+
PA2 ---| 1 20 |--- PA1
PA3 ---| 2 19 |--- PA0
PA4 ---| 3 18 |--- PF2-NRST
PA5 ---| 4 17 |--- PF1
PA6 ---| 5 16 |--- PF0
PA7 ---| 6 15 |--- PF4
Vss ---| 7 14 |--- PB7
PA12 ---| 8 13 |--- PB6
Vcc ---| 9 12 |--- PB5
PA13-SWD ---| 10 11 |--- PA14-SWC
+---------+
Annotated Pinout (Development Board Layout)
This diagram shows the same pins with alternate function labels, as typically found on PY32F003F18P breakout boards:
PY32F003F18P
+---------+
5V ---| |--- 3V3 (Power: 3.3V)
GND ---| 15 |--- F4 (GPIO, BOOT)
(ADC_IN2, I2C_SDA) A2 ---| 1 20 |--- A1 (ADC_IN1, USART_TX)
(ADC_IN3, I2C_SCL) A3 ---| 2 19 |--- A0 (ADC_IN0, USART_RX)
(ADC_IN4, SPI_NSS) A4 ---| 3 18 |--- F2 (GPIO, NRST)
(ADC_IN5, SPI_SCK) A5 ---| 4 17 |--- F1 (GPIO, I2C_SCL)
(ADC_IN6, SPI_MISO) A6 ---| 5 16 |--- F0 (GPIO, I2C_SDA)
(ADC_IN7, SPI_MOSI) A7 ---| 6 14 |--- B7 (GPIO, ADC_IN7)
(PWM) A12 ---| 8 13 |--- B6 (GPIO, ADC_IN6)
(SWD_IO, Debug) A13 ---| 10 12 |--- B5 (GPIO, ADC_IN5, PWM) LED
3V3 ---| 11 |--- A14 (SWD_CLK, Debug)
3V3 ---| |--- GND
GND ---| |--- GND
+---------+
Pin Function Table
| Pin | Port | Primary Function | Alternate Functions |
|---|---|---|---|
| 1 | PA2 | GPIO | ADC_IN2, I2C_SDA, USART_TX |
| 2 | PA3 | GPIO | ADC_IN3, I2C_SCL, USART_RX |
| 3 | PA4 | GPIO | ADC_IN4, SPI_NSS, TIM_CH2 |
| 4 | PA5 | GPIO | ADC_IN5, SPI_SCK, TIM_CH1 |
| 5 | PA6 | GPIO | ADC_IN6, SPI_MISO, TIM_CH1 |
| 6 | PA7 | GPIO | ADC_IN7, SPI_MOSI, TIM_CH2 |
| 7 | VSS | Power | Ground |
| 8 | PA12 | GPIO | PWM output, TIM_CH2 |
| 9 | VCC | Power | 3.3V supply |
| 10 | PA13 | Debug | SWD_IO (do not use for GPIO) |
| 11 | PA14 | Debug | SWD_CLK (do not use for GPIO) |
| 12 | PB5 | GPIO | ADC_IN5, PWM, onboard LED |
| 13 | PB6 | GPIO | ADC_IN6 |
| 14 | PB7 | GPIO | ADC_IN7 |
| 15 | PF4 | GPIO | BOOT0 control |
| 16 | PF0 | GPIO | I2C_SDA (alternate) |
| 17 | PF1 | GPIO | I2C_SCL (alternate) |
| 18 | PF2 | Reset | NRST (hardware reset) |
| 19 | PA0 | GPIO | ADC_IN0, USART_RX |
| 20 | PA1 | GPIO | ADC_IN1, USART_TX |
Communication Interface Pin Mapping
USART (Serial Communication)
| Signal | Pin | Port |
|---|---|---|
| TX | Pin 20 | PA1 |
| RX | Pin 19 | PA0 |
Alternate USART pins are available via the GPIO alternate function remapping register.
SPI
| Signal | Pin | Port |
|---|---|---|
| NSS (CS) | Pin 3 | PA4 |
| SCK | Pin 4 | PA5 |
| MISO | Pin 5 | PA6 |
| MOSI | Pin 6 | PA7 |
I2C
Two sets of I2C pins are available:
| Set | SDA | SCL |
|---|---|---|
| Primary | PA2 (pin 1) | PA3 (pin 2) |
| Alternate | PF0 (pin 16) | PF1 (pin 17) |
SWD Debug Interface
| Signal | Pin | Port | Note |
|---|---|---|---|
| SWD_IO | Pin 10 | PA13 | Reserved for debug — do not use as GPIO |
| SWD_CLK | Pin 11 | PA14 | Reserved for debug — do not use as GPIO |
ADC Channel Mapping
The PY32F003's 12-bit ADC channels are mapped to GPIO pins:
| ADC Channel | Pin | Port |
|---|---|---|
| ADC_IN0 | Pin 19 | PA0 |
| ADC_IN1 | Pin 20 | PA1 |
| ADC_IN2 | Pin 1 | PA2 |
| ADC_IN3 | Pin 2 | PA3 |
| ADC_IN4 | Pin 3 | PA4 |
| ADC_IN5 | Pin 4 | PA5 |
| ADC_IN6 | Pin 5 | PA6 |
| ADC_IN7 | Pin 6 | PA7 |
All ADC channels share GPIO pins. A pin used as ADC input cannot simultaneously be used as digital GPIO.
PWM Pin Notes
PWM outputs are generated through the timer peripheral channels. Available PWM pins on PY32F003:
| PWM Channel | Pin | Port |
|---|---|---|
| TIM1_CH1 / TIM1_CH2 | PA4, PA5, PA6, PA7 | Port A |
| TIM3_CH1 | PA12 | Port A |
| TIM3_CH2 | PB5 (LED) | Port B |
PB5 is connected to the onboard LED on most development boards — useful for quick visual feedback during PWM testing.
Boot Mode Control
PF4 controls boot mode selection:
| PF4 State | Boot Mode |
|---|---|
| HIGH (pull-up) | Normal boot from flash |
| LOW (pull to GND) | Boot from system memory (ISP mode) |
In ISP (In-System Programming) mode, the device can be programmed via USART without an SWD debugger.
Practical Pin Selection Guide
Digital output (LED, relay)? → PA5, PA6, PA7, PB5, PB6, PB7
Digital input (button)? → Any GPIO pin (use pull-up mode)
USART communication? → PA1 (TX), PA0 (RX)
SPI peripheral? → PA4 (NSS), PA5 (SCK), PA6 (MISO), PA7 (MOSI)
I2C sensor bus? → PA2 (SDA), PA3 (SCL)
ADC analog reading? → PA0–PA7 (ADC_IN0–ADC_IN7)
PWM output? → PA4–PA7, PA12, PB5
Debug connection? → PA13 (SWD_IO), PA14 (SWD_CLK)
Reset? → PF2 (NRST)
Final Thoughts
The PY32F003 TSSOP20 pinout packs a complete embedded system into 20 pins. The careful overlap between GPIO, ADC, SPI, I2C, and USART functions on the same physical pins gives hardware designers flexibility in how they route the board.
The key constraint to remember: PA13 and PA14 are dedicated to SWD debugging and should not be used for GPIO in production without disabling the debug port — which prevents future firmware updates via SWD.
Understanding the PY32 pinout is the foundation of every hardware design and firmware configuration for this chip.