Setting internal clock in CH32V003
asked 15 hours ago by @qa-kk1mnlwiolgct4brmhtf 0 rep · 68 views
I have a program for CH32V003 built in Arduino IDE. The problem is that timing is broken because Arduino IDE assumes 48 MHz clock but the MCU is set to 24 MHz HSI clock.
In Arduino I have no option to tell the compiler that the actual clock is 24 MHz so I would like to set the internal clock to 48 MHz to achieve match between reality and assumptions.
Arduino IDE is 2.3.10, WCH-CH32 EVT board option is version 1.0.4. Neither "Clock" nor "Clock Selection" is present in the Tools menu, so the only way out seems to be to reprogram the internal clock, but I could not find any library function to do this and my experience with this CPU is almost zero at the moment.