Open siuyin opened 1 year ago
What method are you using to read the registers? I read it 0X00000000
The clock frequency immediately after reset should be 24MHz but the batch of CH32V003 chips I have run at 8MHz.
Did you see the print or the MCO pin? Which CH32V003 chip do you use? I use ch32V003F4P6 do not have the problem .Do you use our EVT as test project?
I used CH32V003F4P6 and measured system clock frequency by switching an LED on and off with a logic analyser. This is the test code I used:https://github.com/siuyin/ch32v003fun/blob/871a7350aac339c28b52cc4c08f3cd86e4bc2701/examples/minimal_blink/minimal_blink.c#L41
The setup code is: https://github.com/siuyin/ch32v003fun/blob/871a7350aac339c28b52cc4c08f3cd86e4bc2701/ch32v003fun/ch32v003fun.c#L766
SETUP_SYSTICK_HCLK is: https://github.com/siuyin/ch32v003fun/blob/871a7350aac339c28b52cc4c08f3cd86e4bc2701/ch32v003fun/ch32v003fun.h#L4856
I grabbed the MCO pin through the oscilloscope, and the system frequency shows 24M. I suspect your test program have question.
R32_RCC_CFGR0 immediately after reset = 0x20. Causes HCLK=8MHz. According to documentation CFGR0 should be /1 but is actually /3.
this also doesn't seem right
Indeed UART Enable should enable when set.
It maybe meant that when disabled it waits for ongoing.
This should be BRR
USART_CTLR1_OVER8 ((uint16_t)0x8000) / USART Oversmapling 8-bits / is not documented
LCKK says bit8 in doc, but ch32v00x_gpio.c says bit16
uint32_t tmp = 0x00010000;
Thank you very much, We will change it"uint32_t tmp = 0x00010000;"
For some reason it asks me for password to open these in Foxit reader: CH32V003DS0.PDF CH32V003RM.PDF
could you please fix them?
The reference manual: http://www.wch-ic.com/downloads/CH32V003RM_PDF.html
Section 3.4 Register description (page 17 on v1.4) states
R32_RCC_CFGR0 has a reset value of 0x00000000.
This is incorrect. On a physical device, the reset value was found to be 0x00000020.
Please update the documentation or issue an errata for the CH32V003 part.