User Guide
GD32E230K-START
8
/
10
the LEDs are flashed once for test and LED1 is on, press down the Wakeup Key, LED1
will be turned off. Press down the Wakeup Key again, LED1 will be turned on.
5.4
TIMER_KeyBoard_EXTI
5.4.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
Learn to use TIMER to generate PWM
GD32E230K-START board has two keys and one LED. The two keys are Reset key and
Wakeup key. The LED1 are controlled by GPIO.
This demo will show how to use the TIMER PWM to trigger EXTI interrupt to toggle the
state of LED1 and EXTI interrupt line to control the LED1. When press down the Wakeup
Key, it will produce an interrupt. In the interrupt service function, the demo will toggle
LED1.
5.4.2
DEMO Running Result
Download the program < 04_TIMER_KeyBoard_EXTI > to the EVAL board, all the LEDs
are flashed once for test, press down the Wakeup Key, LED1 will be turned on. Press
down the Wakeup Key again, LED1 will be turned off. Jump JP3 to Dx. Connect
PA6(TIMER2_CH0) and PB5 with DuPont line. The LED1 will be toggled every 500ms.