Description
CH32F103C8T6 chip is compatible with the standard STM32F103C8T6 series chip, all pins are compatible, all registers are compatible, but the USB function is enhanced. There are 2 USB, a host, and a device, which have stronger functions and lower cost. However, the flash download algorithm is different from the internal Bootloader and the compatibility of the st company. ST’s download software cannot be used, but the official software download is also very convenient. You can use the serial port and USB. The USB method is faster and is not required Develop additional BootLoader.
For the specific parameters of the chip, please refer to the official data sheet and application manual in the data package. The following mainly introduces the next three download modes.
(1) STLINK(Download in Keil project)
Note: For development code and drivers, please refer to the official EVT package
Here is an example of the GPIO_PC13LED project. Note that debugging only supports SWD.
1.Install the device library, find the device library file in the EVT folder (you must install to find the device) Keil.WCH32F1xx_DFP.1.0.0.pack, open and install.
EVT download link://www.wch.cn/downloads/CH32F103EVT_ZIP.html
2. After opening the project file, select the device as shown in the figure below, here select CH32F103C8.
3.After connecting to STlink, select the simulation downloader in the Debug item in the configurationoptions, as shown in the figure:
4.Enter the settings of the emulator. After selecting the SW, you can see the kernel value, indicating that the hardware connection is correct, otherwise you need to check the hardwareconnection.
5.To add an algorithm file, select the Flash download option page in the above figure, select Add in this page, add an algorithm, and select CH32F1xx Flash for the algorithm. Then confirm.
6.Download the program. After completing the above settings, recompile the program, and then click the Load button on the toolbar to download.
The output bar when the download is successfully completed is as follows:
(1) Serial download
Hardware connection:(Use serial port module)
Rxd——>A9
Txd—->A10
GND——>G
VCC——>3.3
Jumper boot0 is set to high 1
Software configuration:
1. When using the serial port to download, install the official dedicated download software WCHISPTool (the software can be found in the software package WCHISPTool_Setup.exe). Note that ST’s download software cannot be used because the internal BootLoader is currently not compatible. After installation, open as shown in the figure:
WCHISPTooldownload address:
//www.wch.cn/downloads/WCHISPTool_Setup_exe.html
2、Configuration process:
①Select the serial port -> ②If the USB has a pull-up resistor, you can remove it here——>③Select the download serial port number——>④Select the HEX or bin file you want to download—— ->⑤Download
3、After the download is successful:
After the download is complete, set the jumper BOOT0 to low level 0 and press the reset button to run the program. Note that if the download record shows that the download failed, please check whether the jumper BOOT0 is set correctly, and then restart the software and try again. If it still does not work, please re-power on the serial port module.
(3) HUSB download(No need for an additional downloader, the data cable can be downloaded)
CH32F103 has 2 USB ports, one is the host usb and the other is the device usb. The corresponding pins are:
HUSB: PB7——>D+
PB6——>D-
USB: PA12—–>D+
PA11—–>D-
The software is downloaded by default using HUSB, so as long as the data cable is directly connected to the HUSB port on the back of the board.
Hardware connection:
1、Connect the USB data cable to the HUSB port on the back of the board;
2、Jumper boot0 is set to high 1
Software configuration:
①Select the USB port—>②Release the read protection——>③See the USB device——>④Select the HEX or bin file to download——->⑤Download
After the download is complete, set the jumper BOOT0 to low level 0 and press the reset button to run the program. Note that if the download record shows that the download failed, please check whether the jumper BOOT0 is set correctly, and then restart the software and try again. If it still does not work, please re-power on the serial port module.
Reviews
There are no reviews yet.