![GigaDevice Semiconductor GD32170C-START User Manual Download Page 10](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32170c-start/gd32170c-start_user-manual_2225792010.webp)
User Guide
GD32170C-START
9 /11
This demo will show how to use EXTI interrupt line to control the LED1 and LED2. When
press down the User Key, it will produce an interrupt. In the interrupt service function, the
demo will toggle LED1 and LED2.
5.3.2.
DEMO running Result
Download the program <03_EXTI_Key_Interrupt_mode> to the board, first of all, all the
LEDs will be flashed once for test. Then press down the User Key, LED1 and LED2 will be
turned on. Press down the User Key again, LED1 and LED2 will be turned off.
5.4.
TIMER_Key_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
GD32170C-START-V1.0 board has two keys and two LEDs. The two keys are Reset key and
User key. The LED1 and LED2 are controlled by GPIO.
This demo will show how to use the TIMER PWM to trigger EXTI interrupt to toggle the state
of LED2 and EXTI interrupt line to control the LED1. When press down the User 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_Key_EXTI > to the EVAL board, all the LEDs are
flashed once for test, press down the User Key, LED1 will be turned on. Press down the User
Key again, LED1 will be turned off. Connect PA6 (TIMER2_CH0) and PF7 with DuPont line.
The LED2 will be toggled every 500ms.