[CH32VM00X] Support for variants ch32v002 ch32v006, TSSOP20, QFN20, QSOP24 and others - #200
Open
maxint-rd wants to merge 43 commits into
Open
[CH32VM00X] Support for variants ch32v002 ch32v006, TSSOP20, QFN20, QSOP24 and others#200maxint-rd wants to merge 43 commits into
maxint-rd wants to merge 43 commits into
Conversation
Note: added peripheral menu in board.txt only for V003, VM00x, X035 - lacking board options for others will probably result in failing to compile. TODO: support peripheral menu for others
Issue openwch#27 [this comment](openwch#27 (comment)).
This was referenced Jun 17, 2025
This was referenced Jul 7, 2025
Open
define CH32V002 when CH32V002F4 is defined (as done by board selection)
Check if USART2 is defined before using it.
…openwch#65) - micros was counting backwards (openwch#65) - micros used 64-bit division; using 32-bit is more than 1K smaller (openwch#204) (requires same change for delayMicroseconds() in ../wiring_time.h)
delayMicroseconds() used 64-bit division; using 32-bit is more than 1K smaller (see openwch#204) (similar change for micros() in ch32/clock.c)
This was referenced Jan 2, 2026
Closed
Note: requires conditional setting of peripherals in variant_CH32....h file: #ifndef IDE_MENU_PERIPHERALS // defined when peripherals are enabled/disabled via the IDE menu #define ADC_MODULE_ENABLED #define UART_MODULE_ENABLED #define SPI_MODULE_ENABLED #define I2C_MODULE_ENABLED #define TIM_MODULE_ENABLED #endif
Note: requires updated boards.txt with section # Peripherals Options To see added options in IDE the cache may need to refreshed. On Windows this can be done by deleting the cache folder prior to restarting. C:\Users\<username>\AppData\Roaming\arduino-ide
This was referenced Apr 2, 2026
…xint-rd/arduino_core_ch32 into support-CH32V002F4-CH32V006F8
…xint-rd/arduino_core_ch32 into support-CH32V002F4-CH32V006F8
Has same pins as TSSOP20
added ifdef
Also F4 variant (Same pins as TSSOP20).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recently I acquired some CH32V002 and CH32V006 chips in a TSSOP20 package. Since they share the same pinout as the CH32V003, I think they can be useful upgrades for V003 projects. Based on the V006 QFN32 variant K8U6 this PR adds support for the V002 and V006 in TSSOP20 packages.
The V006 has 62KB flash, which makes it a good candidate for debugging V003 projects. I included some handy information such as Arduino pin numbers and installation instructions in
variants/CH32VM00X/README.md.Note: This PR is not 100% complete but works for me and may be useful for others. It adds peripheral selection from the IDE menu only for certain chips. For others it may break compilation/uploading, so please be selective and know what you want.
To make it useful this PR includes some changes derived from other PR's:
|| defined(CH32VM00X)to support I2C and SPIEdit: I've only implemented support for the chips that I could test myself, Although I still don't have the full range of CH32 chips in my collection, the generous donation by @BitByteBeetle allowed me to add many more variants. The README gives further info about this and lists known issues.