This post was last edited by lising on 2019-5-13 22:58 The content of this experiment is serial communication USART0, which sends data to the PC through print output statements and displays it through the PC serial assistant software. Serial communication can facilitate the debugging of related programs of various modules in the later stage. 1. Experimental resources 1. GD32E231C_START evaluation board; 2. Keil v5.27.1.0; 3. GigaDevice.GD32E23x_DFP.1.0.0.pack; 4. GD32E23x_Demo_Suites_V1.0.1; 5. GD32E231C_START development board related documents; 6. Serial port assistant software SSCOM V5.13.1; 7. USB to serial port tool; 2. Experimental process 1. Resource analysis. From the data sheet, we can know that GD32E231C8T6 has two serial ports, USART0 and USART1. The GD32E231C_START evaluation board has brought out USART0 through JP9. For the convenience of the experiment, USART0 is used. In the schematic diagram and data sheet, we can see that USART0 is reused to PA9 and PA10 pins; 2. Hardware connection. Use a USB to serial port tool to connect to USART0 through a Dupont line;
3. The program implementation is modified according to the routine provided by GigaDevice. The program is also relatively simple. It should be noted that when configuring USART0, it is necessary to turn on the clock of USART0 and the clock of GPIOA port where USART0 is located:
rcu_periph_clock_enable(USART0_PORT_CLK); //Turn on the clock of GPIOA port where USART0 is located rcu_periph_clock_enable(RCU_USART0); //Turn on the clock of USART0
复制代码
Another point is to turn on the multiplexing of PA9 and PA10:
3. Summary In the program, it is necessary to pay attention to turning on the serial port clock and the GPIO clock where the serial port is located, and also turn on the port multiplexing function. This experiment only did serial port output, which is convenient for later experiments.