ch55xduino
ch55xduino copied to clipboard
Add 6MHz clock support
I've added support for 6MHz clock. I've tested it for accuracy with my CH552G.
Here is a loop function you can use to test:
void loop() {
delay(1000);
USBSerial_println(millis());
delay(2000);
USBSerial_println(millis());
delay(4000);
USBSerial_println(millis());
delay(8000);
USBSerial_println(millis());
delay(16000);
USBSerial_println(millis());
}
Please do not include the formatting code into the PR or I can not see where you changed. At this moment you changed every line of the code.
Also please only cherry pick the necessary commits.
I know there are format issue in this repo and I'll get them fixed these days. You can do your part afterward.
@DeqingSun I've undone the formatting changes. Let me know what you think. I had to add a "hacky" part for the delay() function, I'm not sure why the approach that all the other frequencies used does not work. Nevertheless, the code is working and I am now running my CH552G at 6Mhz, saving a few milliamps of current.
Thanks, this looks nice. But a clock change will require intensive testing with logic analyzer. I will test the timing then I will merge it.