openwch / arduino_core_ch32

Core library for CH32duino
218 stars 35 forks source link

Add clock option for CH32V003 #66

Closed DeqingSun closed 3 days ago

DeqingSun commented 3 months ago

I tried the Arduino Repo on a customized board and the systick was 50% speed while the UART run in correct speed. After some troubleshooting I realized the clock was set to external 48M, which fails and return to backup internal clock.

This PR allow user to choose clock source. That is useful for projects without external oscillator.

maxint-rd commented 3 months ago

Upvote for this - I'm all in favor for this and suggested the identical change in issue #27. Thank you for submitting this as a PR. (I was hoping WCH would take my suggestion to make the change and include other MCU's that I don't own and couldn't test...)

DeqingSun commented 3 months ago

Upvote for this - I'm all in favor for this and suggested the identical change in issue #27. Thank you for submitting this as a PR. (I was hoping WCH would take my suggestion to make the change and include other MCU's that I don't own and couldn't test...)

Did not see your issue since there was so many. Hoping a PR can make the work easier on WCH's side.

maxint-rd commented 2 months ago

Another upvote. Tested this PR successfully in Arduino IDE v2.3.2.

Note that after manually copying the modified files to their proper location, the local cache of the Arduino IDE needs to be deleted to see the menu changed. See also this Arduino IDE issue.

TianpeiLee commented 4 days ago

Thank you for your contribution. I may need to use your method for unified modification to adapt to all current chips.

DeqingSun commented 3 days ago

Thank you for your contribution. I may need to use your method for unified modification to adapt to all current chips.

Please go ahead. Look forward to see this feature in release.

TianpeiLee commented 3 days ago

thanks again