Skip to content

Guidance for new variant #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
theaudiobible opened this issue Aug 28, 2023 · 8 comments
Closed

Guidance for new variant #22

theaudiobible opened this issue Aug 28, 2023 · 8 comments

Comments

@theaudiobible
Copy link
Contributor

Thanks for the useful Arduino core that you have provided. I am trying to add a variant for CH32V203RB and have made a PR #20 and would appreciate some guidance on how to make variant_CH32V203RB.h correctly.

@kklam4697
Copy link

@TianpeiLee hi hi, Can you please help to provide a guidence for making new variant file? I also want to make one for ch32x033. Or, maybe you can help to make variant file for us? Thanks a lot

@theaudiobible
Copy link
Contributor Author

theaudiobible commented Mar 4, 2024

@kklam4697, @TianpeiLee and @maxgerhardt, I think that I managed to successfully make the variant for CH32V203RB here https://github.com/theaudiobible/arduino_core_ch32/tree/CH32V203RB. I have been using it along with https://github.com/theaudiobible/platform-ch32v/tree/CH32V203RBT6.

I am happy to work with you to to make any necessary corrections and merge these changes back into the original source trees. Let me know how you would like to proceed.

@TianpeiLee
Copy link
Collaborator

Thank you for your contribution. Due to work reasons, I may not be able to handle it in a timely manner. Sorry!
I have checked CH32V203RB and it's OK, Regarding the pin issue, I defined it through the development board. If it is a WCH black development board, it usually has Arduino compatible IO ports on it, and this type of board selects these Arduino compatible ports.

@theaudiobible
Copy link
Contributor Author

Thanks for merging the CH32V203RB branch, @TianpeiLee.

@maxint-rd
Copy link
Contributor

kklam4697 ... I also want to make one for ch32x033. Or, maybe you can help to make variant file for us? Thanks a lot

@kklam4697 - How far did you get? I recently got some CH32X033F8P6 TSSOP20 chips and noticed that the X035 board definitions cannot be used properly. Too many pins just don't work. So I'm now making a variant for the X033 F8P6 which eventually I hope to publish as a PR. I'm starting with digital I/O and then working to see which pins will do ADC and PWM (analogRead() and analogWrite()). Other peripherals will have to wait for now.

@rambros3d
Copy link

Hello, I am trying to add the CH32X035C8T6 variant.
Image

There are 26 pin numbers in the CH32X035G8 variant files

/* CH32VX035G8 Pins */
#define PA0                     PIN_A0
#define PA1                     PIN_A1
#define PA2                     PIN_A2
#define PA3                     PIN_A3
#define PA4                     PIN_A4
#define PA5                     PIN_A5
#define PA6                     PIN_A6
#define PA7                     PIN_A7
#define PB0                     PIN_A8
#define PB1                     PIN_A9
#define PB3                     10
#define PB4                     11
#define PB6                     12
#define PB7                     13
#define PB8                     14
#define PB9                     15
#define PB10                    16
#define PB11                    17
#define PB12                    18
#define PC0                     PIN_A10
#define PC3                     PIN_A13
#define PC14                    21
#define PC15                    22
#define PC16                    23
#define PC17                    24
#define PC18                    25
#define PC19                    26

The C8T6 variant has some extra pins compared to the G8 variant.
PA0-PA23
PB0-PB13
PC6, PC7, PC15-PC19

Can someone help me with this variant. How do I number the extra pins?

@maxint-rd
Copy link
Contributor

maxint-rd commented May 23, 2025

Hello, I cant help you directly since I don't have any X035 in my collection. However, some time ago I shared my board definition for the X033, see #171. Feel free to review that definition.

For that chip I chose to have some logical order that follows the TSSOP20 pinout in a counter-clockwise fashion, starting with PA0 as D0 up to PC3 as D15 consecutively, skipping the programming pins SWDIO and SWCLK to assign them the last numbers D16 and D17, (At first I intended to follow the TSSOP20 pin numbers of the CH323V003 since that chip has many pins at the same position, but then thought the differences would maker that less useful).

For your chip variant I would probably try to follow the current X035G8 definition and add the additional pins with subsequent numbering. If that became too confusing I would probably renumber, but still start at PA0 for D0 and go consecutively counter-clockwise. Good luck!

BTW. To request more help you might want to add a new issue. Closed issues may get less response.

@rambros3d
Copy link

I also had a doubt why there were two similar names for the same pin (PA1, PA_1), after looking through the files I understood. But I had doubts about the pin numbering.

For your chip variant I would probably try to follow the current X035G8 definition and add the additional pins with subsequent numbering.

I will add the extra pins subsequently to the X035G8 definition.

BTW. To request more help you might want to add a new issue. Closed issues may get less response.

Right I will do that. I have a basic working board definition now.

@maxint-rd Thanks for the detailed explanations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants