Minimalistic CH32V003 prototyping board |
Core
QingKe V2 series microprocessor is a 32-bit general-purpose MCU microprocessor based on the standard
RISC-V instruction subset RV32E(Base Integer Instruction Set) C(16-bit compression instruction) with only 16 general-purpose registers.
V2 series supports addition to custom XW extensions, Hardware Prologue/Epilogue (HPE), Vector Table Free (VTF), single-wire serial debug interface (SDI), and support for "WFE" instructions.
The following topics are covered in their QingKeV2_Processor_Manual Chapter 2 Exception Chapter 3 PFIC and Interrupt Control Chapter 4 System Timer (SysTick)Chapter 5 Processor Low-power Settings
Chapter 7 CSR Register List
RISC-V instruction subset RV32E(Base Integer Instruction Set) C(16-bit compression instruction) with only 16 general-purpose registers.
See reference manual for peripheral programming and application code example. The debug protocol and debug registers are documented in the RISC-V QingKeV2 Microprocessor Debug Manual.
GPIO
While CH32V003F4 pins are backward compatible with STM8F3 (TSSOP-20), 2 additional GPIO pins are available - VCAP pin replaced as PD0 and RST pin can be reused as PD7.
There are some GPIO input threshold differences between the STM8 and CH32V003.
3.3V * 8.9K /(8.9K + 30K) = 0.755V and 5V * 8.9K/(8.9K + 30K) = 1.144V
There are four 5V tolerant pins: PC1, PC2, PC5, PC6 (vs 2 in STM8) and up to 8 ADC pins. The alternate functions are more flexible as some can be mapped to additional GPIO pins. For the 20 pins package, Port C and D are rearranged as two contiguous 8-bit ports which make life easier for interfacing to byte-wise devices.
Bootloader
Debricking
Resources:
There is a bit-bang USB implementation available in beta - RV003USB This implementation looks much cleaner than the STM8 VUSB project that I have been using. The USB pins are configurable in usb_config.h
There is a CH32V003 F4P6 V-USB Development Board with the USB pins on PA1 and PA2.
Alternate IDE:
Visual Studio Code using Platform IO plugin and Community-PIO-CH32V platform
Upgrade path
The next cheapest upgrade is the CH32X035 or CH32X033 which aren't pin compatible, but they can operate at 5V. They are USB Connectivity parts. This bumps up the RISC-V core, FLASH, SRAM, ADC, UART, USB.
The design document is currently untranslated while the reference manual is available in English.
M – Standard Extension for Integer Multiplication and Division
A – Standard Extension for Atomic Instructions
C – Standard Extension for Compressed Instructions
The most accessible parts are the TSSOP-20 with cheaply available breakout boards. I have originally ordered the TSSOP and find myself maxing out the GPIO very quickly for a couple of projects I have in mind. I have ordered some QSOP28 but cannot find a cheap source for breakout boards. QSOP has a pin pitch of 0.635mm (0.025") which is slightly tighter than the 0.65mm pitch for TSSOP20 which I can manage with my home made PCB.
Their 0.4mm pitched QFN parts on the other hand would require commercial quality PCB.