In September 2024 I started exploring the cheap WCH and Puya microprocessors (MCU). At first I had very little clue what I was doing, their product ranges and how to program them. I bought a bunch of different Puya and WCH based Dev boards to explore and try and see what I could get working. Blindly flaying around, I managed to get a blinking LED (a hardware Hello World) working on them all, but the WCH based CH32V003 seemed to be the most accessible on my Ubuntu Linux laptop. For the Puya MCU's I needed to use a Windows 10 based VM on my Linux computer, which was a pain to flash-up each time I wanted to program them.
It took me a while to find some decent information on the CH32V003 RISK-V based MCU, It has a wide operating voltage range: 2.7 volts to 5.5 volts. This means it can run natively from a LiPo battery (2.9V-4.2V) without needing a LDO, or a buck/boost DC-DC converter. If you do need more powerful MCU, you can upgrade to the CH32V20x or CH32V30x range of MCU's. Note: be aware there is a CH32F203 MCU, with F denoting it's a ARM based MCU.
Here is a condensed list of sites that has helped me the most while I was exploring the CH32V003:
Getting Started:
You will need to install the Moun River IDE: http://www.mounriver.com/download Note: you can also use PlatformIO and CLI based tools, but their IDE is the easiest way to start.
It's best to use their their LinkE R0 V1.3 programming dongle: https://www.wch-ic.com/products/WCH-Link.html Just make sure its the LinkE dongle. I have one of these, but I also picked up a smaller LinkE R0-V1.3 blue board from TaoBao. Some people have also used a Raspberry Pi RP2040 board to upload programs to the CH32V003 dev board.
Handy Web Resources:
1. Pallav Aggarwal is super generous with his information: https://pallavaggarwal.in/2023/10/01/ch ... ogramming/
2. As well as the Curious Scientist: https://curiousscientist.tech/
3. WCH GitHub site: https://github.com/openwch/ch32v003 ; check out the EVT/EXAM folder for code examples.
4. Blake Sands, for his WS2812 bit-banging code: https://github.com/Blakesands/CH32V003
5. There is work going on with running a stripped down Arduino version for the CH32V003: https://github.com/AlexanderMandera/arduino-wch32v003 I successfully managed to get the Arduino template installed into Moun River.
My GitLab code examples:
1.i2C example of reading and writing to a DRV2605 haptic driver IC: https://gitlab.com/parkview/haptic-breakout
2. My go at exploring MCU Interrupts and the two different sleep states: https://gitlab.com/parkview/CH32V003-int-sleep
3. Most PWM demos just explain how to use PWM via GPIO PD2. Here is how to use a bunch of different GPIO pins for PWM: https://gitlab.com/parkview/CH32V003-PWM-Demo
4. My go at bit-banging WS2812 RGB LEDs: https://gitlab.com/parkview/CH32V003A4M ... oller-v1.0 (software and KiCad PCB) This was based on code from Blake Sands (see link above). I was using the internal MCU oscillator (no crystal), so my board was running at 24MHz. I had to modify (reduce) the amount of NOP's being used for each of the 1's and 0's. I have seen some people using DMA to drive the WS2812 data stream, but I haven't pursued that yet.