3504 views|1 replies

2870

Posts

4

Resources
The OP
 

[RISC-V MCU CH32V103 Review] First impression of CH32V103C8T6 chip [Copy link]

 

After getting the RISC-V core development board sent by EEWORLD, I first did an experiment to light up the LED. It was basically smooth and I could see the LED flashing normally. This shows that the chip's pin driving ability is pretty good. Jiangsu Qinheng Company is a relatively good company in the domestic interface chip market. I think there should be no problem with the whole chip. Because there is no comprehensive test, I dare not draw a conclusion: all the pins of the whole chip are normal. But for this experiment, there is no problem.

From the above figure, we can see that the bus of this chip is the same as the structure of ARM, which means that the peripheral programming of RISC should be similar. Further exploration will find that the clock tree of the system is also similar.

From the figure, we can see that the system's main clock HSI and real-time RTC clock are separate. The system has an internal 8MHz RC oscillator as the default CPU clock. The system clock source HSI is turned on by default. When the clock is not configured or reset, the internal 8MHz RC oscillator is used as the default CPU clock. Then you can select an external 4-16MHz clock or PLL clock. When the clock safety mode is turned on, if HSE is used as the system clock, the system clock will automatically switch to the internal RC oscillator when the external clock fails, and the HSE and PLL will automatically shut down; for the low-power mode with the clock turned off, the system will automatically switch to the internal RC oscillator after waking up. If the clock interrupt is enabled, the software can receive the corresponding interrupt. From the above description, we can see that the system can configure whether to use the external clock source when it starts . This design is the same as the ARM design.

Therefore, when programming, you can set the operating frequency of the bus clock by configuring the PLL parameters. From this, we can guess the process of system initialization:

1. Set whether to use external clock source HSI

2. According to the frequency of the clock source, set the coefficient of the PLL. This also sets the operating frequency of the bus. Once you have the clock set, you can set the peripherals.

3. The operating rate of the bus can be calculated based on the parameters of the PLL, so as to set the operating frequency of peripherals such as timer, USB, UART, SPI, I2C, PWM, ADC, DAC, etc.

4. Just set other working parameters of various peripherals.

5. Set the pins and working status of the peripherals.

But when I opened the program template, I found this.

 int main(void)
{
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
    Delay_Init();
	USART_Printf_Init(115200);
	printf("SystemClk:%d\r\n",SystemCoreClock);

	printf("This is printf example\r\n");

	while(1)
  {

	}
}

Wow, there are so few codes. I am surprised! Oh, it is so simple. It seems that I am worrying too much.

This post is from Domestic Chip Exchange

Latest reply

In my post, there is a detailed process. He called the system initialization function in the startup assembly.  Details Published on 2021-1-21 20:44
 
 

36

Posts

0

Resources
2
 

In my post, there is a detailed process. He called the system initialization function in the startup assembly.

This post is from Domestic Chip Exchange
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list