Skip to content

CH32V103 Runs at 8 MHz instead of 72 MHz #75

@Khalinda

Description

@Khalinda

I was bench marking floating point operations on a CH32V103C8V6 based board and I noticed very poor performance. I loaded a standard Arduino Blink sketch (with 1000 ms delays), and the LED was blinking on and off every 18 seconds instead of every 2 seconds. I modified a "GPIO_Toggle" MounRiver Studio project to also blink an LED with 1000 ms delays, and it behaves as expected.

The CH32V103C8T6 board has an 8 MHz crystal oscillator. The Arduino sketch is behaving as though the RCC PLL isn't being initialized to multiply the external oscillator frequency by 9. I modified the Blink sketch and the GPIO_Toggle project to print the values of all of the RCC registers. The values don't make sense to me, but both the sketch and the project report identical values:

RCC->CTLR 0x15583
RCC->CFGR0 0x0
RCC->INTR 0x0
RCC->APB2PRSTR 0x0
RCC->APB1PRSTR 0x0
RCC->AHBPCENR 0x4
RCC->APB2PCENR 0x4004
RCC->APB1PCENR 0x0
RCC->BDCTLR 0x0
RCC->RSTSCKR 0x18000000

Does anybody know what else I can check to track down this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions