background image

 

 

User Guide 

GD32130F-START 

8 /11

 

 

5.2. 

 GPIO_Key_Polling_mode 

5.2.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 SysTick to generate 1ms delay 

GD32130F-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  User  key  to  control  the  LED1.  When  press  down  the 

User Key, it will check the input value of the IO port. If the value is  1, wait for 50ms. Then 

check the input value of the IO port again. If the value is still 1, indicates that the button is 

pressed down successfully, and light the LED1. 

5.2.2. 

 DEMO running Result 

Download the program <02_GPIO_Key_Polling_mode> to the board, first of all, all the LEDs 

will be flashed once for test. Then press down the User Key, LED1 will be turned on. Press 

down the User Key again, LED1 will be turned off. 

5.3. 

 EXTI_Key_Interrupt_mode 

5.3.1. 

 DEMO purpose 

This Demo includes the following functions of GD32 MCU: 

 

Learn to use GPIO to control the LED and the KEY 

 

Learn to use EXTI to generate external interrupt 

GD32130F-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 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.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 will be turned on. 

Press down the User Key again, LED1 will be turned off. 

Summary of Contents for GD32130F-START

Page 1: ...GigaDevice Semiconductor Inc GD32130F START User Guide V3 0 Nov 20 2019...

Page 2: ...ot option 5 4 3 LED 5 4 4 KEY 6 4 5 GD Link 6 4 6 Extension 6 4 7 MCU 7 5 Routine use guide 7 5 1 GPIO_Running_LED 7 5 1 1 DEMO purpose 7 5 1 2 DEMO running Result 7 5 2 GPIO_Key_Polling_mode 8 5 2 1...

Page 3: ...pply 5 Figure 4 2 Schematic diagram of boot option 5 Figure 4 3 Schematic diagram of LED function 5 Figure 4 4 Schematic diagram of Key function 6 Figure 4 5 Schematic diagram of GD Link function 6 Fi...

Page 4: ...User Guide GD32130F START 3 11 List of Tables Table 2 1 Pin assignment 4 Table 4 1 Boot configuration 5 Table 6 1 Revision history 10...

Page 5: ...re created based on Keil MDK ARM 4 74 uVision4 IAR version of the projects are created based on IAR Embedded Workbench for ARM 7 40 2 During use the following points should be noted 1 If you use Keil...

Page 6: ...0 1uF 3V3 LED3 LED0603 R9 470 1 TP1 TP 3V3 U5V P1 SMD1210P005TF 4 2 Boot option Figure 4 2 Schematic diagram of boot option R7 10K 1 2 3 JP4 BOOT0 GND BOOT0 3V3 Table 4 1 Boot configuration BOOT1 BOOT...

Page 7: ...3 PA4 14 PA5 15 PA6 16 PA7 17 PA8 29 PA9 30 PA10 31 PA11 32 PA12 33 PA13 JTMS SWDIO 34 PA14 JTCK SWCLK 37 PA15 JTDI 38 PB0 18 PB1 19 PB2 BOOT1 20 PB3 JTDO 39 PB4 JNTRST 40 PB5 41 PB6 42 PB7 43 PB8 45...

Page 8: ...SC_OUT 3 NRST 4 VDDA 5 PA0 6 PA1 7 PA2 8 PA3 9 PA4 10 PA5 11 PA6 12 PA7 13 PB1 14 VSS 15 VDD 16 PA9 17 PA10 18 PA13 19 PA14 20 U1 GD32F130F8P6 OSC_IN OSC_OUT 3V3 5 Routine use guide 5 1 GPIO_Running_L...

Page 9: ...the board first of all all the LEDs will be flashed once for test Then press down the User Key LED1 will be turned on Press down the User Key again LED1 will be turned off 5 3 EXTI_Key_Interrupt_mode...

Page 10: ...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 i...

Page 11: ...10 11 6 Revision history Table 6 1 Revision history Revision No Description Date 1 0 Initial Release Jun 28 2017 2 0 Updated format across the whole document Jun 1 2019 3 0 Updated format across the w...

Page 12: ...nary business industrial personal and or household applications only The Products are not designed intended or authorized for use as components in systems designed or intended for the operation of wea...

Reviews: