Opens in a new tab

CH32V003F4P6 Pinout (TSSOP20)

CH32V003 from WCH is a RISC-V microcontroller that sells for a few cents – yet it runs at 48 MHz and works at both 3.3 V and 5 V. It has become a popular replacement for 8-bit AVRs and many “single-purpose” chips.

CH32V003F4P6 is the most common package, TSSOP20 with 18 GPIO. Its successor, the CH32V002F4P6, has the same layout.

Specifications

  • RISC-V (QingKe V2A) at 48 MHz
  • 16 kB flash, 2 kB SRAM
  • 18 GPIO, 8 channels of 10-bit ADC, op-amp
  • USART, I2C, SPI, TIM1 (advanced) and TIM2 timers, PWM
  • 3.3 V or 5 V supply
  • single-wire programming and debugging (SWIO on PD1)
  • TSSOP20 package with 0.65 mm pitch

It is programmed with the WCH-LinkE (single-wire SWIO). You can choose MounRiver Studio, an Arduino IDE core, PlatformIO or the minimalist ch32fun. Peripheral functions can be remapped to other pins – the table shows the default layout as well as the remap options.

Pinout and pin table

Hover over a pin in the diagram or a table row; use the filter to highlight a bus. You can download the pinout as PNG or SVG.

CH32V003F4P6 – pinout (TSSOP20)CH32V003F4P6 – pinout (TSSOP20)chiptron.eu · CC BY 4.0CH32V003F4P6TSSOP20 1 PD4 A7 T2CH1ETR 2 PD5 A5 TX 3 PD6 A6 RX 4 PD7 T2CH4 NRST 5 PA1 A1 T1CH2 OSCI 6 PA2 A0 T1CH2N OSCO 7 VSS 8 PD0 T1CH1N 9 VDD → Power 3.3 V or 5 V 10 PC0 T2CH3 20 PD3 A4 T2CH2 19 PD2 A3 T1CH1 18 PD1 T1CH3N SWIO 17 PC7 MISO 16 PC6 MOSI 15 PC5 SCK 14 PC4 A2 T1CH4 13 PC3 T1CH3 12 PC2 SCL 11 PC1 SDA GPIO UART I2C SPI ADC (analog) PWM Power Ground (GND)
Download:PNGSVG
Pin table – CH32V003F4P6
PinNameDirectionUARTI2CSPIPWMADCRemapNote
1PD4input/outputT2CH1ETRA72: T1ETR; 3: T1CH4USART CK; OPA output
2PD5input/outputTXA52: RX; 3: T2CH4
3PD6input/outputRXA62: TX; 3: T2CH3
4PD7input/outputT2CH41: CK; 2: T2CH4, CKReset (NRST) by default; usable as GPIO only after switching in the option bytes (RST_MODE = 11); op-amp input +1
5PA1input/outputT1CH2A12: T1CH2Krystal (OSCI); op-amp input −0
6PA2input/outputT1CH2NA01: ADC trigger (AETR2); 2: T1CH2NKrystal (OSCO); op-amp input +0
7VSS–
8PD0input/outputT1CH1N1: SDA, TX; 2: T1CH1Nop-amp input −1
9VDDinputPower 3.3 V or 5 V
10PC0input/outputT2CH31: NSS, T1CH3; 2: T2CH3; 3: TX
11PC1input/outputSDANSS1: T1BKIN, T2CH4; 2: T2CH1ETR; 3: T1BKIN, T2CH1ETR, RX5 V tolerant
12PC2input/outputSCL1: ADC trigger (AETR), T2CH2, RTS; 2: T1BKIN; 3: T1ETRUSART RTS; T1BKIN; 5 V tolerant
13PC3input/outputT1CH31: T1CH1N, CTS; 2: T1CH3; 3: T1CH1N
14PC4input/outputT1CH4A21: T1CH2N; 2: T1CH4; 3: T1CH1clock output (MCO)
15PC5input/outputSCK1: SCK, T1ETR, T2CH1ETR; 2: SCL; 3: SCL, T1CH3, CKT1ETR; 5 V tolerant
16PC6input/outputMOSI1: MOSI, T1CH1; 2: SDA, CTS; 3: SDA, T1CH3N, CTS5 V tolerant
17PC7input/outputMISO1: MISO, T1CH2; 2: RTS; 3: T1CH2, T2CH2, RTS
18PD1input/outputT1CH3N1: SCL, T1CH3N, RX; 2: T1CH3NProgramming and debugging (SWIO, single wire – WCH-LinkE); ADC trigger (AETR2)
19PD2input/outputT1CH1A31: T2CH3; 2: T1CH1; 3: T1CH2N
20PD3input/outputT2CH2A41: T1CH4; 2: T2CH2USART CTS; ADC trigger (AETR)

What to watch out for

  • PD1 is the SWIO programming pin – if your program uses it for something else, uploading gets complicated. Leave it free.
  • PD7 is reset (NRST) from the factory – free it up as GPIO in the option bytes (RST_MODE = 11).
  • Logic levels follow the supply voltage – at 5 V the outputs are 5 V too.
  • PA1 and PA2 are used for an external crystal – with a crystal they are not available.
  • The ADC reference is the supply voltage.

CH32V articles on chiptron.eu/

These chiptron.eu/ articles cover the CH32V chips:

More pinouts

See all pinouts on the Pinouts page.

Related Articles