CH32V103C8T6
CH32V103C8T6 is Qinheng's RISC-V core MCU, based on the RISC-V3A processor. The core uses a 2-level pipeline, sets up static branch prediction, instruction prefetch mechanism, and supports DMA. The main parameters are as follows
CPU: 32-bit RISC-V3A, RV32IMAC instruction set, up to 80MHz, typical 72MHz
RAM: 20KB
Flash: 64KB
BootLoader: 3.75KB system boot program storage area
Power supply: 2.7V - 5.5V (compatible with 3.3V and 5V)
Timer: General 3, Advanced 1, Watchdog 2, System Clock 1
ADC: 12bit, 10CH
SPI: 2
I2C: 2
UART: 3
USBHD: 1
Package: LQFP48
Hardware parts
WCH-Link programmer
You need to prepare a WCH-Link for burning Qinheng's chip. There are burners on the market that are compatible with DAP-Link and WCH-Link. Pay attention to the instructions of the burner. Its mode can be switched by pressing the button before powering on. When burning CH32V103, it must be in the WCH-Link state.
Development Board Blue Pill
Because the pin layout of CH32V103C8T6 is exactly the same as STM32F103C8T6 and CH32F103C8T6, the hardware design is universal, and the PIN is compatible, so the STM32F103C8T6 core board (Blue Pill) can be directly used as a development board. I happened to have a STM32F103C6T6 development board in my hand. The circuit is the same as that of STM32F103C8T6, but the chip model is different, so I used hot air soldering to blow off the C6T6 and replaced it with CH32V103C8T6.
The temperature of the hot air gun is set to 290 degrees, and the MCU is added with flux oil.
STM32F103C6T6 pad after blowing off
I soldered the CH32V103C8T6, but it was a little crooked the first time.
I blew it again, carefully placing it in the correct position this time.
I measured the resistance between each PIN and found that some PINs were poorly soldered, so I used a soldering iron to clean them again.
Connection
WCH-Link -> Blue Pill
3V3 -> 3V3
GND -> GND
SWD -> SWIO
SCK -> SWCLK
RX -> PA9
TX -> PA10
If you do not want to observe the serial port output, RX/TX can be disconnected.
Software
The software part is actually MounRiver Studio. After downloading, unzip and install it. MounRiver Studio is an extended development environment based on Eclipse, which is relatively convenient for people who are familiar with Eclipse. When installing MounRiver Studio, the WCH-Link driver is installed, and there is no need to install it separately.
Download address: http://mounriver.com/download
Instructions
https://bbs.21ic.com/icview-3037572-1-1.html
https://blog.csdn.net/qq_36353650/article/details/108321298
https://zhuanlan.zhihu.com/p/413153955
If you need to observe the serial port output, you also need to use a serial port tool, such as putty.
Test items
Create a project
Let's build a test project to drive the PC13 LED on the board through GPIO
File -> New -> MounRiver Project, in the dialog box
Select chip model WCH -> CH32V103 [RIsC-V] -> CH32V103C8T6
Enter the Project Name, for example Test001
Check Use default location. If you need to put it in another directory, you can uncheck it and choose it yourself.
Select NoneOS for Template Type, because this is just a simple test and only requires a while loop
Click Finish
The directory structure will appear in the Project Explorer.
Editing Code
The user code is in the User directory. Expand User, open main.c and modify the content to
#include "debug.h"
void GPIO_Toggle_INIT(void)
{
GPIO_InitTypeDef GPIO_InitStructure = {0};
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOC, &GPIO_InitStructure);
}
int main(void)
{
u8 i = 0;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
Delay_Init();
USART_Printf_Init(115200);
printf("SystemClk:%drn", SystemCoreClock);
printf("GPIO Toggle TESTrn");
GPIO_Toggle_INIT();
while(1)
{
Delay_Ms(500);
GPIO_WriteBit(GPIOC, GPIO_Pin_13, (i == 0) ? (i = Bit_SET) : (i = Bit_RESET));
printf("TESTrn");
}
}
Compile the project
The compilation and burning process is well packaged by MounRiver, so this part is relatively simple.
Use the compile button in the icon bar, or press F7 to compile the project (use Shift+F7 for a complete compile)
Burn
First check Ports (COM & LPT) in the device manager. If the writer is in WCH-Link state and connected to the computer, a device like WCH-LinkRV SERIAL (COMx) will appear.
Use the Download button in the icon bar, or press F8 to burn.
If the above steps are normal, you should see the LED on the development board switch on and off every half a second. The serial port is connected at a baud rate of 115200, and the output text "TEST" can be seen.
reference
Hardware and wiring https://blog.51cto.com/u_15127636/4347970
MounRiver Studio Burn
https://blog.csdn.net/qq_36353650/article/details/108513094
https://blog.csdn.net/weixin_41784968/article/details/123770290
https://github.com/weimingtom/wmt_ch32_study
Previous article:STC8H Development (Ten): SPI driver Nokia5110 LCD (PCD8544)
Next article:STM8S103F3P6 development, burning and debugging notes
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- Europe's three largest chip giants re-examine their supply chains
- Breaking through the intelligent competition, Changan Automobile opens the "God's perspective"
- The world's first fully digital chassis, looking forward to the debut of the U7 PHEV and EV versions
- Design of automotive LIN communication simulator based on Renesas MCU
- When will solid-state batteries become popular?
- Adding solid-state batteries, CATL wants to continue to be the "King of Ning"
- The agency predicts that my country's public electric vehicle charging piles will reach 3.6 million this year, accounting for nearly 70% of the world
- U.S. senators urge NHTSA to issue new vehicle safety rules
- Giants step up investment, accelerating the application of solid-state batteries
- Guangzhou Auto Show: End-to-end competition accelerates, autonomous driving fully impacts luxury...
- Why can't the P0 port of STC8A8K32S4A12 output a high level?
- What are the difficulties of spark spectrometer?
- Circuit design and application of USB signal transmission via optical fiber
- What other product parameters and characteristics do LED driver chip capacitors have?
- Who has access to VR payment?
- Decomposition
- Serial communication between CC2541 and MSP430
- 80C196MC's Peripheral Transaction Server and Its Application
- External power supply energy efficiency limit value and energy saving evaluation value
- c6678 sys/bios add hwi interrupt does not trigger, send successfully in bare metal case