This post was last edited by lising on 2019-6-21 19:32
This experiment is mainly to establish a development environment for the CH549EVT development learning board under KEIL, and try to use "USB" and "serial port" program downloads. The experimental test program is modified from the routine provided by Qinheng Electronics.
1. Experimental resources
1. CH549EVT learning development board;
2. Keil v5.28.0.0;
3. CH549 development data summary.rar;
4. WCHISPTool v2.70;
5. Qinheng USB to serial port module;
6. Other relevant documents of CH549EVT;
For more information, please visit Jiangsu Qinheng Co., Ltd. http://wch.cn/
2. Create a development environment
1. Add device support for KEIL. Open "WCHISPTool", click "Function" in the menu bar, and then click "Add WCH MCU to KEIL Device Library" in the drop-down list. Then you can see the list of WCH MCUs in KEIL:
2. Create a simple test project. Since Qinheng Electronics provides a lot of experimental routines, here is to use the official routines and modify them. CH549EVT provides 4 LEDs. The test program is relatively simple, let these 4 LEDs flip every 100ms.
3. Program implementation
4. Program download. There are two ways to download the program: 1. USB; 2. Serial port. Let's experience them separately:
a. USB method. Open "WCHISPTool", select the microcontroller chip model corresponding to the development board as "CH549", the download method as "USB", and also check "Run the target program after downloading is complete".
At this time, use the USB cable provided to connect the "P6" of CH549EVT to the PC USB. When the power switch "S1" is off, press "S2" to turn on "S1", and then release "S2". At this time, you can see "Model CH549---Device No. 1" in the "USB Device List" column; at the same time, a dialog box "USB Module" has been installed will pop up on the PC. Then select the "hex" file just compiled in the "User Program File". Click the "Download" button... After the download is completed, the program starts running, and the "USB Device List" column in "WCHISPTool" becomes blank again, waiting for the next download instruction to arrive.
b. Download via serial port. Since the driver of CH340 chip has been installed on the computer before, there are two CH340 serial ports in the device manager. The one we are using now is COM14. Here we use the USB to serial port module provided by Qinheng Electronics. The three pins RXD, TXD and GND are used to connect with P30, P31 and GND of CH549EVT. The settings in "WCHISPTool" are also very simple. When downloading, you need to power off and then on.
3. Experimental results. The learning and development environment was built very quickly using the official tool software, routines and equipment. At the same time, the "WCHISPTool" software was used to download programs in two ways: "USB" and "serial port". The test program ran perfectly after downloading.
4. Experimental Summary
Through this experiment, I have a preliminary perceptual understanding of Qinheng Electronics' microcontrollers and the supporting tool software, routines, etc., which has created conditions for the next step of learning. In the experimental experience of two different download methods, I found that the "USB" method is simpler, does not require other peripherals, and the download speed is much faster than the "serial port" method. However, the power switch configured on the learning development board is a toggle switch. When pressing the download button, you have to turn on the power switch, which is not very convenient to operate with one hand. It would be convenient if this switch is replaced with a normally closed non-self-locking button type; the "serial port" method has a slower download speed and requires a USB to serial port module, but it can be operated with one hand.
This is my first time experiencing Qinheng Electronics’ products. The overall feeling is very good. I can use these resources to learn from now on.
This content is originally created by lising , a user on the EEWORLD forum. If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source