name: CH32V203
variations: F6P, F8P, F8U, G6U, G8R, KxT, CxT, CxU, RBT # TSSOP20, TSSOP20, QFN20, QFN28, QSOP28, LQFP32, LQFP48, QFN48, LQFP64M
# CH32V203AxB
# A = pin count: J = 8, A = 16, F = 20, G = 28, K = 32, T = 36, C = 48, R = 64, W = 68, V = 100, Z = 144
# B = package: T = LQFP, U = QFN, R = QSOP, P = TSSOP, M = SOP
description: RISC-V micro-controller
keywords: MCU, Micro-Controller
datasheet: http://www.wch-ic.com/downloads/CH32V203DS0_PDF.html

pinout@F6P: # TSSOP20
  PORTA:
    PA0-WKUP: 6
    PA1: 7
    PA2: 8
    PA3: 9
    PA4: 10
    PA5: 11
    PA6: 12
    PA7: 13
    PA11: 17
    PA12: 18
    PA13: 19
    PA14: 20
  PORTB:
    PB1: 14
    PB8: 1
  CTRL:
    BOOT0: 1 
    OSC_IN: 2
    OSC_OUT: 3
    NRST: 4
  GROUND:
    VSS: 15
  POWER:
    VDD: 16
    VDDA: 5

pinout@F8P: # TSSOP20
  PORTA:
    PA0-WKUP: 6
    PA1: 7
    PA2: 8
    PA3: 9
    PA4: 11
    PA5: 12
    PA6: 10
    PA7: 13
    PA8: 18
    PA9: 19
    PA10: 20
    PA13: 1
    PA14: 2
  PORTB:
    PB0: 14
    PB13: 15
    PB14: 16
    PB15: 17
  CTRL:
    NRST: 5
  GROUND:
    VSS: 3
  POWER:
    VDD: 4

pinout@F8U: # QFN20
  PORTA:
    PA0-WKUP: 1
    PA1: 2
    PA2: 3
    PA3: 4
    PA4: 5
    PA5: 6
    PA6: 20
    PA7: 7
    PA8: 14
    PA9: 15
    PA10: 18
    PA11: 17
    PA12: 16
    PA13: 16
    PA14: 17
  PORTB:
    PB0: 8
    PB1: 9
    PB10: 10
    PB11: 11
    PB14: 12
    PB15: 13
  GROUND:
    VSS: 21 # pad 
  POWER:
    VDD: 19

pinout@G6U: # QFN28
  PORTA:
    PA0-WKUP: 6
    PA1: 7
    PA2: 8
    PA3: 9
    PA4: 10
    PA5: 11
    PA6: 12
    PA7: 13
    PA9: 18
    PA10: 19
    PA11: 19
    PA12: 20
    PA13: 21
    PA14: 22
    PA15: 23
  PORTB:
    PB0: 14
    PB1: 15
    PB3: 24
    PB4: 25
    PB5: 26
    PB6: 27
    PB7: 28
    PB8: 1
  CTRL:
    BOOT0: 1
    OSC_IN: 2
    OSC_OUT: 3
    NRST: 4
  GROUND:
    VSS: 16, 21 # pad
  POWER:
    VDD: 17
    VDDA: 5

pinout@G8R: # QSOP28
  PORTA:
    PA0-WKUP: 9
    PA1: 10
    PA2: 11
    PA3: 12
    PA4: 15
    PA5: 16
    PA6: 13
    PA7: 17
    PA8: 24
    PA9: 25
    PA10: 26
    PA11: 27
    PA12: 28
    PA13: 28
    PA14: 1
  PORTB:
    PB0: 14
    PB1: 20
    PB5: 1
    PB6: 2
    PB7: 3
    PB8: 5
    PB10: 18
    PB11: 19
    PB12: 20
    PB13: 21
    PB14: 22
    PB15: 23
  CTRL:
    BOOT0: 4
    NRST: 8
  GROUND:
    VSS: 7
  POWER:
    VDD: 6

