User Guide
GD32L233C-START
12/16
5.3.
EXTI_Key_Interrupt_mode
5.3.1.
DEMO purpose
This demo includes the following functions of GD32 MCU:
Learn to use GPIO control the LED and the KEY
Learn to use EXTI to generate external interrupt
GD32L233C-START board has two user keys and four LEDs. The keys are Reset key and
Wakeup key. The LEDs are controlled by GPIO.
This demo will show how to use the EXTI interrupt line to control the LED2. When press down
the Wakeup key, it will produce an interrupt. In the interrupt service function, the demo will
toggle LED2.
5.3.2.
DEMO running result
Download the program < 03_EXTI_Key_Interrupt_mode > to the START board, LED2 is
turned on and off for test.
When press down the Wakeup key, LED2 will be turned on. Press
down the Wakeup key again, LED2 will be turned off.
5.4.
USART_HyperTerminal_Interrupt
5.4.1.
DEMO purpose
This demo includes the following functions of GD32 MCU:
Learn to use the USART transmit and receive interrupts to communicate with the
HyperTerminal.
5.4.2.
DEMO running result
Download the program <04_USART_HyperTerminal_Interrupt> to the EVAL board and
connect serial cable to USART. Firstly, all the LEDs are turned on and off for test. Then, the
USART sends the tx_buffer array (from 0x00 to 0xFF) to the hyperterminal and waits for
receiving data from the hyperterminal that you must send. The string that you have sent is
stored in the rx_buffer array. The receive buffer have a BUFFER_SIZE bytes as maximum.
After that, compare tx_buffer with rx_buffer. If tx_buffer is same with rx_buffer, LED1, LED2,
LED3, LED4 flash by turns. Otherwise, LED1, LED2, LED3, LED4 toggle together.
The output information via the
HyperTerminal is as following: