CH32V003 RISC-V Microcontroller DIP PCB Design + Schematic

In this article, I’ll show you the CH32V003 schematic & PCB design steps, explain some of the design aspects, 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 development board built around the CH32V003 which is known on the internet as 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.

You may also need to check out my other CH32V003 dev board PCB design project linked below.

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

This is another project around the CH32V003 RISC-V microcontroller. You may want to have a look at its schematic design, firmware test examples, etc.

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. CH32V003 UART Example
  7. CH32V003 ADC-PWM LED Dimmer Example
  8. Concluding Remarks
  9. CH32V003 Schematic + PCB Design Project Video

CH32V003 Overview & Datasheet

The CH32V003 is based on the QingKe RISC-V2A core design of an industrial-grade general-purpose microcontroller, that supports 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.

CH32V003 Schematic Diagram - PCB Project

1. DC PWR In + LDO

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

However, if you’d like to, the CH32V003 can and will operate at a regulated +5v input power source. The (digital peripherals, IO pins, ADC, and analog circuits) will adjust and work fine with that voltage. All IOs are 5v-tolerant in this microcontroller.

2. CH32V003 MCU Circuitry

The CH32V003 microcontroller 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. IO Ports + LEDs

Just pin-out all the IO pins to two headers depending on your desired board shape and layout.

I’ve added a power indicator LED + 1x user-programmable LED. I wanted the LED to be PWM-controlled, so I made sure it was hooked to a TxCHx pin on the CH32V003 microcontroller.

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 adding a dedicated chip for that purpose. We’ll use this USB-UART for testing our project today.


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 take a bit more time to get fabricated.

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

CH32V003 PCB Project Order1

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.

Here is what the boards look like after unboxing the JLCPCB package. We’ll solder some pin headers to one of these PCB boards, put it onto a breadboard, and we’re ready for testing.

CH32V003 PCB Design KiCAD


CH32V003 LED Blinking GPIO Example Test

This is the first test example project in which we’ll blink the onboard LED.

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.

CH32V003 LED Blinking Test Result


CH32V003 PWM Example Test

In this test project, we’ll dim the onboard LED using PWM output (TIMER1-CH3).

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.

CH32V003 PWM LED Dimmer Test Result


CH32V003 UART Example

In this test example project, we’ll configure the UART1 peripheral in the CH32V003 MCU to operate in TX mode @ 115200bps. We’ll connect it to the printf() function to send debug messages over the serial port to the USB-UART bridge inside the WCH-Link debugger so we can display the messages on any PC VCP terminal.

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

CH32V003 UART (printf) Example Code

The Application Code For This Example (main.c)

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

CH32V003 UART (Printf) Test Result

CH32V003 UART Printf Example


CH32V003 ADC-PWM LED Dimmer Example

In this test project, we’ll dim the onboard LED using PWM output (TIMER1-CH3) controlled by a potentiometer which is hooked up to an analog input pin that we’ll sample using the ADC (12-bit) in single-channel single-conversion mode triggered by software.

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

CH32V003 ADC LED Dimmer Example Code

The Application Code For This Example (main.c)

 

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

CH32V003 ADC LED Dimmer Test Result


Concluding Remarks

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. There are lots of firmware examples online from WCH or community-contributed repos that you can reference to accelerate prototyping your project ideas.

MCU Reset Button

You can easily add a manual MCU reset button externally on the breadboard as shown below.

CH32V003 Reset Pin Push Button

More CH32V003 Firmware Examples

There are lots of firmware examples by WCH for the CH32V003 microcontroller that you can reference here in the link below.

WCH CH32V003 Examples

There is also a GitHub repo with so many examples and useful stuff that was recommended to me by Charles, CNLohr (who’s got an excellent YT channel, BTW).

CNLohr CH32V003Fun Github Repo

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