CH32V003 Schematic & PCB Board (RISC-V MCU HW Design)

In this article, I’ll show you the CH32V003 schematic & PCB design steps, explain some of the design decisions that I’ve made, how to prepare the files needed for manufacturing, and how to place the PCB SMT order at JLCPCB who are kindly sponsoring this project as well.

This is a custom CH32V003 development board designed for evaluating the 10 cents RISC-V microcontroller from WCH. This project can serve as a baseline for anyone willing to create his own RISC-V MCU dev board based on the CH32V003 microcontroller.

This Project is Sponsored By JLCPCB

Table of Contents

  1. CH32V003 Overview & Datasheet
  2. CH32V003 Dev Board Schematic Design
  3. Placing PCBA Order @ JLCPCB
  4. CH32V003 LED Blinking GPIO Example Test
  5. CH32V003 PWM Example Test
  6. Conclusion & Upcoming Next
  7. CH32V003 Schematic + PCB Design Project Video

CH32V003 Overview & Datasheet

The CH32V003 is based on QingKe RISC-V2A core design of industrial-grade general-purpose microcontroller, support 48MHz system main frequency, ADC, DMA, and a handful of other peripherals. Here is a block diagram of the microcontroller’s top-level architecture.

CH32V003 RISC-V Microcontroller Architecture

CH32V003 Variants & IC Packages

CH32V003 Datasheet & Reference Manual

CH32V003 Datasheet

CH32V003 Reference Manual

IDE: MounRiver Studio (MRS)


CH32V003 Dev Board Schematic Design

This is the schematic design that I came up with for this CH32V003 development board project. Some parts are not mandatory and can be omitted for even more cost optimization if you need.

CH32V003 Schematic Diagram (Custom PCB Project)

1. DC PWR In + LDO + USB-UART

There’s a USB-C port that I’m using for power input (+5v) as well as USB-UART bridge (CH340E chip).

The USB +5v input is regulated down to 3.3v using an LDO. The 3.3v is then used to power up the CH32V003 microcontroller.

2. CH32V003 MCU Circuitry

The CH32V003 microcontrollr requires a 3.3v input voltage @ Vdd pin, a 100nF decoupling capacitor, and a 24MHz crystal oscillator.

You can use any crystal oscillator frequency you want, however, it’s necessary to use a 24MHz if you want to run the MCU at its maximum speed @48MHz. This is because the internal PLL is not arbitrarily programmable as in STM32 microcontrollers for example. The internal PLL just multiplies the input clock frequency by 2 and that’s it.

CH32V003 Clock Tree & PLL

I’ve also added an NRST button to reset the microcontroller when needed.

3. Debug Port

The CH32V003 supports a serial wire debug using only one line if you’re going to use the WCH-Link debugger as the one shown below.

WCH-Link Debugger

This debugger has an internal USB-UART bridge that you can use instead of the CH340E chip that I’ve added to reduce the size/cost of your dev board, just in case you need to.

4. IO Port + LEDs

Just pinout all the IO pins to one or two headers depending on your desired board shape and layout.

I’ve addd a power indicator LED + 2x user programmable LEDs. I wanted the LEDs to be PWM-controlled, so I made sure they’re hooked to TxCHx pins on the CH32V003 microcontroller.


Placing PCBA Order @ JLCPCB

Finally, we’re ready to generate the fabrication files and send them to JLCPCB for PCB fabrication and assembly. For this task, I use the KiCAD plugin named “Fabrication Toolkit”. With just one button click, you’ll have all manufacturing output files ready in a new folder that’s automatically created for you by the plugin toolkit.

KiCAD-JLCPCB-Fabrication-Output-Files-Toolkit

1. Upload Your Gerber File & Check PCB Fab. Options

The next step is to upload your PCB Gerber files and modify the PCB fabrication options as needed in your project. Just keep an eye on the price because some options are not considered as a standard fabrication process, which will end up costing you a bit more and takes a bit more time to get fabricated.

Even if you’re 100% sure that your design & fabrication files are flawless, the online system & JLCPCB or any other fab house can still pick up wrong components orientation or placement. Always double-check the PCB component placement after uploading your files.

CH32V003 PCB Project Order1
CH32V003 PCB Project Order2

2. Upload BOM & CPL Files

The next step is to upload your design’s BOM file and the components positions file (CPL) to JLCPCB and let it check the files and report the stock status and total number of components to be assembled, their cost, and so on.

CH32V003 PCB Project Order3

Check everything and make sure the components are selected correctly from the JLCPCB SMT library. And also double-check the component placements on the next page and correct any wrong rotations in the CPL file. There is a mismatch between the KiCAD output position file & JLCPCB’s system, so it does pick up wrong orientations for some ICs, diodes, etc. Always double-check everything before placing the order.

3. Pay To Place Your Order

The last step to place your order is to pay for the invoice and you can apply any valid discount coupon at this step to reduce the cost.

4. Wait For Delivery & Prepare For Testing!

You should expect to receive your board within 4 days to 1 week depending on where you live.


CH32V003 LED Blinking GPIO Example Test

This is the first test example project in which we’ll blink the onboard 2x LEDs alternatively for half a second each.

Open the MounRiver IDE, create a new project using NoOS Tempelate, and copy the example test code below.

CH32V003 LED Blinking GPIO Example Code

The Application Code For This Example (main.c)

Compile & Flash the firmware to the board using the WCH-Link debugger.

LED Blinking Test Result


CH32V003 PWM Example Test

In this test project, we’ll dim the onboard 2x LEDs alternatively using PWM outputs (CH3 & CH4 For LED1 & LED2).

Open the MounRiver IDE, create a new project using NoOS Tempelate, and copy the example test code below.

CH32V003 PWM Example Code

The Application Code For This Example (main.c)

 

Compile & Flash the firmware to the board using the WCH-Link debugger.

PWM LED Dimmer Test Result


Conclusion & Upcoming Next

By the end of this, you should have learned how to create your custom CH32V003 dev board or incorporate this microcontroller in your next project if needed.

The intention behind designing this board that I’ve shown you today is to evaluate the possibility of using a cheap MCU like the CH32V003 for touching sensing applications using the CVD algorithm/technique. This could significantly offload the CapTouch sensors sampling task from the main application processor. Here is a sneak peek of what’s coming up next!

Coming Up Next:

  • CH32V003 RISC-V CVD Capacitive Touch Sensing
  • CH32V003 Minimal DIP Board Replacing Old MCUs

CH32V003 Schematic + PCB Design Project Video

Here is the video for this project on YouTube if you’d like to get more in-depth information and explanation of the design of this CH32V003 PCB project.

Share This Page With Your Network!
Join Our +25,000 Newsletter Subscribers!

Stay Updated With All New Content Releases. You Also Get Occasional FREE Coupon Codes For Courses & Other Stuff!

Photo of author
Author
Khaled Magdy
Embedded systems engineer with several years of experience in embedded software and hardware design. I work as an embedded SW engineer in the Automotive & e-Mobility industry. However, I still do Hardware design and SW development for DSP, Control Systems, Robotics, AI/ML, and other fields I'm passionate about.
I love reading, writing, creating projects, and teaching. A reader by day and a writer by night, it's my lifestyle. I believe that the combination of brilliant minds, bold ideas, and a complete disregard for what is possible, can and will change the world! I will be there when it happens, will you?

Leave a Comment