pinout@KxT: # LQFP32
  PORTA:
    PA0-WKUP: 6
    PA1: 7
    PA2: 8
    PA3: 9
    PA4: 10
    PA5: 11
    PA6: 12
    PA7: 13
    PA8: 18
    PA9: 19
    PA10: 20
    PA11: 21
    PA12: 22
    PA13: 23
    PA14: 24
    PA15: 25
  PORTB:
    PB0: 14
    PB1: 15
    PB3: 26
    PB4: 27 
    PB5: 28
    PB6: 29
    PB7: 30
    PB8: 31
  CTRL:
    BOOT0: 31
    OSC_IN: 2
    OSC_OUT: 3
    NRST: 4
  GROUND:
    VSS: 16, 32
  POWER:
    VDD: 1, 17

pinout@CxT: # LQFP48
  PORTA:
    PA0-WKUP: 10
    PA1: 11
    PA2: 12
    PA3: 13
    PA4: 14
    PA5: 15
    PA6: 16
    PA7: 17
    PA8: 29
    PA9: 30
    PA10: 31
    PA11: 32
    PA12: 33
    PA13: 34
    PA14: 37
    PA15: 38
  PORTB:
    PB0: 18
    PB1: 19
    PB2: 20
    PB3: 39
    PB4: 40 
    PB5: 41
    PB6: 42
    PB7: 43
    PB8: 45
    PB9: 46
    PB10: 21
    PB11: 22
    PB12: 25
    PB13: 26
    PB14: 27
    PB15: 28
  PORTC:
    PC13-TAMPER-RTC: 2
    PC14-OSC32_IN: 3
    PC15-OSC32_OUT: 4
  CTRL:
    BOOT0: 44
    OSC_IN: 5
    OSC_OUT: 6
    NRST: 7
  GROUND:
    VSS: 23, 35, 47
    VSSA: 8
  POWER:
    VDD: 24, 36, 48
    VDDA: 9
    VBAT: 1

pinout@CxU: # QFN48
  PORTA:
    PA0-WKUP: 10
    PA1: 11
    PA2: 12
    PA3: 13
    PA4: 14
    PA5: 15
    PA6: 16
    PA7: 17
    PA8: 29
    PA9: 30
    PA10: 31
    PA11: 32
    PA12: 33
    PA13: 34
    PA14: 37
    PA15: 38
  PORTB:
    PB0: 18
    PB1: 19
    PB2: 20
    PB3: 39
    PB4: 40 
    PB5: 41
    PB6: 42
    PB7: 43
    PB8: 45
    PB9: 46
    PB10: 21
    PB11: 22
    PB12: 25
    PB13: 26
    PB14: 27
    PB15: 28
  PORTC:
    PC13-TAMPER-RTC: 2
    PC14-OSC32_IN: 3
    PC15-OSC32_OUT: 4
  CTRL:
    BOOT0: 44
    OSC_IN: 5
    OSC_OUT: 6
    NRST: 7
  GROUND:
    VSS: 23, 35, 47, 49
    VSSA: 8
  POWER:
    VDD: 24, 36, 48
    VDDA: 9
    VBAT: 1

pinout@RBT: # LQFP64
  PORTA:
    PA0-WKUP: 14
    PA1: 15
    PA2: 16
    PA3: 17
    PA4: 20
    PA5: 21
    PA6: 22
    PA7: 23
    PA8: 41
    PA9: 42
    PA10: 43
    PA11: 44
    PA12: 45
    PA13: 46
    PA14: 49
    PA15: 50
  PORTB:
    PB0: 26
    PB1: 27
    PB2: 28
    PB3: 55
    PB4: 56
    PB5: 57
    PB6: 58
    PB7: 59
    PB8: 61
    PB9: 62
    PB10: 29
    PB11: 30
    PB12: 33
    PB13: 34
    PB14: 35
    PB15: 36
  PORTC:
    PC0: 8
    PC1: 9
    PC2: 10
    PC3: 11
    PC4: 24
    PC5: 25
    PC6: 37
    PC7: 38
    PC8: 39
    PC9: 40
    PC10: 51
    PC11: 52
    PC12: 53
    PC13-TAMPER-RTC: 2
    PC14-OSC32_IN: 3
    PC15-OSC32_OUT: 4
  PORTD:
    PD2: 54
  CTRL:
    OSC_IN: 5
    OSC_OUT: 6
    NRST: 7
    BOOT0: 60
  GROUND:
    VSS: 31, 63, 18
    VSSA: 12
  POWER:
    VDD: 32, 64, 19
    VDDA: 13
    VBAT: 1
  NC: 47, 48

