CH32 Devboard

Here's how to make a CH32 devboard! This tutorial is still a work-in-progress, but the schematic part is done :D

NOTE: you are expected to add features to your PCB to make it unique! Don't just copy the tutorial - your project will not be approved if you do.

In this tutorial, we'll be using a CH32V203, which is catagorized for small-and-medium capacity general-purpose use on the CH32V203 datasheet.

CH32 is a microcontroller! What's special about the CH32V203?

  • it's cheap - the ones we're using are <1 USD each!
  • it's got built in capacitive touch pins (search TKey on the datasheet to learn more)
  • they're pretty small

Some examples of projects made with a CH32V203, both by @cyao:

The specific one used in this tutorial is CH32V203G6U6, which you can find on LCSC here:

Schematic

Open up the Schematic Editor on KiCad.

Setting up the CH32V203

Press A to add parts, then search for the CH32V203! Get the one that says CH32V203GxUx, click OK, then place it anywhere on your page:

The first thing we're going to do is set up this microcontroller.

Let's add power! Press P, and search for +3v3, then press OK.

Place it right on top of the VDD and VDDA pins. Then, wire it by pressing W, or press the thin white line on the right!

It should look like this when you're done:

Press P again, and search for GND. Put it below VSS and connect them.

This is how the chip is going to get power! We still need to add a power source, but we'll be doing that later.

The next thing we're adding are decoupling capacitors. These are used to stabilize power and to filter out noise going to the CH32.

We need one decoupling capacitor per power pin, so add two capacitors! Press A and search for Capacitor.

Add two! It doesn't matter where you place it in your schematic - I like putting it near the power pins.

Connect both of them to +3v3 and GND. Then, change the text that says C into 100nF - this is the specific value we want the capacitor to be. You can change it by double clicking into the text. This doesn't matter for now, but it will when we order our PCB!

The next thing we're adding are Boot and Reset buttons! These are used when putting firmware on the devboard.

We need a button for each of them, so press A, and search for SW_Push, and put two on your schematic. I've place them near the boot and reset pins, since that's where they'll be wired to.

Press P and add another GND and +3v3. Wire the button next to RST to ground, and the other one to power!

For the Boot button, you also want to add a resistor that is connected to ground. This is called a "pull-down resistor" - this is so that the pin is not left floating (not connected to anything, which picks up noise) when it is not pressed! This keeps the signal always high (+3v3) or low (GND); when the button is pressed, since the current chooses the path of least resistance, it'll be high instead of low.

Make sure your schematic looks wired like mine. Moving onto adding other parts now!

USB-C

Press A, type in USB_C_Receptacle_USB2.0_14P, and place it anywhere with empty space!

Press P, and add VBUS. Connect that to the pin that says VBUS on the USB-C. This is where our circuit gets power!

Add another GND. Connect SHEILD and GND to it. SHIELD is the metal outer part around the USB-C connector.

Then, add two resistors. Label them 5.1k. Connect each to CC1 and CC2, then wire them to ground.

You can rotate parts by pressing R, and you can also drag the part text around so that your schematic looks cleaner.

We need to connect the data pins, D- and D+, to the CH32. To do this, we'll use labels!

You can think of a label as a portal that connects the pin with any other pin with the same label - it's used to wire things that are further away, so that the schematic looks cleaner.

Click the label button on the right. Type D+, then press OK.

Wire them to the D+ and D- pins! You can rotate them twice so the green line is fully under the label.

Copy paste the D+ and D- labels, and wire them to the D+ and D- pins on the CH32! This will be how data goes from your computer to the CH32 when they're connected via a USB-C cable.

We're done with the USB-C now!

Voltage regulator

The power pins on the CH32 are currently not connected to a power source, so it can't currently turn on - let's do that now. We want what's coming from VBUS from the USB-C to the VDD pins. However, CH32 takes in +3v3, and the power coming from the USB-C is +5v, since it'll be connected to a laptop.

In order to turn +5v into +3v3 to not fry the CH32, we need to use a voltage regulator - that'll covert +5v to +3v3!

The specific voltage regulator we'll use is the XC6206P332MR-G, which you can find on LCSC here:

It's output voltage is fixed at 3.3v, which is exactly what we need - read the datasheet here.

Press A, and add the part named XC6206PxxxMR, and place it anywhere on your schematic.

Wire the VI (voltage in) pin to VBUS, the VO (voltage out) pin to +3v3, and the GND pin to GND.

Then, add a decoupling capacitors on each side - change their text to be 1uF.

Now your schematic should look something like this:

Yay! you're almost done the schematic. To make it a devboard, break out the unused pins on the CH32! You can also make it anything else by attaching the various pins to different buttons, displays, sensors, etc.

Footprint assigning and PCB part tutorial coming soon!