What kind of MCUs would you prefer for simpler tasks such as controlling a fan in 2025? It should be somehow future proof, as I don‘t want to change everything for every project…
Several years ago I switched to using CH32V003 for the things I previously used ATTiny85 and even ATMega328 for.
- 2k RAM, 16k flash, 18 GPIOs covers almost anything an Uno can do. The flash is smaller, but RISC-V code is also a lot smaller, especially for 16 bit or 32 bit values and pointers/arrays. 48 MHz speed is also a lot more.
- priced at $0.10 to $0.20 in qty 50 ($5 or $10 investment) for 8, 16, 20 pin packages (but no DIP), while 85s are $1+ and 328's several dollars.
https://www.aliexpress.com/item/1005005036714708.html (official WCH store)
- works on 2.7V - 5.5V, 5V is rare for newer MCUs
- supports proper debugging, using 1 pin
- peripherals are copies of STM32, you can literally use STM's documentation (though WCH's is good too), just with a RISC-V CPU instead of Arm.
- official kit for $8 with a dev board, a WCHLinkE USB programmer, and 5x 20 pin chips.
https://www.aliexpress.com/item/1005004895791296.html- a lot of unofficial dev boards. I like the $1.50 nanoCH32V003 from Muse Lab. They also have a bundle with their own version of the WCHLinkE USB programmer for $6.50.
https://www.aliexpress.com/item/1005005221751705.html- improved CH32V002 (4k RAM, 16k flash) and CH32V004 (6k RAM, 32k flash) now seem to be easily available. They also have expanded voltage range (down to 2V), 12 bit ADC instead of 10 bit. Also multiply instructions.
- easy to upgrade to bigger, faster, WCH chips with more pins, USB, 2.4 GHz radios, etc.
- They've become very popular, there's a large and active community. One great resource is very lightweight header files and example code by chlohr. Do have a browse around that, look at the examples
https://github.com/cnlohr/ch32fun- WCH have provided Arduino library support, if you want to stick with that
Our host reviewed the CH32V003 2 1/2 years ago:
- search "CH32V003" on YouTube. There's a lot of stuff!