properties:
  in: NRST, BOOT0
  bidir: PA0-WKUP, PA1-15, PB0-15, PC0-12, PC13-TAMPER-RTC, PC14-OSC32_IN, PC15-OSC32_OUT, PD0-15, PE0-15, PF0-15, PG0-15
  passive: OSC_IN, OSC_OUT
  power: VDD, VDDA, VBAT
  nc: NC
  ground: VSS, VSSA
  inverted: NRST

schematic:
  symbol: IC
  left: CTRL, PORTA
  right: PORTB, PORTC, PORTD
  top: POWER
  bottom: GROUND

housing@F6P: # TSSOP20
  suffix: F6P
  pattern: SOP
  bodyWidth: 4.4
  bodyLength: 6.5
  height: 1.1
  leadWidth: 0.25
  leadLength: 0.6
  leadSpan: 6.4
  pitch: 0.65
  leadCount: 20

housing@F8P: # TSSOP20
  suffix: F8P
  pattern: SOP
  bodyWidth: 4.4
  bodyLength: 6.5
  height: 1.1
  leadWidth: 0.25
  leadLength: 0.6
  leadSpan: 6.4
  pitch: 0.65 # e
  leadCount: 20

housing@G8R: # QSOP28
  suffix: G8R
  pattern: SOP
  bodyWidth: 3.9
  bodyLength: 9.9
  height: 1.55
  leadWidth: 0.25
  leadLength: 0.65
  leadSpan: 6.0
  pitch: 0.635
  leadCount: 28

housing@F8U: # QFN20
  suffix: F8U
  pattern: QFN
  bodyWidth: 3.0
  bodyLength: 3.0
  height: 0.75
  leadWidth: 0.2
  leadLength: 0.4
  pitch: 0.4
  leadCount: 20
  tabWidth: 1.7
  tabLength: 1.7
  tabPosition: 0.0, 0.0

housing@G6U: # QFN28
  suffix: G6U
  pattern: QFN
  bodyWidth: 4.0
  bodyLength: 4.0
  height: 0.75
  leadWidth: 0.2
  leadLength: 0.4
  pitch: 0.4
  leadCount: 28
  tabWidth: 2.8
  tabLength: 2.8
  tabPosition: 0.0, 0.0

housing@CxU: # QFN48
  suffix: CxU
  pattern: QFN
  bodyWidth: 7.0
  bodyLength: 7.0
  height: 0.85
  leadWidth: 0.25
  leadLength: 0.4
  pitch: 0.5
  leadCount: 48
  tabWidth: 5.5
  tabLength: 5.5
  tabPosition: 0.0, 0.0

housing@KxT: # LQFP32
  suffix: KxT
  pattern: QFP
  bodyWidth: 7.0
  bodyLength: 7.0
  height: 1.5
  leadWidth: 0.35
  leadLength: 0.6
  leadSpan: 9.0
  pitch: 0.8
  leadCount: 32
  rowCount: 8
  columnCount: 8
 
housing@CxT: # LQFP48
  suffix: CxT
  pattern: QFP
  bodyWidth: 7.0
  bodyLength: 7.0
  height: 1.5
  leadWidth: 0.2
  leadLength: 0.6
  leadSpan: 9.0
  pitch: 0.5
  leadCount: 48
  rowCount: 12
  columnCount: 12
 
housing@RBT: # LQFP64M
  suffix: RBT
  pattern: QFP
  bodyWidth: 10.0
  bodyLength: 10.0
  height: 1.5
  leadWidth: 0.22
  leadLength: 0.6
  leadSpan: 12.0
  pitch: 0.5
  leadCount: 64
  rowCount: 16
  columnCount: 16
