Skip to content

UIAPduino Pro Micro CH32V003 V1.4General Availability

V1.4-TopV1.4-BottomV1.4-Power

Overview

  • Adopt CH32V003 Running at 48 MHz, And Support Coding in Arduino IDE.
  • Is Supplied Power and Written Program with Single USB Type-C.
  • Act as a USB 2.0 Low-speed Device, Which Means the HID Device Can Be Made.
  • Protect Your USB Port Powerfully by On-Board Fuses.
  • Has Selectable Power Supply from 3.3 V or 5 V for the Microcontroller.
  • Can Be Connected by H: 2.0 mm / P: 2.54 mm ConthroughⓇ when CN2 Is Not Mounted.
  • Can Be Mounted Like a Surface-Mount Device, Because of Flat Bottom.
  • Is Open-Source Software and Open-Source Hardware.
  • Is RoHS Compliant , Designed in Japan and Lifetime Warranty.

Getting Started

Never plug the board into a USB port until instructed to do so to reduce the risk of a short circuit.

Let's write the program (sketch) to blink the LED and confirm that the LED blinks on the board.

Verified Environment

  • OS: Windows 10 / Windows 11 / Ubuntu 22.04 LTS / Ubuntu 24.04 LTS
  • USB Host: USB 2.0 Type-A / USB 3.2 Type-C
  • Arduino IDE: 2.3.2 / 2.3.3 / 2.3.4

Windows

Board Adding and Sketch Writing

Start Arduino IDE and add https://github.com/YuukiUmeta-UIAP/board_manager_files/raw/main/package_uiap.jp_index.json to Preference -> Additional boards manager URLs. Search for uiap on Tool -> Board -> Boards Manager and install UIAPduino.

Select to Tool -> Board -> UIAPduino -> Pro Micro CH32V003. All other settings are default. Open the example sketch that blinks an LED on File -> Examples -> 01.Basics -> Blink and add #define LED_BUILTIN 2 before setup().

cpp
// Define on board LED pin before setup()
#define LED_BUILTIN 2

// the setup function runs once when you press reset or power the board
void setup() {
...

While pressing the reset button, connect the board to a USB port of your computer and then immediately release the reset button. After waiting for the device to be set up, write the sketch by using Upload button in the Arduino IDE. When the message Image written. is displayed, writing is complete.

Even on the same computer, writing may be unable from some USB ports. If writing is unable, try using a different USB port. Also, Dedicated USB cable for power supply cannot write and communicate.

Check Working

There are 3 ways to run the program: A, B, or C.

  1. Press the reset button after writing.
  2. Connect to a USB port without pressing the reset button.
  3. Connect to a commercially available USB charger (AC adapter).

When the orange diode in the center of the board turns on and off repeatedly every second during any one of the steps, it is working properly. To Re-write the program, it needs to disconnect the board from the USB port and hold the reset button while replugging it to a USB port.

There is also a way to switch operating modes without replugging into a USB port: Seamless Switch

Linux

Follow the same operation as for Windows, and after installing the UIAPduino board, run the following command. Note that writing from Arch Linux is unstable.

bash
# Do this command after UIAPduino board was installed.
sudo ln -s ~/.arduino15/packages/UIAP/tools/minichlink-2982dfd/1.0.0/99-minichlink.rules /etc/udev/rules.d/99-minichlink.rules
# Reboot or do this command if needed.
sudo udevadm control --reload-rules

If you can't write due to minichlink, build it for your environment and replace to ~/.arduino15/packages/UIAP/tools/minichlink-2982dfd/1.0.0/minichlink.

Documents

Schematic of the PCBPCB LayoutDownload Eagle Project

Pinout Diagram

Pinout Diagram

Refer to variant_CH32V003F4.h and variant_CH32V003F4.cpp for the definition of port names in Arduino IDE.

Knowledge

Factory DefaultDraft

The custom bootloader (source code / binary file) based on cnlohr/rv003usb is written. This is for timeout adjustment, Seamless-Switch support, and product identification. Also, a user program is written that lights up the orange diode in the center of the board like a candle.

Seamless SwitchDraft

It switches between the write standby mode and the program execution mode without replugging into a USB port (Seamless-Switch).

Via the Reset Button

When 3 lines code are inserted into setup() of sketch, the function of the reset button alternates from "RESET" to "Seamless-Switch".

cpp
// the setup function runs once when you press reset or power the board
void setup() {
  if (FLASH->STATR & (1<<14)) NVIC_SystemReset();
  SystemReset_StartMode(Start_Mode_BOOT);
  pinMode(PD4, OUTPUT);
...

Anti Dazzling

The LEDs may be dazzling in a bedroom at night, etc. The LEDs inside the board can be turned off by cutting the jump pads.

FunctionColorSchematicJump PadDescription
Power onBlueLED1CUT1
USB signalOrangeLED2CUT2NOT be unwritable if cut.
Builtin LEDOrangeLED3CUT3Be high impedance if cut.

Application Example

WS2812B Lighting

DS18x20 Temp. Sensing

The code must be customized that allows sensing temperatures and sending messages at the same time.

Using Arduino Library

This is the Arduino library that worked and the sketch when worked.

SevSeg

Show Arduino Sketch
cpp
#include "SevSeg.h"
SevSeg sevseg; //Instantiate a seven segment object

void setup() {
  byte numDigits = 1;
  byte digitPins[] = {1};
  byte segmentPins[] = {3, 4, 2, 5, 9, 7, 8, 10};
  bool resistorsOnSegments = true; // 'false' means resistors are on digit pins
  byte hardwareConfig = COMMON_ANODE; // See README.md for options
  bool updateWithDelays = false; // Default 'false' is Recommended
  bool leadingZeros = false; // Use 'true' if you'd like to keep the leading zeros
  bool disableDecPoint = false; // Use 'true' if your decimal point doesn't exist or isn't connected. Then, you only need to specify 7 segmentPins[]

  sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments, updateWithDelays, leadingZeros, disableDecPoint);
}

void loop() {
  sevseg.blank();
  sevseg.refreshDisplay();
  delay(1000);
  sevseg.setNumber(0, 0);  
  sevseg.refreshDisplay();
  delay(1000);
  sevseg.setNumber(1, 0);
  sevseg.refreshDisplay();
  delay(1000);
  sevseg.setNumber(2, 0);
  sevseg.refreshDisplay();
  delay(1000);
  sevseg.setNumber(3, 0);
  sevseg.refreshDisplay();
  delay(1000);
  sevseg.setNumber(4, 0);
  sevseg.refreshDisplay();
  delay(1000);
  sevseg.setNumber(5, 0);
  sevseg.refreshDisplay();
  delay(1000);
  sevseg.setNumber(6, 0);
  sevseg.refreshDisplay();
  delay(1000);
  sevseg.setNumber(7, 0);
  sevseg.refreshDisplay();
  delay(1000);
  sevseg.setNumber(8, 0);
  sevseg.refreshDisplay();
  delay(1000);
  sevseg.setNumber(9, 0);
  sevseg.refreshDisplay();
  delay(1000);
}

Reference

CH32V003

Tips

DIY

Development Stack

With USB

With Arduino IDE

With Rust

Pro Micro

USB

Previous Version

Thank You for

Review

Suggestion

  • Masashi Sasaki
  • Kojo Kimura
  • Tomoyuki Dansako
Last Updated 2025/01/06