QingKe RISC-V2A
32-bit RV32EC core with hardware interrupt support.
A tiny 48 MHz RISC-V controller with enough ADC, timers and serial hardware for sensors, motors, LEDs and low-cost dedicated controllers.
32-bit RV32EC core with hardware interrupt support.
Small by modern standards—prefer compact C and avoid large frameworks.
Use static buffers carefully. There is no room for large dynamic allocations.
Eight external analog channels plus internal sources.
One advanced and one general-purpose 16-bit timer.
One peripheral of each type, multiplexed across the GPIO pins.
Connect PC3 → 220Ω–1kΩ resistor → LED anode (+), then connect the LED cathode (−) to GND. Do not omit the resistor. PD7 was tested and produced a continuously lit LED because it is also NRST: driving it low resets the MCU.
V (the "3.3 V" programming pin) outputs about 5 V while USB-C is plugged in. Every V pad is the same rail. Do not connect USB-C power and the WCH-LinkE 3V3 output at the same time.
The CH32V003 supports a VDD range of approximately 2.7–5.5 V, so the board runs fine at 5 V. On this minimal board, all pins marked V are one shared VCC rail. When powered from USB-C they sit near USB VBUS (~5 V); when powered only from the LinkE 3V3 pin they are ~3.3 V.
Practical consequence: at 5 V VDD, every GPIO high level and the ADC full-scale reference are 5 V. Power the MAX4466 from the same rail so its output cannot exceed VDD.
| Power arrangement | Expected V rail | Safe practice |
|---|---|---|
| USB-C only | About 5 V | Leave LinkE 3V3 disconnected; keep SWD and GND connected |
| WCH-LinkE only | About 3.3 V | Connect LinkE 3V3, GND and SWD; unplug USB-C |
| External regulated supply | 3.3 V or 5 V | Stay within MCU and peripheral ratings |
The three center pads on the underside are the programming header. The pad marked SWD is the board’s label for the CH32V003 single-wire PD1/SWIO signal.
| WCH-LinkE RISC-V header | Board center pad | Purpose |
|---|---|---|
| SWDIO / TMS | SWD | Single-wire programming and debugging |
| 3V3 | V | Target power only when USB-C is disconnected |
| GND | G | Common ground |
RX to MCU PD5/TX; only connect LinkE TX to PD6/RX if the firmware needs incoming serial.
| Function | Practical default pins | Notes |
|---|---|---|
| Debug | PD1 / center SWD pad | Reserve while developing |
| UART | PD5 TX, PD6 RX | PD6 may also drive the user LED |
| SPI | PC5 SCK, PC6 MOSI, PC7 MISO | Choose an available GPIO for chip select |
| I²C | PC1 SDA, PC2 SCL | External pull-ups are normally required |
| Analog | PA2 A0, PA1 A1, PC4 A2, PD2 A3, PD3 A4, PD5 A5, PD6 A6, PD4 A7 | ADC input must remain between GND and VDD |
| PWM examples | PC3 TIM1_CH3, PD2 TIM1_CH1, PD3 TIM2_CH2 | Volume LED plus bidirectional haptics |
| Reset | PD7 / NRST | Reset function depends on option-byte configuration |
1A86:8010.SWDIO→SWD, 3V3→V and GND→G.PlatformIO/01_Starters_Tests/CH32V003SanityTest and run upload.bat.PC3 → resistor → LED + and LED − → GND. Do not use PD7.cd PlatformIO\01_Starters_Tests\CH32V003SanityTest pio run pio run -t upload
| Part | Board pin | Function |
|---|---|---|
| MAX4466 OUT | PC4 / A2 | 10-bit ADC audio input |
| External LED + resistor | PC3 / TIM1_CH3 | Hardware-PWM microphone volume |
| H-bridge IN1 | PD2 / TIM1_CH1 | Forward motor PWM |
| H-bridge IN2 | PD3 / TIM2_CH2 | Reverse motor PWM |
PC3 and PD2 share TIM1 but use separate capture/compare channels, so LED brightness does not alter motor duty. PD3 uses TIM2 independently.